MCPcopy Create free account
hub / github.com/cure53/DOMPurify / cloneSet

Function cloneSet

src/utils.ts:212–221  ·  view source on GitHub ↗

* Copy a flat lookup table * * @param set - The set to copy. * @returns A new prototype-free set with the same entries.

(set: T)

Source from the content-addressed store, hash-verified

210 * @returns A new prototype-free set with the same entries.
211 */
212function cloneSet<T extends Record<string, any>>(set: T): T {
213 const newSet = create(null);
214 const keys = objectKeys(set);
215 let l = keys.length;
216 while (l--) {
217 newSet[keys[l]] = set[keys[l]];
218 }
219
220 return newSet;
221}
222
223/**
224 * Convert non-node values into strings without depending on direct property access.

Callers 3

_resolveSetOptionFunction · 0.85
_parseConfigFunction · 0.85
_forkSharedAllowlistFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected