MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / formatSet

Function formatSet

python/pythonmonkey/builtin_modules/util.js:929–945  ·  view source on GitHub ↗
(ctx, value, recurseTimes, keys)

Source from the content-addressed store, hash-verified

927}
928
929function formatSet(ctx, value, recurseTimes, keys)
930{
931 const output = new Array(value.size + keys.length + (ctx.showHidden ? 1 : 0));
932 let i = 0;
933 for (const v of value)
934 output[i++] = formatValue(ctx, v, recurseTimes);
935 // With `showHidden`, `length` will display as a hidden property for
936 // arrays. For consistency's sake, do the same for `size`, even though this
937 // property isn't selected by Object.getOwnPropertyNames().
938 if (ctx.showHidden)
939 output[i++] = `[size]: ${ctx.stylize(`${value.size}`, 'number')}`;
940 for (let n = 0; n < keys.length; n++)
941 {
942 output[i++] = formatProperty(ctx, value, recurseTimes, keys[n], 0);
943 }
944 return output;
945}
946
947function formatMap(ctx, value, recurseTimes, keys)
948{

Callers

nothing calls this directly

Calls 2

formatValueFunction · 0.85
formatPropertyFunction · 0.85

Tested by

no test coverage detected