MCPcopy Index your code
hub / github.com/nodejs/node / filterDuplicateStrings

Function filterDuplicateStrings

lib/internal/util.js:333–345  ·  view source on GitHub ↗
(items, low)

Source from the content-addressed store, hash-verified

331}
332
333function filterDuplicateStrings(items, low) {
334 const map = new SafeMap();
335 for (let i = 0; i < items.length; i++) {
336 const item = items[i];
337 const key = StringPrototypeToLowerCase(item);
338 if (low) {
339 map.set(key, key);
340 } else {
341 map.set(key, item);
342 }
343 }
344 return ArrayPrototypeSort(ArrayFrom(map.values()));
345}
346
347function cachedResult(fn) {
348 let result;

Callers 1

util.jsFile · 0.85

Calls 2

setMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…