Sha256: 4166b2939ecbb3dadbba693d189b104f46acce05a06c00cf7d74a016b257bc0b

Contents?: true

Size: 714 Bytes

Versions: 26

Compression:

Stored size: 714 Bytes

Contents

import { inspectList } from './helpers.js';
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)} }`;
}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
clapton-0.0.6 lib/clapton/javascripts/node_modules/loupe/lib/map.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/loupe/lib/map.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/loupe/lib/map.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/loupe/lib/map.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/loupe/lib/map.js
clapton-0.0.1 lib/clapton/javascripts/node_modules/loupe/lib/map.js