immutable-path
Version:
Immutable `get`, `set`, `has`, `unset` deep path operations libraray for object, array and `Map`.
16 lines • 560 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Returns whether given key/index exists in given object/array/Map exists.
* Returns true even for `undefined` values if key/index exists.
*
* @ignore
* @param source is the source get value from.
* @param key is the key/index get value of.
* @returns value of given index/key.
*/
function _has(source, key) {
return source instanceof Map ? source.has(key) : Object.prototype.hasOwnProperty.call(source, key);
}
exports.default = _has;
//# sourceMappingURL=has.js.map