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

Method resolveCustomValueMap

src/type-metadata.ts:808–836  ·  view source on GitHub ↗

* Resolves custom value map the same way as it is done for the main options. * * @returns {ReadonlyMap , CustomValue>} Resolved custom value map.

()

Source from the content-addressed store, hash-verified

806 * @returns {ReadonlyMap<CustomKey<any>, CustomValue>} Resolved custom value map.
807 */
808 private resolveCustomValueMap(): ReadonlyMap<CustomKey<any>, CustomValue>
809 {
810 const typeOptionsBase = this.typeOptionsBase;
811 const typeOptions = this.typeOptions;
812 const customValueMap = new Map<CustomKey<any>, CustomValue>();
813
814 if (typeOptions.customValueMap === undefined)
815 {
816 return customValueMap;
817 }
818
819 const baseCustomValueMap = typeOptionsBase.customValueMap === undefined
820 ? EMPTY_MAP
821 : typeOptionsBase.customValueMap;
822
823 for (const [customKey, customValue] of typeOptions.customValueMap)
824 {
825 if (customValue === undefined)
826 {
827 customValueMap.set(customKey, baseCustomValueMap.get(customKey));
828
829 continue;
830 }
831
832 customValueMap.set(customKey, customValue);
833 }
834
835 return customValueMap;
836 }
837
838 /**
839 * Resolves own parent type metadatas.

Callers 1

resolveTypeStateMethod · 0.95

Calls 2

setMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected