Repository URL to install this package:
|
Version:
1.2.8 ▾
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// import { hasIn } from 'exotic/types/attributes/properties'
const hasIn_1 = require("../attributes/properties/hasIn");
const isMap_1 = __importDefault(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