(mapOrObject)
| 179 | * @returns |
| 180 | */ |
| 181 | export 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. |
searching dependent graphs…