digitalbazaar / cborld

A Javascript CBOR-LD processor for web browsers and Node.js apps.
https://json-ld.github.io/cbor-ld-spec/
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Fixup default argument usage. #41

Closed davidlehn closed 3 years ago

davidlehn commented 3 years ago

Looking at the coverage reports there are many uses of f({value} = {}) or similar where a value is required for the code to work. Will those default paths ever be taken? If so error handling is needed, if not those default constructs can be removed.

dlongley commented 3 years ago

If you don't provide a default then destructuring fails and the code can't even check what is destructured. So on public APIs, it should be there (as a general practice) to avoid confusing errors.

dlongley commented 3 years ago

@davidlehn, closing this issue -- you can reopen if there's something actionable that can be described to be done.