(src: any, dest: any)
| 392 | } |
| 393 | |
| 394 | export function copySymbolProperties(src: any, dest: any) { |
| 395 | if (typeof (Object as any).getOwnPropertySymbols !== 'function') { |
| 396 | return; |
| 397 | } |
| 398 | const symbols: any = (Object as any).getOwnPropertySymbols(src); |
| 399 | symbols.forEach((symbol: any) => { |
| 400 | const desc = Object.getOwnPropertyDescriptor(src, symbol); |
| 401 | Object.defineProperty(dest, symbol, { |
| 402 | get: function () { |
| 403 | return src[symbol]; |
| 404 | }, |
| 405 | set: function (value: any) { |
| 406 | if (desc && (!desc.writable || typeof desc.set !== 'function')) { |
| 407 | // if src[symbol] is not writable or not have a setter, just return |
| 408 | return; |
| 409 | } |
| 410 | src[symbol] = value; |
| 411 | }, |
| 412 | enumerable: desc ? desc.enumerable : true, |
| 413 | configurable: desc ? desc.configurable : true, |
| 414 | }); |
| 415 | }); |
| 416 | } |
| 417 | |
| 418 | let shouldCopySymbolProperties = false; |
| 419 |
no test coverage detected
searching dependent graphs…