MCPcopy Create free account
hub / github.com/dipscope/TypeManager.TS / hasCustomValueMap

Method hasCustomValueMap

src/property-metadata.ts:625–652  ·  view source on GitHub ↗

* 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>>)

Source from the content-addressed store, hash-verified

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.

Callers 1

configureMethod · 0.95

Calls 2

clearMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected