* Resolves type state. * * Calling this method has side effects by recomputing type state. If you need current * type state then use provided getter for that. * * @returns {ResolvedTypeState } Resolved type state.
()
| 603 | * @returns {ResolvedTypeState<TObject>} Resolved type state. |
| 604 | */ |
| 605 | public resolveTypeState(): ResolvedTypeState<TObject> |
| 606 | { |
| 607 | const typeOptionsBase = this.typeOptionsBase; |
| 608 | const typeOptions = this.typeOptions; |
| 609 | const typeName = this.typeName; |
| 610 | const alias = typeOptions.alias; |
| 611 | const beforeSerializeCallback = typeOptions.beforeSerializeCallback; |
| 612 | const afterDeserializeCallback = typeOptions.afterDeserializeCallback; |
| 613 | const customValueMap = this.resolveCustomValueMap(); |
| 614 | |
| 615 | const preserveNull = typeOptions.preserveNull === undefined |
| 616 | ? typeOptionsBase.preserveNull |
| 617 | : typeOptions.preserveNull; |
| 618 | |
| 619 | const useDefaultValue = typeOptions.useDefaultValue === undefined |
| 620 | ? typeOptionsBase.useDefaultValue |
| 621 | : typeOptions.useDefaultValue; |
| 622 | |
| 623 | const useImplicitConversion = typeOptions.useImplicitConversion === undefined |
| 624 | ? typeOptionsBase.useImplicitConversion |
| 625 | : typeOptions.useImplicitConversion; |
| 626 | |
| 627 | const serializedDefaultValue = typeOptions.defaultValue === undefined |
| 628 | ? typeOptions.serializedDefaultValue |
| 629 | : typeOptions.defaultValue; |
| 630 | |
| 631 | const serializedDefaultValueResolver = useDefaultValue |
| 632 | ? (typeof serializedDefaultValue === 'function' ? serializedDefaultValue : () => serializedDefaultValue) |
| 633 | : DEFAULT_VALUE_RESOLVER; |
| 634 | |
| 635 | const serializedNullValueResolver = preserveNull |
| 636 | ? NULL_VALUE_RESOLVER |
| 637 | : serializedDefaultValueResolver; |
| 638 | |
| 639 | const deserializedDefaultValue = typeOptions.defaultValue === undefined |
| 640 | ? typeOptions.deserializedDefaultValue |
| 641 | : typeOptions.defaultValue; |
| 642 | |
| 643 | const deserializedDefaultValueResolver = useDefaultValue |
| 644 | ? (typeof deserializedDefaultValue === 'function' ? deserializedDefaultValue : () => deserializedDefaultValue) |
| 645 | : DEFAULT_VALUE_RESOLVER; |
| 646 | |
| 647 | const deserializedNullValueResolver = preserveNull |
| 648 | ? NULL_VALUE_RESOLVER |
| 649 | : deserializedDefaultValueResolver; |
| 650 | |
| 651 | const discriminant = typeOptions.discriminant === undefined |
| 652 | ? typeName |
| 653 | : typeOptions.discriminant; |
| 654 | |
| 655 | const discriminator = typeOptions.discriminator === undefined |
| 656 | ? typeOptionsBase.discriminator |
| 657 | : typeOptions.discriminator; |
| 658 | |
| 659 | const factory = typeOptions.factory === undefined |
| 660 | ? typeOptionsBase.factory |
| 661 | : typeOptions.factory; |
| 662 |
no test coverage detected