MCPcopy
hub / github.com/josdejong/mathjs / createMap

Function createMap

src/utils/map.js:181–193  ·  view source on GitHub ↗
(mapOrObject)

Source from the content-addressed store, hash-verified

179 * @returns
180 */
181export function createMap (mapOrObject) {
182 if (!mapOrObject) {
183 return createEmptyMap()
184 }
185 if (isMap(mapOrObject)) {
186 return mapOrObject
187 }
188 if (isObject(mapOrObject)) {
189 return new ObjectWrappingMap(mapOrObject)
190 }
191
192 throw new Error('createMap can create maps from objects or Maps')
193}
194
195/**
196 * Unwraps a map into an object.

Callers 6

map.test.jsFile · 0.90
parseAndEvalFunction · 0.90
evaluate.test.jsFile · 0.90
resolve.jsFile · 0.90
map.transform.jsFile · 0.90
evaluateMethod · 0.90

Calls 3

isMapFunction · 0.90
isObjectFunction · 0.90
createEmptyMapFunction · 0.85

Tested by 1

parseAndEvalFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…