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