mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +08:00
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change We can get rid of a custom script and use ESLint for these rules. Additionally this means editors will highlight the issue in the editor. Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
29 lines
963 B
JavaScript
29 lines
963 B
JavaScript
import _curry2 from './internal/_curry2.js';
|
|
|
|
/**
|
|
* Returns the second argument if it is not `null`, `undefined` or `NaN`;
|
|
* otherwise the first argument is returned.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.10.0
|
|
* @category Logic
|
|
* @sig a -> b -> a | b
|
|
* @param {a} default The default value.
|
|
* @param {b} val `val` will be returned instead of `default` unless `val` is `null`, `undefined` or `NaN`.
|
|
* @return {*} The second value if it is not `null`, `undefined` or `NaN`, otherwise the default value
|
|
* @example
|
|
*
|
|
* const defaultTo42 = R.defaultTo(42);
|
|
*
|
|
* defaultTo42(null); //=> 42
|
|
* defaultTo42(undefined); //=> 42
|
|
* defaultTo42(false); //=> false
|
|
* defaultTo42('Ramda'); //=> 'Ramda'
|
|
* // parseInt('string') results in NaN
|
|
* defaultTo42(parseInt('string')); //=> 42
|
|
*/
|
|
var defaultTo = /*#__PURE__*/_curry2(function defaultTo(d, v) {
|
|
return v == null || v !== v ? d : v;
|
|
});
|
|
export default defaultTo; |