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

Function cloneSet

src/utils.ts:207–216  ·  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

205 * @returns A new prototype-free set with the same entries.
206 */
207function cloneSet<T extends Record<string, any>>(set: T): T {
208 const newSet = create(null);
209 const keys = objectKeys(set);
210 let l = keys.length;
211 while (l--) {
212 newSet[keys[l]] = set[keys[l]];
213 }
214
215 return newSet;
216}
217
218/**
219 * 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