(object: unknown, prop: string)
| 455 | } |
| 456 | |
| 457 | function isReadonlyProp(object: unknown, prop: string): boolean { |
| 458 | if ( |
| 459 | prop === 'arguments' || |
| 460 | prop === 'caller' || |
| 461 | prop === 'callee' || |
| 462 | prop === 'name' || |
| 463 | prop === 'length' |
| 464 | ) { |
| 465 | const typeName = getObjectType(object); |
| 466 | return ( |
| 467 | typeName === 'Function' || |
| 468 | typeName === 'AsyncFunction' || |
| 469 | typeName === 'GeneratorFunction' || |
| 470 | typeName === 'AsyncGeneratorFunction' |
| 471 | ); |
| 472 | } |
| 473 | |
| 474 | if ( |
| 475 | prop === 'source' || |
| 476 | prop === 'global' || |
| 477 | prop === 'ignoreCase' || |
| 478 | prop === 'multiline' |
| 479 | ) { |
| 480 | return getObjectType(object) === 'RegExp'; |
| 481 | } |
| 482 | |
| 483 | return false; |
| 484 | } |
| 485 | |
| 486 | export class ModuleMocker { |
| 487 | private readonly _environmentGlobal: typeof globalThis; |
no test coverage detected