(Adaptive Loop) Pass 3

(Adaptive Loop) Record freeze commit hash in context manifest
This commit is contained in:
AlexKucera committed 2026-08-13 15:23:35 +02:00
1 parent 72497dcdbe
commit 2c1d0fc4d0
1079 files changed
+1131878

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
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) {
if (map.size === 0)
return 'Map{}';
options.truncate -= 7;
return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
}