Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
exotic / dist / types / collection / isMapish.js
Size: Mime:
"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