-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle “undefined” as passed option values (#146)
Allow the consumers to pass “undefined” as options values instead of misbehaving. Today if the consumer passes “undefined”, we ignore the default options and allow the “undefined” value to fall through to the rest of the program, resulting in undefined behavior. For an example, the maxDelta becomes NaN if threshold: undefined is provided. After this change we ensure that “undefined” as options values is converted into a default value. It is customary in JavaScript, especially in options objects, to treat a missing key and a key with value of undefined the same way. In particular, it is a distinction that is easily introduced when the customer receives a value from somewhere else and wants to continue to support default values.
- Loading branch information
1 parent
cce03e1
commit bf7001f
Showing
3 changed files
with
19 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters