| 221 | * @returns a prototype-free clone of cfg[key], or the fallback |
| 222 | */ |
| 223 | const _resolveObjectOption = function <T extends Record<string, any>>( |
| 224 | cfg: Config, |
| 225 | key: keyof Config, |
| 226 | fallback: T |
| 227 | ): T { |
| 228 | const value = objectHasOwnProperty(cfg, key) ? cfg[key] : undefined; |
| 229 | return value && typeof value === 'object' ? clone(value as T) : fallback; |
| 230 | }; |
| 231 | |
| 232 | function createDOMPurify(window: WindowLike = getGlobal()): DOMPurify { |
| 233 | const DOMPurify: DOMPurify = (root: WindowLike) => createDOMPurify(root); |