* Configures custom value map. * * @param {Optional , CustomValue>>} customValueMap Custom value map or undefined. * * @returns {this} Current instance of property metadata.
(customValueMap: Optional<Map<CustomKey<any>, CustomValue>>)
| 623 | * @returns {this} Current instance of property metadata. |
| 624 | */ |
| 625 | public hasCustomValueMap(customValueMap: Optional<Map<CustomKey<any>, CustomValue>>): this |
| 626 | { |
| 627 | let currentCustomValueMap = this.propertyOptions.customValueMap; |
| 628 | |
| 629 | if (currentCustomValueMap === undefined) |
| 630 | { |
| 631 | currentCustomValueMap = new Map<CustomKey<any>, CustomValue>(); |
| 632 | |
| 633 | this.propertyOptions.customValueMap = currentCustomValueMap; |
| 634 | } |
| 635 | |
| 636 | if (customValueMap !== undefined) |
| 637 | { |
| 638 | if (currentCustomValueMap !== customValueMap) |
| 639 | { |
| 640 | currentCustomValueMap.clear(); |
| 641 | } |
| 642 | |
| 643 | for (const [customKey, customValue] of customValueMap) |
| 644 | { |
| 645 | currentCustomValueMap.set(customKey, customValue); |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | this.currentPropertyState = new UnresolvedPropertyState<TDeclaringObject, TObject>(this); |
| 650 | |
| 651 | return this; |
| 652 | } |
| 653 | |
| 654 | /** |
| 655 | * Configures custom value. |