Download node_modules/loupe/lib/map.js from Snapkitty/sovereign-apollo: direct link, hf CLI and curl.
- Browser
- Download file 691 Bytes
-
https://huggingface.co/Snapkitty/sovereign-apollo/resolve/main/node_modules/loupe/lib/map.js
- Command line
-
hf download hf://Snapkitty/sovereign-apollo/node_modules/loupe/lib/map.js
-
curl -L -o map.js https://huggingface.co/Snapkitty/sovereign-apollo/resolve/main/node_modules/loupe/lib/map.js
691 Bytes
| import { inspectList } from './helpers' | |
| function inspectMapEntry([key, value], options) { | |
| options.truncate -= 4 | |
| key = options.inspect(key, options) | |
| options.truncate -= key.length | |
| value = options.inspect(value, options) | |
| return `${key} => ${value}` | |
| } | |
| // IE11 doesn't support `map.entries()` | |
| function mapToEntries(map) { | |
| const entries = [] | |
| map.forEach((value, key) => { | |
| entries.push([key, value]) | |
| }) | |
| return entries | |
| } | |
| export default function inspectMap(map, options) { | |
| const size = map.size - 1 | |
| if (size <= 0) { | |
| return 'Map{}' | |
| } | |
| options.truncate -= 7 | |
| return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }` | |
| } | |