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

Method cloneTypeOptionsBase

src/type-manager.ts:811–824  ·  view source on GitHub ↗

* Creates a clone of type options base. * * @returns {TypeOptionsBase } Type options base clone.

()

Source from the content-addressed store, hash-verified

809 * @returns {TypeOptionsBase<any>} Type options base clone.
810 */
811 private cloneTypeOptionsBase(): TypeOptionsBase<any>
812 {
813 const typeOptionsBase = this.typeOptionsBase;
814 const customValueMap = typeOptionsBase.customValueMap;
815 const customValueMapClone = new Map<CustomKey<any>, CustomValue>();
816 const typeOptionsBaseClone = Object.assign({}, typeOptionsBase, { customValueMap: customValueMapClone });
817
818 for (const [customKey, customValue] of customValueMap)
819 {
820 customValueMapClone.set(customKey, customValue);
821 }
822
823 return typeOptionsBaseClone;
824 }
825
826 /**
827 * Creates a clone of type options map.

Callers 1

cloneMethod · 0.95

Calls 1

setMethod · 0.80

Tested by

no test coverage detected