The Wayback Machine - https://web.archive.org/web/20201220221418/https://github.com/lodash/lodash/blob/master/isMap.js
Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
27 lines (24 sloc) 665 Bytes
import getTag from './.internal/getTag.js'
import isObjectLike from './isObjectLike.js'
import nodeTypes from './.internal/nodeTypes.js'
/* Node.js helper references. */
const nodeIsMap = nodeTypes && nodeTypes.isMap
/**
* Checks if `value` is classified as a `Map` object.
*
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* isMap(new Map)
* // => true
*
* isMap(new WeakMap)
* // => false
*/
const isMap = nodeIsMap
? (value) => nodeIsMap(value)
: (value) => isObjectLike(value) && getTag(value) == '[object Map]'
export default isMap
You can’t perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.