* Copy a flat lookup table * * @param set - The set to copy. * @returns A new prototype-free set with the same entries.
(set: T)
| 210 | * @returns A new prototype-free set with the same entries. |
| 211 | */ |
| 212 | function 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. |
no outgoing calls
no test coverage detected