Closed ljharb closed 5 years ago
insertFn
isn't optional if you omit updateFn
though. It's a bit odd. Since you need at least 1 fn insertFN
is only optional in light of the value of updateFn
and cannot always be omitted.
right, but omitting updateFn requires an explicit undefined
- so the .length
of the function is 2, because 2 arguments are required at minimum. That there's validation performed on the 2nd, and that its value may force a 3rd to be required, is separate.
The signature for this method should be
(key, updateFn[, insertFn])
since you're able to omit it.