* refactor and expose swapping as a single method
* fixes after rebasing on latest 2.0
* fix optional parameters for swapping
* add `fullSwap` to internal API
* swap refactor polishing
* make linter happy
* Updated mocha, tests now work with node 20
* Update package-lock.json
* Enable Node CI for v2.0v2.0 branch (#2123)
Run tests for v2.0v2.0 branch too
* Bump CI's node version to 20.x
* Update parseInterval to handle "0" correctly
When a parameter like "0ms" is passed in to parseInterval it gets parsed to 0.
Previously this would result in a return value of "undefined" because 0 is falsy
and thus the `return 0 || undefined` statements return undefined.
The purpose of the form `parseFloat(str) || undefined` was to return "undefined" if
parseFloat failed (parseFloat returns NaN, a falsy value, if it can't parse its
argument). Unfortunately, as mentioned, parseFloat can also succeed and return a
falsy value -- when the argument is "0" (or "0.0", etc.). So the new code, rather
than depending on the falsiness of the result of parseFloat, explicitly checks for
a NaN.
* Adds some semicolons
Adds some semicolons to parseInterval (and tests) for consistency.
* Add one more parseInterval test for "0"
Adds test test to make sure parseInterval works on "0".
* Adds functional tests for every, swap, settle, throttle, and delay
* Explcitly check that setTimeout values are > 0
These values come from user settings that are read from parseInterval,
so they could be a number or undefined.
If the value being checked is > 0 setTimeout will be called with some
associated function. If the value is 0 or 'undefined' the associated function
will be called immediately ('undefined' is not greater than 0).
* Change '!== undefined' to '> 0'
`pollInterval !== undefined` is a subtly different conditional than just `pollInterval` or `pollInterval > 0` (which are equivalent). Changes the conditional to `pollInterval > 0` so as to not change the behavior but also be more explicit in the test.
* allow user to override Content-Type header
* reorder the code so it won't use userSetContentType variable
* remove userSetContentType
* clarification
* remove unrelated changes
---------
Co-authored-by: gbourant <root@gbourant.com>