UNPKG

@typescript-package/descriptor

Version:

A lightweight TypeScript library for property descriptor.

1 lines 31.4 kB
{"version":3,"file":"typescript-package-descriptor.mjs","sources":["../../../package/descriptor/src/lib/common-descriptor.abstract.ts","../../../package/descriptor/src/lib/accessor-descriptor.class.ts","../../../package/descriptor/src/lib/data-descriptor.class.ts","../../../package/descriptor/src/lib/descriptor.class.ts","../../../package/descriptor/src/lib/descriptors.class.ts","../../../package/descriptor/src/lib/property-descriptor-chain.class.ts","../../../package/descriptor/src/public-api.ts","../../../package/descriptor/src/typescript-package-descriptor.ts"],"sourcesContent":["/**\n * @description\n * @export\n * @abstract\n * @class CommonDescriptor\n */\nexport abstract class CommonDescriptor {\n /**\n * @description The default value for configurable.\n * @public\n * @static\n * @type {?boolean}\n */\n public static configurable?: boolean;\n\n // \n /**\n * @description The default value for enumerable.\n * @public\n * @static\n * @type {?boolean}\n */\n public static enumerable?: boolean;\n\n //#region Property descriptor\n /**\n * @description\n * @public\n * @type {?boolean}\n */\n public configurable?: boolean;\n\n /**\n * @description\n * @public\n * @type {?boolean}\n */\n public enumerable?: boolean;\n //#endregion\n\n /**\n * Creates an instance of child class.\n * @constructor\n * @param {Pick<PropertyDescriptor, 'configurable' | 'enumerable'>} [param0={}] \n * @param {Pick<PropertyDescriptor, \"configurable\" | \"enumerable\">} param0.configurable \n * @param {Pick<PropertyDescriptor, \"configurable\" | \"enumerable\">} param0.enumerable \n */\n constructor(\n { configurable, enumerable }: Pick<PropertyDescriptor, 'configurable' | 'enumerable'> = {},\n ) {\n delete this.configurable, delete this.enumerable;\n\n typeof configurable === 'boolean'\n ? (this.configurable = configurable)\n : typeof CommonDescriptor.configurable === 'boolean' && (this.configurable = CommonDescriptor.configurable);\n\n typeof enumerable === 'boolean'\n ? (this.enumerable = enumerable)\n : typeof CommonDescriptor.enumerable === 'boolean' && (this.enumerable = CommonDescriptor.enumerable);\n }\n}\n","// Abstract,\nimport { CommonDescriptor } from './common-descriptor.abstract';\n// Interface.\nimport { ThisAccessorPropertyDescriptor } from '@typedly/descriptor';\n// Type.\nimport { ValidationCallback } from '@typedly/callback';\n/**\n * @description\n * @export\n * @class AccessorDescriptor\n * @template {object} [Obj=object] \n * @template {keyof Obj} [PropertyName=keyof Obj] \n * @template [Value=Obj[PropertyName]] \n * @extends {CommonDescriptor}\n */\nexport class AccessorDescriptor<\n Obj extends object = object,\n PropertyName extends keyof Obj = keyof Obj,\n Value = Obj[PropertyName],\n> extends CommonDescriptor {\n /**\n * @description Returns strictly defined accessor descriptor of a `ThisAccessorPropertyDescriptor<Value, Obj>` type on `get` or `set` property detected.\n * @param descriptor An `object` of a `ThisAccessorPropertyDescriptor<Value, Obj>` type, to define with the default values of the\n * `CommonDescriptor`.\n * @param onGuard A `ValidationCallback` function to handle the result of the check whether the `descriptor` is an `object`\n * with `get` or `set` property, by default it uses `accessorCallback()` function.\n * @throws Throws an error if the descriptor is not an object of a `ThisAccessorPropertyDescriptor<Value, Obj>` type, which means it\n * doesn't contain `get` or `set` property.\n * @returns The returned value is an `object` of a `ThisAccessorPropertyDescriptor<Value, Obj>` type.\n */\n public static define<Value, Obj extends object = object>(\n descriptor: ThisAccessorPropertyDescriptor<Value, Obj>,\n onGuard?: ValidationCallback\n ): ThisAccessorPropertyDescriptor<Value, Obj> | undefined {\n const { configurable, enumerable, get, set } = descriptor;\n return this.guard(descriptor, onGuard)\n ? {\n ...{\n configurable: AccessorDescriptor.configurable,\n enumerable: AccessorDescriptor.enumerable,\n },\n ...{ configurable, enumerable, get, set }\n }\n : undefined;\n }\n\n /**\n * @description Guards the `descriptor` to be an `object` of a `ThisAccessorPropertyDescriptor<Value, Obj>` type.\n * @param descriptor The object of a `ThisAccessorPropertyDescriptor<Value, Obj>` type to guard.\n * @param callbackFn A `ValidationCallback` function to handle the result of the check whether or not the descriptor is an `object`\n * containing the `get` or `set` property.\n * @throws Throws an error if the descriptor is not an object of a `ThisAccessorPropertyDescriptor<Value, Obj>` type, which means it\n * doesn't contain `get` or `set` property.\n * @returns The return value is a boolean indicating whether the `descriptor` is an `object` with the `get` or `set` property.\n */\n public static guard<Value, Obj extends object>(\n descriptor: ThisAccessorPropertyDescriptor<Value, Obj>,\n callbackFn?: ValidationCallback\n ): descriptor is ThisAccessorPropertyDescriptor<Value, Obj> {\n return callbackFn?.(typeof descriptor === 'object' && ('get' in descriptor || 'set' in descriptor), descriptor) || false;\n }\n\n //#region Accessor descriptor.\n /**\n * @description\n * @public\n * @type {?() => Value}\n */\n public get?: () => Value;\n\n /**\n * @description\n * @public\n * @type {?(value: Value) => void}\n */\n public set?: (value: Value) => void;\n //#endregion\n\n /**\n * Creates an instance of `AccessorDescriptor`.\n * @constructor\n * @param {AccessorPropertyDescriptor<Value>} [param0={}] \n * @param {AccessorPropertyDescriptor<Value>} param0.get \n * @param {AccessorPropertyDescriptor<Value>} param0.set \n * @param {?Obj} [object] \n * @param {?PropertyName} [key] \n */\n constructor(\n { configurable, enumerable, get, set }: ThisAccessorPropertyDescriptor<Value, Obj> = {},\n object?: Obj,\n key?: PropertyName\n ) {\n super({ configurable, enumerable });\n delete this.get, delete this.set;\n typeof get === 'function' && (this.get = get);\n typeof set === 'function' && (this.set = set);\n }\n}\n","// Abstract.\nimport { CommonDescriptor } from './common-descriptor.abstract';\n// Interface.\nimport { DataPropertyDescriptor } from '@typedly/descriptor';\n// Type.\nimport { ValidationCallback } from '@typedly/callback';\n/**\n * @description\n * @export\n * @class DataDescriptor\n * @template Value \n */\nexport class DataDescriptor<Value> extends CommonDescriptor {\n /**\n * Returns strictly defined data descriptor of a `DataPropertyDescriptor<Value>` interface on `writable` or `value` property detected.\n * Strictly means, parameter `descriptor` is type guarded and method picks `configurable`, `enumerable`, `writable`, `value`\n * properties from the provided `descriptor` object.\n * @param descriptor An `object` of a `DataPropertyDescriptor<Value>` interface, to set with the default values of the\n * `CommonDescriptor`.\n * @param onValidate An optional `ResultCallback` function to handle the result of the check whether or not the `descriptor` is an `object`\n * with the `writable` or `value` property, by default it uses `dataCallback()` function from the static `guard()` method.\n * @returns The return value is an `object` of a `DataPropertyDescriptor<Value>` interface.\n */\n public static define<Value>(\n descriptor: DataPropertyDescriptor<Value>,\n onValidate?: ValidationCallback\n ): DataPropertyDescriptor<Value> | undefined {\n const { configurable, enumerable, value, writable } = descriptor;\n return this.guard(descriptor, onValidate)\n ? {\n ...{\n configurable: CommonDescriptor.configurable,\n enumerable: DataDescriptor.enumerable,\n writable: DataDescriptor.writable, \n },\n ...{ configurable, enumerable, value, writable }\n }\n : undefined;\n }\n\n /**\n * @description Guards the `descriptor` to be an `object` of a `DataPropertyDescriptor<Value>` interface.\n * @param descriptor Object of a `DataPropertyDescriptor<Value>` interface to guard.\n * @param callbackFn A `ResultCallback` function to handle the result of the check whether or not the `descriptor`\n * is an `object` with the `writable` or `value` property, by default it uses `dataCallback()` function.\n * @throws Throws an error if the `descriptor` is not an `object` of a `DataPropertyDescriptor<Value>` interface, which means doesn't\n * contain `writable` or `value` property.\n * @returns The return value is a `boolean` indicating whether the `descriptor` is an `object` with the `writable` or `value` property.\n */\n public static guard<Value>(\n descriptor: DataPropertyDescriptor<Value>,\n callbackFn?: ValidationCallback\n ): descriptor is DataPropertyDescriptor<Value> {\n return typeof callbackFn === 'function'\n ? callbackFn(typeof descriptor === 'object' && 'value' in descriptor, descriptor)\n : false;\n }\n\n /**\n * @description Default writable.\n * @public\n * @static\n * @type {?boolean}\n */\n public static writable?: boolean;\n\n /**\n * @description\n * @public\n * @type {?Value}\n */\n public value?: Value;\n\n /**\n * @description\n * @public\n * @type {?boolean}\n */\n public writable?: boolean;\n\n /**\n * Creates an instance of `DataDescriptor`.\n * @constructor\n * @param {DataPropertyDescriptor<Value>} [param0={}] \n * @param {DataPropertyDescriptor<Value>} param0.configurable \n * @param {DataPropertyDescriptor<Value>} param0.enumerable \n * @param {DataPropertyDescriptor<Value>} param0.value \n * @param {DataPropertyDescriptor<Value>} param0.writable \n */\n constructor({ configurable, enumerable, value, writable }: DataPropertyDescriptor<Value> = {},) {\n super({ configurable, enumerable });\n delete this.writable;\n typeof writable === 'boolean' && (this.writable = writable);\n this.value = value;\n }\n}\n","// Abstract.\nimport { CommonDescriptor } from './common-descriptor.abstract';\n// Class.\nimport { AccessorDescriptor } from './accessor-descriptor.class';\nimport { DataDescriptor } from './data-descriptor.class';\n// Interface.\nimport { DataPropertyDescriptor } from '@typedly/descriptor';\n// Type.\nimport { AnyPropertyDescriptor } from '@typedly/descriptor';\nimport { ObjectPropertyDescriptors } from '@typedly/descriptor';\nimport { ValidationCallback } from '@typedly/callback';\nimport { ThisAccessorPropertyDescriptor } from '@typedly/descriptor';\n/**\n * @description\n * @export\n * @class Descriptor\n * @template {object} [Obj=object] \n * @template {keyof Obj} [PropertyName=keyof Obj] \n * @template [Value=Obj[PropertyName]] \n */\nexport class Descriptor<\n Obj extends object = object,\n PropertyName extends keyof Obj = keyof Obj,\n Value = Obj[PropertyName],\n> extends CommonDescriptor {\n /**\n * @description Returns accessor descriptor of a `ThisAccessorPropertyDescriptor<Value, Obj>` type, on `get` or `set` property detected.\n * @param descriptor An `object` of a `ThisAccessorPropertyDescriptor<Value, Obj>` type, to define with the default values of the\n * `CommonDescriptor`.\n * @param onValidate An optional `ValidationCallback` function to handle the result of the check whether or not the `descriptor` is an\n * `object` with `get` or `set` property, by default it uses `accessorCallback()` function from the `guard`.\n * @throws Throws an `Error` if the `descriptor` is not an `object` of a `ThisAccessorPropertyDescriptor<Value, Obj>` type,\n * which means it doesn't contain `get` or `set` property.\n * @returns The return value is an `object` of a `ThisAccessorPropertyDescriptor<Value, Obj>` type.\n */\n public static defineAccessor<Value, Obj extends object>(\n descriptor: ThisAccessorPropertyDescriptor<Value, Obj>,\n onValidate?: ValidationCallback\n ): ThisAccessorPropertyDescriptor<Value, Obj> | undefined {\n return AccessorDescriptor.define(descriptor, onValidate);\n }\n\n /**\n * @description Returns data descriptor of a `DataPropertyDescriptor<Value>` interface, on `writable` or `value` property detected.\n * @param descriptor An `object` of a `DataPropertyDescriptor<Value>` interface, to set with the default values of the\n * `CommonDescriptor`.\n * @param onValidate An optional `ValidationCallback` function to handle the result of the check whether or not the `descriptor` is an `object`\n * with the `writable` or `value` property, by default it uses `dataCallback()` function from the static `DataPropertyDescriptors.guard()` method.\n * @returns The return value is an `object` of a `DataPropertyDescriptor<Value>` interface.\n */\n public static defineData<Value>(\n descriptor: DataPropertyDescriptor<Value>,\n onValidate?: ValidationCallback\n ): DataPropertyDescriptor<Value> | undefined {\n return DataDescriptor.define(descriptor, onValidate);\n }\n\n /**\n * @description Returns property descriptors from the specified object and its prototype.\n * @param object An `object` of a generic `Obj` type to get property descriptors.\n * @returns The return value is an `object` of a `ObjectPropertyDescriptors<Obj>` type.\n */\n public static fromObject<Obj extends object>(\n object: Obj\n ): ObjectPropertyDescriptors<Obj> | undefined {\n return {\n ...Object.getOwnPropertyDescriptors(Object.getPrototypeOf(object)) || {}, // ['__proto__'] equivalent to getPrototypeOf()\n ...Object.getOwnPropertyDescriptors(object) || {},\n } as any;\n }\n\n /**\n * Returns property descriptor from the `object` or `class` prototype.\n * Wrapper function for the `getOwnPropertyDescriptor`, which \"Gets the own property descriptor of the specified object.\"\n * @param object An `object` of a generic `Obj` type or a class to get own property descriptor with the specified `key`.\n * If `class` is provided then it uses its prototype to get the property descriptor.\n * @param key A `keyof Obj` value to get property descriptor from the `object`.\n * @returns The return value is an `object` of a `PropertyDescriptor` interface or an `undefined`.\n */\n public static fromProperty<Obj extends object, Key extends keyof Obj>(\n object: Obj,\n key: Key\n ): PropertyDescriptor | undefined {\n return (\n Object.getOwnPropertyDescriptor(object, key) ||\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(object), key)\n );\n }\n\n /**\n * @alias fromProperty()\n */\n public static get<Obj extends object, Name extends keyof Obj>(\n object: Obj,\n name: Name\n ): PropertyDescriptor | undefined {\n return this.fromProperty(object, name);\n }\n\n /**\n * @alias fromObject()\n */\n public static getAll<Obj extends object>(\n object: Obj\n ): ObjectPropertyDescriptors<Obj> | undefined {\n return this.fromObject(object);\n }\n\n /**\n *\n * @param object\n * @param names\n * @returns\n */\n public static pick<Obj extends object | Function, Names extends keyof Obj>(\n object: Obj,\n ...names: Names[]\n ): Pick<ObjectPropertyDescriptors<Obj>, Names> {\n // Prepare constant to assign descriptors of picked keys.\n const pickedDescriptors: Pick<\n ObjectPropertyDescriptors<Obj>,\n Names\n > = {} as any;\n\n // Get all descriptors.\n const descriptors = this.getAll(object);\n\n // If descriptors exists then set picked descriptor into the map storage.\n typeof descriptors === 'object' &&\n Object.keys(descriptors)\n .filter(key => names.includes(key as any))\n .forEach(key =>\n Object.assign(pickedDescriptors, {\n [key]: descriptors[key],\n })\n );\n return pickedDescriptors;\n }\n\n /**\n * The static getter accessor to define `accessor` and `data` descriptor.\n * @returns The returned value is an `object` with `accessor` and `data` properties.\n */\n public static get define(): {\n accessor: <Value, Obj extends object>(\n descriptor: ThisAccessorPropertyDescriptor<Value, Obj>,\n callback?: ValidationCallback\n ) => ThisAccessorPropertyDescriptor<Value, Obj> | undefined,\n data: <Value>(\n descriptor: DataPropertyDescriptor<Value>,\n callback?: ValidationCallback\n ) => DataPropertyDescriptor<Value> | undefined\n } {\n return {\n accessor: this.defineAccessor,\n data: this.defineData\n }\n }\n\n /**\n * The static getter accessor to get descriptors from property or object.\n * @returns The returned value is an `object` with `object` and `property` properties.\n */\n public static get from(): {\n object: <Obj extends object>(\n object: Obj\n ) => ObjectPropertyDescriptors<Obj> | undefined,\n property: <Obj extends object, Name extends keyof Obj>(\n object: Obj,\n name: Name\n ) => PropertyDescriptor | undefined,\n } {\n return {\n object: this.fromObject,\n property: this.fromProperty,\n }\n }\n\n //#region Property descriptor\n /**\n * @description\n * @public\n * @type {?() => Value}\n */\n public get?: () => Value;\n\n /**\n * @description\n * @public\n * @type {?(value: Value) => void}\n */\n public set?: (value: Value) => void;\n\n /**\n * @description\n * @public\n * @type {?Value}\n */\n public value?: Value;\n\n /**\n * @description\n * @public\n * @type {?boolean}\n */\n public writable?: boolean;\n //#endregion\n\n /**\n * Creates an instance of `Descriptor`.\n * @constructor\n * @param {AnyPropertyDescriptor<Value, Obj>} [param0={}] \n * @param {AnyPropertyDescriptor<Value, Obj>} param0.configurable \n * @param {AnyPropertyDescriptor<Value, Obj>} param0.enumerable \n * @param {AnyPropertyDescriptor<Value, Obj>} param0.get \n * @param {AnyPropertyDescriptor<Value, Obj>} param0.set \n * @param {AnyPropertyDescriptor<Value, Obj>} param0.value \n * @param {AnyPropertyDescriptor<Value, Obj>} param0.writable \n * @param {?Obj} [object] \n * @param {?PropertyName} [key] \n */\n constructor(\n { configurable, enumerable, get, set ,value, writable }: AnyPropertyDescriptor<Value, Obj> = {},\n object?: Obj,\n key?: PropertyName\n ) {\n super({ configurable, enumerable });\n\n // Deletes the PropertyDescriptor properties.\n delete this.get, delete this.set, delete this.value, delete this.writable;\n\n get && (this.get = get);\n set && (this.set = set);\n\n value && (this.value = value);\n writable && (this.writable = writable);\n }\n}\n","// Class.\nimport { Descriptor } from './descriptor.class';\n/**\n * @description\n * @export\n * @class Descriptors\n * @template {object} Obj \n * @template {keyof Obj} Keys \n */\nexport class Descriptors<\n Obj extends object,\n Keys extends keyof Obj\n> {\n /**\n * @description Accessor to get stored property descriptors.\n * @returns The returned value is descriptors of map type.\n */\n public get descriptors(): Map<Keys, PropertyDescriptor> {\n return this.#descriptors;\n }\n\n /**\n * @description Privately stored property descriptors.\n */\n readonly #descriptors: Map<Keys, PropertyDescriptor> = new Map();\n\n /**\n * \n */\n readonly #object: Obj;\n\n /**\n * @description Creates an instance of `Descriptors` with obj and `keys` to pick descriptors.\n * @param object An object from which descriptors are retrieved.\n * @param keys Optional property keys to retrieve from specified `object`.\n */\n constructor(object: Obj, ...keys: Keys[]) {\n this.#object = object;\n Array.isArray(keys) && keys.length > 0\n ? this.setPicked(...keys)\n : this.setAll();\n }\n\n /**\n * @description Get property descriptor from `#descriptors`.\n * @param key\n * @returns\n */\n public get(key: Keys): PropertyDescriptor | undefined {\n return this.#descriptors.get(key);\n }\n\n /**\n * @description Get all descriptors from `#descriptors`.\n * @returns The returned value is array of all stored descriptors.\n */\n public getAll(): Array<[Keys, PropertyDescriptor]> {\n return Array.from(this.#descriptors.entries());\n }\n\n /**\n * @description Check whether `#descriptors` has `key`.\n * @param key The `key` to check whether descriptors has.\n * @returns The returned value is a `boolean` indicating whether descriptors has descriptor of property `key`.\n */\n public has(key: Keys): boolean {\n return this.#descriptors.has(key);\n }\n\n /**\n * @description The method sets the `value` under `key` in `#descriptors`.\n * @param key The property key to set descriptor.\n * @param value Property descriptor to set under the `key`.\n * @returns The returned value is an instance of `Descriptors`.\n */\n public set(key: Keys, value: PropertyDescriptor): this {\n this.#descriptors.set(key, value);\n return this;\n }\n\n /**\n * @description The method sets all descriptors from `object`.\n // * @param object The object from which all descriptors are set.\n * @returns The returned value is an instance of this.\n */\n public setAll<Key extends Keys>(): this {\n // Pick all the descriptors of the given `object`.\n const objectDescriptors = Descriptor.getAll(this.#object);\n // If description exists in the object set them into the map storage.\n typeof objectDescriptors === 'object' &&\n Object.keys(objectDescriptors).forEach((key) =>\n this.#descriptors.set(key as Key, objectDescriptors[key as Key])\n );\n return this;\n }\n\n /**\n * @description The method sets descriptors from `object` of `keys`.\n * @param object An object from which descriptors are set to `#descriptors`.\n * @param keys Keys of `object` to retrieved descriptors.\n * @returns The returned value is an instance of `Descriptors`.\n */\n public setPicked<Key extends Keys>(...keys: Key[]): this {\n // Pick the descriptors of the given `keys`.\n const pickedDescriptors = Descriptor.pick(this.#object, ...keys);\n // If description exists in the object set them into the map storage.\n typeof pickedDescriptors === 'object' &&\n (Object.keys(pickedDescriptors) as Key[]).forEach(key =>\n this.#descriptors.set(key, pickedDescriptors[key])\n );\n return this;\n }\n}\n","// Class.\nimport { Descriptor } from \"./descriptor.class\";\n\nexport class PropertyDescriptorChain<\n Obj extends object,\n T = (Obj extends new () => any ? (Obj extends { prototype: infer P } ? P : never) : Obj),\n Key extends keyof T = keyof T,\n> {\n\n public get descriptor() {\n return this.#descriptor;\n }\n\n public get size() {\n return this.#descriptor.length;\n }\n\n #descriptor = new Array<PropertyDescriptor>();\n #key: Key;\n #object: Obj;\n\n /**\n * Creates an instance of `PropertyDescriptorChain`.\n * @param object \n * @param key \n */\n constructor(object: Obj, key: Key) {\n if (!object || typeof object !== 'object') {\n throw new TypeError('Invalid object provided.');\n }\n if (!key) {\n throw new TypeError('Invalid key provided.');\n }\n this.#key = key;\n this.#object = object;\n this.add();\n }\n\n public add() {\n const descriptor = Descriptor.fromProperty(this.#object, this.#key as any);\n if (descriptor) {\n this.#descriptor.push(descriptor);\n } else {\n throw new Error(`Descriptor not found for key: ${String(this.#key)}`);\n }\n }\n\n public get(id: number) {\n return this.#descriptor[id];\n }\n\n public last(): PropertyDescriptor {\n return this.#descriptor[this.#descriptor.length - 1];\n }\n}\n","/*\n * Public API Surface of descriptor\n */\nexport {\n // Abstract.\n CommonDescriptor,\n // Class.\n AccessorDescriptor,\n DataDescriptor,\n Descriptor,\n Descriptors,\n PropertyDescriptorChain,\n} from './lib';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;;AAKG;MACmB,gBAAgB,CAAA;AACpC;;;;;AAKG;IACI,OAAO,YAAY;;AAG1B;;;;;AAKG;IACI,OAAO,UAAU;;AAGxB;;;;AAIG;AACI,IAAA,YAAY;AAEnB;;;;AAIG;AACI,IAAA,UAAU;;AAGjB;;;;;;AAMG;AACH,IAAA,WAAA,CACE,EAAE,YAAY,EAAE,UAAU,KAA+D,EAAE,EAAA;QAE3F,OAAO,IAAI,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,UAAU;QAEhD,OAAO,YAAY,KAAK;AACxB,eAAG,IAAI,CAAC,YAAY,GAAG,YAAY;AACnC,cAAE,OAAO,gBAAgB,CAAC,YAAY,KAAK,SAAS,KAAK,IAAI,CAAC,YAAY,GAAG,gBAAgB,CAAC,YAAY,CAAC;QAE3G,OAAO,UAAU,KAAK;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