UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

30 lines (26 loc) 789 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ramda = require("ramda"); var _primitives = require("./internal/primitives"); /** * Returns the argument if it is not null, undefined or NaN; otherwise the empty object is returned. * * @func * @category Logic * * @example * * R_.defaultToEmptyObject(null); //=> {} * R_.defaultToEmptyObject(undefined); //=> {} * R_.defaultToEmptyObject('Ramda'); //=> 'Ramda' * // parseInt('string') results in NaN * R_.defaultToEmptyObject(parseInt('string')); //=> {} * * @sig a -> a | Object */ var defaultToEmptyObject = (0, _ramda.defaultTo)(_primitives.emptyObject); var _default = defaultToEmptyObject; exports.default = _default;