Repository URL to install this package:
|
Version:
2.0.5 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hasIn_1 = require("../attributes/properties/hasIn");
const isMap_1 = require("./isMap");
/**
* @func isMapish
*
* @memberOf is
* @since 3.0.0
* @extends isMap
* @alias isMapLike
* @variation also checks `instanceof Chainable`
*
* @param {*} x value to check
* @return {boolean} isMapish
*
* @example
*
* isMapish(new Map)
* //=> true
*
* isMapish(new Chain)
* //=> true
*
* isMapish({})
* //=> false
*
* isMapish(1)
* //=> false
*
*/
const isMapishness = (x) => hasIn_1.hasIn(x, 'get') &&
hasIn_1.hasIn(x, 'set') &&
hasIn_1.hasIn(x, 'entries') &&
hasIn_1.hasIn(x, 'keys') &&
hasIn_1.hasIn(x, 'clear') &&
hasIn_1.hasIn(x, 'delete');
exports.default = (x) => isMap_1.default(x) || isMapishness(x);
//# sourceMappingURL=isMapish.js.map