UNPKG

@typescript-package/wrap-property

Version:

A lightweight TypeScript package for wrapping object properties.

1 lines 21.9 kB
{"version":3,"file":"typescript-package-wrap-property.mjs","sources":["../../../package/wrap-property/src/lib/wrap-property-core.abstract.ts","../../../package/wrap-property/src/lib/wrap-property-base.abstract.ts","../../../package/wrap-property/src/lib/wrap-property.class.ts","../../../package/wrap-property/src/public-api.ts","../../../package/wrap-property/src/typescript-package-wrap-property.ts"],"sourcesContent":["// Interface.\nimport { WrappedPropertyDescriptor } from '@typedly/descriptor';\n/**\n * @description The core abstraction class for wrapping properties.\n * @export\n * @abstract\n * @class WrapPropertyCore\n * @template {Record<PropertyKey, any>} O The type of the object.\n * @template {keyof O} [K=keyof O] The key type of the property to wrap.\n * @template {boolean} [A=boolean] The type of active property.\n * @template {boolean} [F=boolean] The type of enabled property.\n * @template {boolean} [C=boolean] The type of configurable property.\n * @template {boolean} [E=boolean] The type of enumerable property.\n * @template {WrappedPropertyDescriptor<O, K, A, C, E>} [D=WrappedPropertyDescriptor<O, K, A, C, E>] The type of descriptor constrained by the `WrappedPropertyDescriptor`.\n * @template {object | undefined} [R=undefined] The type of controller that controls the wrapping behavior.\n */\nexport abstract class WrapPropertyCore<\n O extends Record<PropertyKey, any>,\n K extends keyof O = keyof O,\n A extends boolean = boolean,\n F extends boolean = boolean,\n C extends boolean = boolean,\n E extends boolean = boolean,\n D extends WrappedPropertyDescriptor<O, K, A, F, C, E> = WrappedPropertyDescriptor<O, K, A, F, C, E>,\n R extends object | undefined = undefined\n> {\n /**\n * @description Defaults for active.\n * The active property indicates whether the callbacks `onGet` and `onSet` are active.\n * @public\n * @static\n * @type {boolean}\n */\n public static active: boolean = true;\n\n /**\n * @description Defaults for configurable.\n * @public\n * @static\n * @type {boolean}\n */\n public static configurable: boolean = true;\n\n /**\n * @description Defaults for enabled state of wrapped property.\n * If `true`, the property stores the value in the private key.\n * If `false`, the property does not store the value in the private key.\n * @public\n * @static\n * @type {boolean}\n */\n public static enabled: boolean = true;\n\n /**\n * @description Defaults for enumerable.\n * @public\n * @static\n * @type {boolean}\n */\n public static enumerable: boolean = false;\n\n /**\n * @description The controller that controls the wrapping behavior.\n * @public\n * @abstract\n * @readonly\n * @type {R}\n */\n public get controller(): R {\n return undefined as R;\n }\n\n /**\n * @description The descriptor that handles actual wrapped property.\n * @protected\n * @abstract\n * @readonly\n * @type {D}\n */\n protected abstract get descriptor(): D;\n\n /**\n * @description The key of the property to wrap.\n * @protected\n * @abstract\n * @readonly\n * @type {K}\n */\n protected abstract get key(): K;\n\n /**\n * @description The previous descriptor to unwrap last wrap.\n * @protected\n * @abstract\n * @readonly\n * @type {WrappedPropertyDescriptor<O, K, A, C, E> | PropertyDescriptor | undefined}\n */\n protected abstract get previousDescriptor(): WrappedPropertyDescriptor<O, K, A, C, E> | PropertyDescriptor | undefined;\n\n /**\n * @description The private key used to store the value of the property.\n * @protected\n * @abstract\n * @readonly\n * @type {PropertyKey}\n */\n protected abstract get privateKey(): PropertyKey;\n\n /**\n * @description The object of the property.\n * @protected\n * @abstract\n * @readonly\n * @type {O}\n */\n protected abstract get object(): O;\n \n /**\n * @description Unwraps the property using previous descriptor.\n * @public\n * @abstract\n * @returns {this} \n */\n public abstract unwrap(): this;\n \n /**\n * @description Wraps the property with a private key using the specified key and descriptor.\n * @protected\n * @abstract\n * @param {O} object \n * @param {K} key \n * @returns {this} \n */\n protected abstract wrap(object: O, key: K): this;\n}\n","// Abstract.\nimport { WrapPropertyCore } from './wrap-property-core.abstract';\n// Interface.\nimport { PropertyControllerShape } from '@typedly/controller';\nimport { WrappedPropertyDescriptor } from '@typedly/descriptor';\n/**\n * @description The foundational class for wrapping properties.\n * @export\n * @abstract\n * @class WrapPropertyBase\n * @template {Record<PropertyKey, any>} O The type of the object.\n * @template {keyof O} [K=keyof O] The key type of the property to wrap.\n * @template {boolean} [A=boolean] The type of active property.\n * @template {boolean} [F=boolean] The type of enabled property.\n * @template {boolean} [C=boolean] The type of configurable property.\n * @template {boolean} [E=boolean] The type of enumerable property.\n * @template {WrappedPropertyDescriptor<O, K, C, E>} [D=WrappedPropertyDescriptor<O, K, C, E>] The type of descriptor constrained by the `WrappedPropertyDescriptor`.\n * @template {PropertyControllerShape<O, K, A, C, E, D>} [R=PropertyControllerShape<O, K, A, C, E, D>] The type of controller that controls the wrapping behavior.\n * @extends {WrapPropertyCore<T, O, K, C, E, D, R>}\n */\nexport abstract class WrapPropertyBase<\n O extends Record<PropertyKey, any>,\n K extends keyof O = keyof O,\n A extends boolean = boolean,\n F extends boolean = boolean,\n C extends boolean = boolean,\n E extends boolean = boolean,\n D extends WrappedPropertyDescriptor<O, K, A, F, C, E> = WrappedPropertyDescriptor<O, K, A, F, C, E>,\n R extends PropertyControllerShape<O, K, A, F, C, E, D> = PropertyControllerShape<O, K, A, F, C, E, D>\n> extends WrapPropertyCore<O, K, A, F, C, E, D, R> {\n /**\n * @inheritdoc\n * @public\n * @readonly\n * @type {R}\n */\n public override get controller() {\n return this.#controller as R;\n }\n\n /**\n * @description The descriptor that handles actual wrapped property.\n * @public\n * @readonly\n * @type {D}\n */\n public get descriptor(): D {\n return this.controller\n ? this.controller.descriptor\n : this.#descriptor as D;\n }\n\n /**\n * @description The key of the property to wrap.\n * @protected\n * @readonly\n * @type {K}\n */\n protected get key(): K {\n return this.#key;\n }\n\n /**\n * @description The previous descriptor of the wrapped property.\n * @protected\n * @readonly\n * @type {*}\n */\n protected get previousDescriptor(): WrappedPropertyDescriptor<O, K, A, C, E> | PropertyDescriptor | undefined {\n return this.controller\n ? this.controller.descriptor.previousDescriptor\n : this.descriptor.previousDescriptor;\n }\n\n /**\n * @description The private key used to store the value of the property.\n * @protected\n * @readonly\n * @type {PropertyKey}\n */\n protected get privateKey(): PropertyKey {\n return (this.controller\n ? this.controller.descriptor.privateKey\n : this.descriptor.privateKey) as PropertyKey;\n }\n\n /**\n * @description The target object of the property.\n * @protected\n * @readonly\n * @type {T}\n */\n protected get object(): O {\n return this.#object;\n }\n\n /**\n * @description Privately stored controller that controls the wrapping behavior.\n * @type {?R}\n */\n #controller?: R;\n\n /**\n * @description\n * @type {D}\n */\n #descriptor?: D;\n\n /**\n * @description Privately stored key of property.\n * @type {K}\n */\n #key: K;\n\n /**\n * @description The target in which the property is wrapped.\n * @type {O}\n */\n #object: O;\n\n /**\n * Creates an instance of `WrapPropertyBase` child class.\n * @constructor\n * @param {O} object The target object or class to wrap the property of the given `key`.\n * @param {K} key The key to wrap the property.\n * @param {?D} [descriptor] The descriptor of the property to wrap.\n * @param {?new (descriptor?: D) => R} [controller] The controller that controls the wrapping behavior.\n */\n constructor(\n object: O,\n key: K,\n descriptor?: D,\n controller?: new (descriptor?: D) => R\n ) {\n super();\n\n // If the descriptor is not provided, create a default one.\n descriptor = {\n ...{\n active: WrapPropertyCore.active,\n configurable: WrapPropertyCore.configurable,\n enumerable: WrapPropertyCore.enumerable,\n previousDescriptor: Object.getOwnPropertyDescriptor(object, key) as PropertyDescriptor,\n privateKey: `_${String(key)}`\n },\n ...descriptor,\n } as D;\n\n // If the controller is provided, create an instance of it.\n controller\n ? this.#controller = new controller(descriptor)\n : this.#descriptor = descriptor;\n\n // The key to wrap.\n this.#key = key;\n \n // The target object to wrap the property on.\n this.#object = object;\n\n // Define the private property to store the value.\n this.#hasPrivateProperty(object) === false && this.#definePrivateProperty(object, key);\n }\n\n /**\n * @description Unwraps the property using previous descriptor.\n * @public\n * @returns {this} \n */\n public unwrap(): this {\n const previousDescriptor = ((this.#controller ? this.#controller.descriptor : this.#descriptor) as D).previousDescriptor;\n previousDescriptor &&\n (\n Object.defineProperty(this.object, this.key, previousDescriptor),\n this.privateKey && delete this.object[this.privateKey]\n );\n return this;\n }\n\n /**\n * @description Wraps the property with a private indicator.\n * @protected\n * @param {O} object The object to wrap the property on.\n * @param {K} key The key of the property to wrap.\n * @returns {this}\n */\n protected wrap(\n object: O,\n key: K\n ): this {\n // Wrap acts as controller.\n const controller = this.#controller ? this.#controller : this;\n\n // The getter for the property.\n const get = controller.descriptor.get\n ? controller.descriptor.get\n : function(this: O): O[K] {\n if (controller.descriptor.enabled === false) {\n return undefined as O[K];\n }\n\n // Set the this as the target object.\n const o = (this as O);\n\n // Get the previous value from descriptor.\n const previousValue = controller.descriptor.previousDescriptor\n ? controller.descriptor.previousDescriptor.get && typeof controller.descriptor.previousDescriptor.get === 'function'\n ? controller.descriptor.previousDescriptor.get.call(this)\n : (controller.descriptor.previousDescriptor as PropertyDescriptor).value\n : undefined;\n\n\n // Current descriptor.\n return controller.descriptor.onGet\n && ((typeof controller.descriptor.active === 'boolean' && controller.descriptor.active)\n || (typeof controller.descriptor.active === 'object' && controller.descriptor.active.onGet === true))\n ? controller.descriptor.onGet.call(o, key, previousValue, o[controller.descriptor.privateKey as K] as O[K], o) as O[K]\n : o[controller.descriptor.privateKey as K] as O[K];\n };\n\n // The setter for the property.\n const set = controller.descriptor.set\n ? controller.descriptor.set\n : function(this: O, value: O[K]): void {\n if (controller.descriptor.enabled === false) {\n return undefined as O[K];\n }\n\n // Set the this as the target object.\n const o = (this as O);\n\n // Get the previous value from previous descriptor or current value.\n const previousValue = (o[controller.descriptor.privateKey as K] as O[K] || (controller.descriptor.previousDescriptor as PropertyDescriptor)?.value) as O[K];\n\n // Perform previous descriptor.\n controller.descriptor.previousDescriptor?.set && controller.descriptor.previousDescriptor.set.call(o, value);\n\n // Set the private property value.\n Object.assign(\n o,\n {\n [controller.descriptor.privateKey as K]: controller.descriptor.onSet\n && (\n (typeof controller.descriptor.active === 'boolean' && controller.descriptor.active)\n || (typeof controller.descriptor.active === 'object' && controller.descriptor.active.onSet === true)\n )\n ? controller.descriptor.onSet.call(o, value, previousValue, key, o) as O[K]\n : value\n }\n );\n };\n\n // Define property with the given key and options.\n Object.defineProperty(\n object,\n key, {\n configurable: controller.descriptor.configurable, // Whether the property can be deleted or changed.\n enumerable: controller.descriptor.enumerable, // Whether the property is visible in enumerations.\n get, // Getter for the property.\n set, // Setter for the property.\n }\n );\n return this;\n }\n\n /**\n * @description Checks if the object has a private property.\n * @param {O} object The object to check for the private property.\n * @returns {boolean} \n */\n #hasPrivateProperty(object: O): boolean {\n return Object.hasOwn(object, this.privateKey);\n }\n\n /**\n * @description Defines the private property in the object.\n * @param {O} object The object to define the private property on.\n * @param {K} key The key of the property to define.\n */\n #definePrivateProperty(object: O, key: K) {\n Object.defineProperty(\n object,\n this.privateKey, {\n configurable: true,\n enumerable: false,\n value: object[key] || new (object as unknown as any).constructor()[key],\n writable: true\n }\n );\n }\n}\n","// Abstract.\nimport { WrapPropertyBase } from './wrap-property-base.abstract';\n// Interface.\nimport { PropertyControllerShape } from '@typedly/controller';\nimport { WrappedPropertyDescriptor } from '@typedly/descriptor';\n/**\n * @description The concrete class for wrapping object properties.\n * @export\n * @class WrapProperty\n * @template {object | (new () => any)} T The type of the target object or class to wrap the property of the given `key`.\n * @template {Record<PropertyKey, any>} [O=(T extends new () => T ? ( T extends { prototype: infer P } ? P : never) : T)] The object type of captured `T`.\n * @template {keyof O extends string | symbol ? keyof O : never} [K=keyof O extends string | symbol ? keyof O : never] The key type of the property to wrap.\n * @template {boolean} [A=boolean] The type of active property.\n * @template {boolean} [C=boolean] The type of configurable property.\n * @template {boolean} [E=boolean] The type of enumerable property.\n * @template {WrappedPropertyDescriptor<O, K, C, E>} [D=WrappedPropertyDescriptor<O, K, C, E>] The type of descriptor constrained by the `WrappedPropertyDescriptor`.\n * @template {PropertyControllerShape<O, K, A, C, E, D>} [Controller=PropertyControllerShape<O, K, A, C, E, D>] The type of controller that controls the wrapping behavior.\n * @extends {WrapPropertyBase<T, O, K, C, E, D>}\n */\nexport class WrapProperty<\n // Used to determine the type of the target object for picking the key from prototype.\n O extends Record<PropertyKey, any>,\n K extends keyof O extends string | symbol ? keyof O : never = keyof O extends string | symbol ? keyof O : never,\n A extends boolean = boolean,\n F extends boolean = boolean,\n C extends boolean = boolean,\n E extends boolean = boolean,\n D extends WrappedPropertyDescriptor<O, K, A, F, C, E> = WrappedPropertyDescriptor<O, K, A, F, C, E>,\n Controller extends PropertyControllerShape<O, K, A , F, C, E, D> = PropertyControllerShape<O, K, A, F, C, E, D>\n> extends WrapPropertyBase<O, K, A, F, C, E, D> {\n /**\n * Creates an instance of `WrapProperty`.\n * @constructor\n * @param {O} object The target object or class to wrap the property of the given `key`.\n * @param {K} key The key of the property to wrap.\n * @param {?D} [descriptor] The descriptor of the property to wrap.\n * @param {?new (descriptor?: D) => Controller} [controller] The controller that controls the wrapping behavior.\n */\n constructor(\n object: O,\n key: K,\n descriptor?: D,\n controller?: new (descriptor?: D) => Controller\n ) {\n super(\n object,\n key,\n descriptor,\n controller\n );\n\n // Define the property with the given key and options.\n this.wrap(\n object,\n key\n );\n }\n}\n","/*\n * Public API Surface of wrap-property\n */\n\nexport * from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;AAaG;MACmB,gBAAgB,CAAA;AAUpC;;;;;;AAMG;AACI,IAAA,OAAO,MAAM,GAAY,IAAI;AAEpC;;;;;AAKG;AACI,IAAA,OAAO,YAAY,GAAY,IAAI;AAE1C;;;;;;;AAOG;AACI,IAAA,OAAO,OAAO,GAAY,IAAI;AAErC;;;;;AAKG;AACI,IAAA,OAAO,UAAU,GAAY,KAAK;AAEzC;;;;;;AAMG;AACH,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,SAAc;;;;ACrEzB;AAKA;;;;;;;;;;;;;;AAcG;AACG,MAAgB,gBASpB,SAAQ,gBAAwC,CAAA;AAChD;;;;;AAKG;AACH,IAAA,IAAoB,UAAU,GAAA;QAC5B,OAAO,IAAI,CAAC,WAAgB;;AAG9B;;;;;AAKG;AACH,IAAA,IAAW,UAAU,GAAA;QACnB,OAAO,IAAI,CAAC;AACV,cAAE,IAAI,CAAC,UAAU,CAAC;AAClB,cAAE,IAAI,CAAC,WAAgB;;AAG3B;;;;;AAKG;AACH,IAAA,IAAc,GAAG,GAAA;QACf,OAAO,IAAI,C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