UNPKG

@typescript-package/map

Version:

A lightweight TypeScript library for enhanced `map` management.

1 lines 23.9 kB
{"version":3,"file":"typescript-package-map.mjs","sources":["../../../package/map/src/lib/map-on-hook.abstract.ts","../../../package/map/src/lib/core-map.abstract.ts","../../../package/map/src/lib/data-map.class.ts","../../../package/map/src/lib/factory-map.class.ts","../../../package/map/src/lib/weak-data-map.class.ts","../../../package/map/src/public-api.ts","../../../package/map/src/typescript-package-map.ts"],"sourcesContent":["// Abstract.\nimport { DataCore } from \"@typescript-package/data\";\n/**\n * @description\n * @export\n * @abstract\n * @class OnHook\n * @template Key \n * @template Value \n * @template {DataCore<any>} DataType \n */\nexport abstract class MapOnHook<\n Key,\n Value,\n DataType extends DataCore<any>\n> {\n /**\n * @description Hook called when the data is cleared.\n * @protected\n * @param {DataType} data The data holder.\n */\n protected onClear(data: DataType): void { }\n\n /**\n * @description Hook called when a value is deleted.\n * @protected\n * @param {DataType} data The data holder.\n */\n protected onDelete(key: Key, data: DataType): void { }\n\n /**\n * @description Hook called before the `get` being invoked.\n * @protected\n * @param {Key} key The key to get the value.\n * @param {DataType} data The data holder.\n */\n protected onGet(key: Key, data: DataType): void { }\n\n /**\n * @description Hook called when a value is added.\n * @protected\n * @param {key} key The key under which set the `value`.\n * @param {Type} value The value to set.\n * @param {Type} previousValue The previous value.\n * @param {DataType} data The data holder.\n */\n protected onSet(key: Key, value: Value, previousValue: Value, data: DataType): void { }\n}","import {\n // Abstract.\n DataCore,\n\n // Class.\n Data,\n\n // Constant\n SymbolValue,\n\n // Type.\n DataConstructorInput,\n\n // Interface.\n MapTypeConstructor\n} from '@typescript-package/data';\n// Abstract.\nimport { MapOnHook } from './map-on-hook.abstract';\n/**\n * @description The abstract core class for building customizable `Map` and `DataCore` related classes.\n * @export\n * @abstract\n * @class CoreMap\n * @template Key \n * @template Value \n * @template {Map<Key, Value>} [MapType=Map<Key, Value>] The type of `Map`.\n * @template {DataCore<MapType>} [DataType=Data<MapType>] The `Data` storage type of `Map` type.\n * @extends {MapOnHook<Key, Value, DataType>}\n */\nexport abstract class CoreMap<\n Key,\n Value,\n MapType extends Map<Key, Value> = Map<Key, Value>,\n DataType extends DataCore<MapType> = Data<MapType>,\n> extends MapOnHook<Key, Value, DataType> {\n /**\n * @description Returns the `string` tag representation of the `CoreMap` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n */\n public get [Symbol.toStringTag](): string {\n return CoreMap.name;\n }\n\n /**\n * @description Returns the privately stored data class.\n * @public\n * @readonly\n * @type {DataType}\n */\n public get data() {\n return this.#data;\n }\n\n /**\n * @inheritdoc\n * @public\n * @readonly\n * @type {number}\n */\n public get size() {\n return this.#data.value.size;\n }\n\n /**\n * @description A privately stored data holder of generic type variable `DataType` for the `Map`.\n * @type {DataType}\n */\n #data: DataType;\n \n /**\n * Creates an instance of `CoreMap` child class.\n * @constructor\n * @param {?[Key, Value][]} [entries] Initial value for `Map`.\n * @param {?MapTypeConstructor<Key, Value, MapType>} [map] The map of generic type variable `MapType` for `Map` value.\n * @param {?DataConstructorInput<MapType, DataType>} [data] The data store of generic type variable `DataType` for `Map` value.\n */\n constructor(\n entries?: [Key, Value][],\n map?: MapTypeConstructor<Key, Value, MapType>,\n data?: DataConstructorInput<MapType, DataType>\n ) {\n super();\n this.#data = new (Array.isArray(data) ? data[0] : data ?? Data)(\n new (map ?? Map<Key, Value> as unknown as MapTypeConstructor<Key, Value, MapType>)(entries),\n ...Array.isArray(data) ? data.slice(1) : []\n ) as unknown as DataType;\n }\n\n /**\n * @description Access to the readonly map by using a symbol.\n * @public\n * @returns {Readonly<MapType>} \n */\n public [SymbolValue](): Readonly<MapType> {\n return this.#data.value;\n }\n\n /**\n * Clears all entries.\n * @inheritdoc\n * @public\n * @returns {this} \n */\n public clear(): this {\n this.onClear?.(this.#data);\n this.#data.value.clear();\n return this;\n }\n\n /**\n * Deletes a value from the `key`.\n * @inheritdoc\n * @public\n * @param {Key} key The key to delete.\n * @returns {boolean} \n */\n public delete(key: Key): boolean {\n return this.#data.value.delete(key);\n }\n\n /**\n * @inheritdoc\n */\n public entries(): IterableIterator<[Key, Value]> {\n return this.#data.value.entries();\n }\n\n /**\n * @inheritdoc\n * @public\n * @param {(value: Value, key: Key, map: Map<Key, Value>) => void} callbackfn \n * @param {?*} [thisArg] \n * @returns {this} \n */\n public forEach(callbackfn: (value: Value, key: Key, map: Map<Key, Value>) => void, thisArg?: any): this {\n this.#data.value.forEach(callbackfn, thisArg);\n return this;\n }\n\n /**\n * @inheritdoc\n * @public\n * @param {Key} key The key to get the value.\n */\n public get(key: Key): Value | undefined {\n return this.onGet?.(key, this.#data), this.#data.value.get(key);\n }\n\n /**\n * @inheritdoc\n * @public\n * @param {Key} key The key to check.\n * @returns {boolean} \n */\n public has(key: Key): boolean {\n return this.onGet?.(key, this.#data), this.#data.value.has(key);\n }\n\n /**\n * @inheritdoc\n */\n public keys(): MapIterator<Key> {\n return this.#data.value.keys();\n }\n\n /**\n * @inheritdoc\n * @public\n * @param {Key} key The key under which the `value` set.\n * @param {Value} value The value of `Value` type.\n * @returns {this} The `this` current instance for chaining.\n */\n public set(key: Key, value: Value): this {\n this.onSet?.(key, value, this.#data.value.get(key)!, this.#data);\n this.#data.value.set(key, value);\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public values(): MapIterator<Value> {\n return this.#data.value.values();\n }\n}\n","// Class.\nimport { Data, DataCore, DataConstructorInput } from '@typescript-package/data';\n// Abstract.\nimport { CoreMap } from './core-map.abstract';\n/**\n * @description The `DataMap` is a concrete class that extends `CoreMap` and encapsulates its data within a `DataCore` store, providing additional data management capabilities.\n * @export\n * @class DataMap\n * @template Key \n * @template Value \n * @template {DataCore<Map<Key, Value>>} [DataType=Data<Map<Key, Value>>] \n * @extends {CoreMap<Key, Value, Map<Key, Value>, DataType>}\n */\nexport class DataMap<\n Key,\n Value,\n DataType extends DataCore<Map<Key, Value>> = Data<Map<Key, Value>>,\n> extends CoreMap<Key, Value, Map<Key, Value>, DataType> {\n /**\n * @description \n * @public\n * @static\n * @template {PropertyKey} Key \n * @template Value \n * @template {DataCore<Map<Key, Value>>} [DataType=Data<Map<Key, Value>>] \n * @param {Record<Key, Value>} obj \n * @param {?DataConstructorInput<Map<Key, Value>, DataType>} [data] \n * @returns {DataMap<Key, Value, DataType>} \n */\n public static fromObject<\n Key extends PropertyKey,\n Value,\n DataType extends DataCore<Map<Key, Value>> = Data<Map<Key, Value>>\n >(\n obj: Record<Key, Value>,\n data?: DataConstructorInput<Map<Key, Value>, DataType>\n ): DataMap<Key, Value, DataType> {\n return new DataMap(Object.entries(obj) as [Key, Value][], data);\n }\n\n /**\n * @description Returns the `string` tag representation of the `DataMap` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n */\n public override get [Symbol.toStringTag](): string {\n return DataMap.name;\n }\n\n /**\n * Creates an instance of `DataMap`.\n * @constructor\n * @param {?[Key, Value][]} [entries] Initial value for `Map`.\n * @param {?DataConstructorInput<Map<Key, Value>, DataType>} [data] The data store of `DataType` for `Map` value, also with params.\n */\n constructor(\n entries?: [Key, Value][],\n data?: DataConstructorInput<Map<Key, Value>, DataType>\n ) {\n super(entries, Map, data);\n }\n}\n","import {\n // Abstract.\n DataCore,\n // Class.\n Data,\n // Type.\n DataConstructorInput,\n // Interface.\n MapTypeConstructor,\n} from '@typescript-package/data';\n// Abstract.\nimport { CoreMap } from './core-map.abstract';\n/**\n * @description\n * @export\n * @class FactoryMap\n * @template Key \n * @template Value \n * @template {Map<Key, Value>} [MapType=Map<Key, Value>] \n * @template {DataCore<MapType>} [DataType=Data<MapType>] \n * @extends {CoreMap<Key, Value, MapType, DataType>}\n */\nexport class FactoryMap<\n Key,\n Value,\n MapType extends Map<Key, Value> = Map<Key, Value>,\n DataType extends DataCore<MapType> = Data<MapType>,\n> extends CoreMap<Key, Value, MapType, DataType> {\n /**\n * @description\n * @public\n * @static\n * @template {PropertyKey} Key \n * @template Value \n * @template {Map<Key, Value>} [MapType=Map<Key, Value>] \n * @template {DataCore<MapType>} [DataType=Data<MapType>] \n * @param {Record<Key, Value>} obj \n * @param {?MapTypeConstructor<Key, Value, MapType>} [map] \n * @param {?DataConstructorInput<MapType, DataType>} [data] \n * @param {{\n * defaultValue?: () => Value;\n * cloner?: (value: Value) => Value;\n * }} [param0={}] \n * @param {() => Value} param0.defaultValue \n * @param {(value: Value) => Value} param0.cloner \n * @returns {FactoryMap<Key, Value, MapType, DataType>} \n */\n public static fromObject<\n Key extends PropertyKey,\n Value,\n MapType extends Map<Key, Value> = Map<Key, Value>,\n DataType extends DataCore<MapType> = Data<MapType>\n >(\n obj: Record<Key, Value>,\n map?: MapTypeConstructor<Key, Value, MapType>,\n data?: DataConstructorInput<MapType, DataType>,\n { defaultValue, cloner }:\n {\n defaultValue?: () => Value;\n cloner?: (value: Value) => Value;\n } = {}\n ): FactoryMap<Key, Value, MapType, DataType> {\n return new FactoryMap(\n Object.entries(obj) as [Key, Value][],\n map,\n data,\n { cloner, defaultValue }\n );\n }\n\n /**\n * @description Returns the `string` tag representation of the `FactoryMap` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n */\n public override get [Symbol.toStringTag](): string {\n return FactoryMap.name;\n }\n\n /**\n * @description Returns the privately stored data class.\n * @public\n * @readonly\n * @type {DataType}\n */\n public override get data() {\n return super.data;\n }\n\n /**\n * @description Returns the default value.\n * @public\n * @readonly\n * @type {Value | undefined}\n */\n public get defaultValue() {\n return this.#defaultValue?.();\n }\n\n /**\n * @description Privately stored function to set the default value in missing keys.\n * @public\n * @readonly\n * @type {() => Value}\n */\n #defaultValue?: () => Value;\n\n /**\n * @description Privately stored cloner function to clone the returned value.\n * @public\n * @readonly\n * @type {(value: Value) => Value}\n */\n #cloner?: (value: Value) => Value;\n\n /**\n * @description Privately stored comparator for sorting.\n * @param {[Key, Value]} a \n * @param {[Key, Value]} b \n * @returns {(a: [Key, Value], b: [Key, Value]) => number} \n */\n #comparator: (a: [Key, Value], b: [Key, Value]) => number = (a, b) => `${a}`.localeCompare(`${b}`);\n\n /**\n * @description Whether the map is ordered.\n * @type {boolean}\n */\n #ordered;\n\n /**\n * Creates an instance of `FactoryMap`.\n * @constructor\n * @param {?[Key, Value][]} [entries] \n * @param {?MapTypeConstructor<Key, Value, MapType>} [map] \n * @param {?DataConstructorInput<MapType, DataType>} [data] \n * @param {{\n * cloner?: (value: Value) => Value,\n * comparator?: ((a: [Key, Value], b: [Key, Value]) => number),\n * defaultValue?: () => Value,\n * ordered?: boolean;\n * }} [param0={}] \n * @param {(value: Value) => Value} param0.cloner \n * @param {(a: [Key, Value], b: [Key, Value]) => number} param0.comparator \n * @param {() => Value} param0.defaultValue \n * @param {boolean} param0.ordered \n */\n constructor(\n entries?: [Key, Value][],\n map?: MapTypeConstructor<Key, Value, MapType>,\n data?: DataConstructorInput<MapType, DataType>,\n {cloner, comparator, defaultValue, ordered}: {\n cloner?: (value: Value) => Value,\n comparator?: ((a: [Key, Value], b: [Key, Value]) => number),\n defaultValue?: () => Value,\n ordered?: boolean;\n } = {}\n ) {\n super(entries, map, data);\n this.#cloner = cloner;\n this.#defaultValue = defaultValue;\n this.#ordered = ordered;\n typeof comparator === 'function' && (this.#comparator = comparator);\n (Array.isArray(entries) && entries.length > 0 && ordered) && this.sort();\n }\n\n /**\n * @inheritdoc\n * @public\n * @param {Key} key \n * @returns {(Value | undefined)} \n */\n public override get(key: Key): Value | undefined {\n (!super.has(key) && typeof this.#defaultValue === 'function') && super.data.value.set(key, this.#defaultValue());\n const value = super.get(key);\n return typeof this.#cloner === 'function' && value ? this.#cloner(value) : value;\n }\n\n /**\n * @description Gets the cloner function, to use for e.g. `structuredClone`.\n * @public\n * @returns {((value: Value) => Value) | undefined} \n */\n public getCloner() {\n return this.#cloner;\n }\n\n /**\n * @description Returns the default value function.\n * @public\n * @returns {(() => Value) | undefined}\n */\n public getDefaultValue() {\n return this.#defaultValue;\n }\n\n /**\n * @inheritdoc\n * @public\n * @param {Key} key \n * @param {Value} value \n * @returns {this} \n */\n public override set(key: Key, value: Value) {\n super.set(key, value);\n this.#ordered === true && this.sort();\n return this;\n }\n\n /**\n * @description Sets the cloner function, to use for e.g. `structuredClone`.\n * @public\n * @param {(value: Value) => Value} clonerFn\n * @returns {this} The current instance of `FactoryMap`.\n * @example\n * ```ts\n * const map = new FactoryMap<string, number>();\n * map.setCloner((value) => structuredClone(value));\n * console.log(map.get('key')); // undefined\n * map.set('key', { a: 1 });\n * console.log(map.get('key')); // { a: 1 }\n * map.set('key', { a: 2 });\n * console.log(map.get('key')); // { a: 2 }\n * ```\n */\n public setCloner(clonerFn: (value: Value) => Value): this {\n typeof clonerFn === 'function' && (this.#cloner = clonerFn);\n return this;\n }\n\n /**\n * @description Sets the compare function used in sorting.\n * @public\n * @param {(a: [Key, Value], b: [Key, Value]) => number} compareFn\n * @returns {this}\n */\n public setComparator(compareFn: (a: [Key, Value], b: [Key, Value]) => number): this {\n typeof compareFn === 'function' && (this.#comparator = compareFn);\n return this;\n }\n\n /**\n * @description Sets the default value function.\n * @public\n * @param {() => Value} valueFn\n * @returns {this} The current instance of `FactoryMap`.\n * @example\n * ```ts\n * const map = new FactoryMap<string, number>();\n * map.setDefaultValue(() => 0);\n * console.log(map.get('key')); // 0\n * map.set('key', 1);\n * console.log(map.get('key')); // 1\n * ```\n */\n public setDefaultValue(valueFn: () => Value): this {\n this.#defaultValue = valueFn;\n return this;\n }\n\n /**\n * @description Sets whether the map should sort automatically after each `set`.\n * @public\n * @param {boolean} ordered\n * @returns {this}\n */\n public setOrdered(ordered: boolean): this {\n this.#ordered = ordered;\n return this;\n }\n\n /**\n * @description Sorts the map with a stored or given comparator.\n * @public\n * @param {(a: [Key, Value], b: [Key, Value]) => number} [compareFn=this.#comparator] \n * @returns {this} \n */\n public sort(compareFn: (a: [Key, Value], b: [Key, Value]) => number = this.#comparator): this {\n const entries = [...super.entries()];\n entries.length > 0 && (\n super.clear(),\n entries.sort((a, b) => compareFn(a, b)).forEach(([k, v]) => this.set(k, v))\n );\n return this;\n }\n}\n","// Class.\nimport { DataMap } from './data-map.class';\nimport { WeakData } from '@typescript-package/data';\n/**\n * @description The `WeakDataMap` class is a concrete class that stores data in a static `WeakMap`.\n * @export\n * @class WeakDataMap\n * @template Key \n * @template Value \n * @extends {DataMap<Key, Value, WeakData<Map<Key, Value>>>}\n */\nexport class WeakDataMap<Key, Value> extends DataMap<Key, Value, WeakData<Map<Key, Value>>> {\n /**\n * @description Returns the `string` tag representation of the `WeakDataMap` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n * @type {string}\n */\n public override get [Symbol.toStringTag](): string {\n return WeakDataMap.name;\n }\n\n /**\n * Creates an instance of `WeakDataMap`.\n * @constructor\n * @param {?[Key, Value][]} [entries] \n */\n constructor(entries?: [Key, Value][]) {\n super(entries, WeakData);\n }\n}\n","/*\n * Public API Surface of map\n */\nexport {\n // Abstract.\n CoreMap,\n MapOnHook,\n \n // Class.\n DataMap,\n FactoryMap,\n WeakDataMap,\n} from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;;;;;;;AAQG;MACmB,SAAS,CAAA;AAK7B;;;;AAIG;IACO,OAAO,CAAC,IAAc,EAAA;AAEhC;;;;AAIG;AACO,IAAA,QAAQ,CAAC,GAAQ,EAAE,IAAc;AAE3C;;;;;AAKG;AACO,IAAA,KAAK,CAAC,GAAQ,EAAE,IAAc;AAExC;;;;;;;AAOG;IACO,KAAK,CAAC,GAAQ,EAAE,KAAY,EAAE,aAAoB,EAAE,IAAc,EAAA;AAC7E;;AC7BD;;;;;;;;;;AAUG;AACG,MAAgB,OAKpB,SAAQ,SAA+B,CAAA;AACvC;;;;AAIG;AACH,IAAA,KAAY,MAAM,CAAC,WAAW,CAAC,GAAA;QAC7B,OAAO,OAAO,CAAC,IAAI;;AAGrB;;;;;AAKG;AACH,IAAA,IAAW,IAAI,GAAA;QACb,OAAO,IAAI,CAAC,KAAK;;AAGnB;;;;;AAKG;AACH,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