@bemoje/object 0.2.19 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -20
- package/index.d.ts +891 -0
- package/index.mjs +970 -0
- package/package.json +23 -18
- package/LICENSE +0 -21
- package/cjs/index.d.ts +0 -47
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js +0 -50
- package/cjs/index.js.map +0 -1
- package/cjs/lib/arrAssign.d.ts +0 -2
- package/cjs/lib/arrAssign.d.ts.map +0 -1
- package/cjs/lib/arrAssign.js +0 -6
- package/cjs/lib/arrAssign.js.map +0 -1
- package/cjs/lib/constructorOf.d.ts +0 -6
- package/cjs/lib/constructorOf.d.ts.map +0 -1
- package/cjs/lib/constructorOf.js +0 -11
- package/cjs/lib/constructorOf.js.map +0 -1
- package/cjs/lib/createArrayMerger.d.ts +0 -5
- package/cjs/lib/createArrayMerger.d.ts.map +0 -1
- package/cjs/lib/createArrayMerger.js +0 -20
- package/cjs/lib/createArrayMerger.js.map +0 -1
- package/cjs/lib/createObjectMerger.d.ts +0 -6
- package/cjs/lib/createObjectMerger.d.ts.map +0 -1
- package/cjs/lib/createObjectMerger.js +0 -20
- package/cjs/lib/createObjectMerger.js.map +0 -1
- package/cjs/lib/define.d.ts +0 -16
- package/cjs/lib/define.d.ts.map +0 -1
- package/cjs/lib/define.js +0 -162
- package/cjs/lib/define.js.map +0 -1
- package/cjs/lib/getConfigurableMethodOrGetterKeys.d.ts +0 -9
- package/cjs/lib/getConfigurableMethodOrGetterKeys.d.ts.map +0 -1
- package/cjs/lib/getConfigurableMethodOrGetterKeys.js +0 -28
- package/cjs/lib/getConfigurableMethodOrGetterKeys.js.map +0 -1
- package/cjs/lib/hasOwnProp.d.ts +0 -6
- package/cjs/lib/hasOwnProp.d.ts.map +0 -1
- package/cjs/lib/hasOwnProp.js +0 -11
- package/cjs/lib/hasOwnProp.js.map +0 -1
- package/cjs/lib/inheritStaticMembers.d.ts +0 -26
- package/cjs/lib/inheritStaticMembers.d.ts.map +0 -1
- package/cjs/lib/inheritStaticMembers.js +0 -40
- package/cjs/lib/inheritStaticMembers.js.map +0 -1
- package/cjs/lib/isPropEnum.d.ts +0 -6
- package/cjs/lib/isPropEnum.d.ts.map +0 -1
- package/cjs/lib/isPropEnum.js +0 -11
- package/cjs/lib/isPropEnum.js.map +0 -1
- package/cjs/lib/iterableFirstElement.d.ts +0 -12
- package/cjs/lib/iterableFirstElement.d.ts.map +0 -1
- package/cjs/lib/iterableFirstElement.js +0 -18
- package/cjs/lib/iterableFirstElement.js.map +0 -1
- package/cjs/lib/iteratePrototypeChainOf.d.ts +0 -7
- package/cjs/lib/iteratePrototypeChainOf.d.ts.map +0 -1
- package/cjs/lib/iteratePrototypeChainOf.js +0 -19
- package/cjs/lib/iteratePrototypeChainOf.js.map +0 -1
- package/cjs/lib/oDeleteUndefined.d.ts +0 -9
- package/cjs/lib/oDeleteUndefined.d.ts.map +0 -1
- package/cjs/lib/oDeleteUndefined.js +0 -15
- package/cjs/lib/oDeleteUndefined.js.map +0 -1
- package/cjs/lib/objAssign.d.ts +0 -2
- package/cjs/lib/objAssign.d.ts.map +0 -1
- package/cjs/lib/objAssign.js +0 -6
- package/cjs/lib/objAssign.js.map +0 -1
- package/cjs/lib/objDeepFreeze.d.ts +0 -31
- package/cjs/lib/objDeepFreeze.d.ts.map +0 -1
- package/cjs/lib/objDeepFreeze.js +0 -42
- package/cjs/lib/objDeepFreeze.js.map +0 -1
- package/cjs/lib/objDefineLazyProperty.d.ts +0 -12
- package/cjs/lib/objDefineLazyProperty.d.ts.map +0 -1
- package/cjs/lib/objDefineLazyProperty.js +0 -37
- package/cjs/lib/objDefineLazyProperty.js.map +0 -1
- package/cjs/lib/objDelete.d.ts +0 -15
- package/cjs/lib/objDelete.d.ts.map +0 -1
- package/cjs/lib/objDelete.js +0 -21
- package/cjs/lib/objDelete.js.map +0 -1
- package/cjs/lib/objFilter.d.ts +0 -14
- package/cjs/lib/objFilter.d.ts.map +0 -1
- package/cjs/lib/objFilter.js +0 -25
- package/cjs/lib/objFilter.js.map +0 -1
- package/cjs/lib/objFilterMutable.d.ts +0 -14
- package/cjs/lib/objFilterMutable.d.ts.map +0 -1
- package/cjs/lib/objFilterMutable.js +0 -24
- package/cjs/lib/objFilterMutable.js.map +0 -1
- package/cjs/lib/objForEach.d.ts +0 -17
- package/cjs/lib/objForEach.d.ts.map +0 -1
- package/cjs/lib/objForEach.js +0 -26
- package/cjs/lib/objForEach.js.map +0 -1
- package/cjs/lib/objGet.d.ts +0 -5
- package/cjs/lib/objGet.d.ts.map +0 -1
- package/cjs/lib/objGet.js +0 -11
- package/cjs/lib/objGet.js.map +0 -1
- package/cjs/lib/objGetOrDefault.d.ts +0 -8
- package/cjs/lib/objGetOrDefault.d.ts.map +0 -1
- package/cjs/lib/objGetOrDefault.js +0 -13
- package/cjs/lib/objGetOrDefault.js.map +0 -1
- package/cjs/lib/objGetOrDefaultValue.d.ts +0 -6
- package/cjs/lib/objGetOrDefaultValue.d.ts.map +0 -1
- package/cjs/lib/objGetOrDefaultValue.js +0 -12
- package/cjs/lib/objGetOrDefaultValue.js.map +0 -1
- package/cjs/lib/objHas.d.ts +0 -17
- package/cjs/lib/objHas.d.ts.map +0 -1
- package/cjs/lib/objHas.js +0 -22
- package/cjs/lib/objHas.js.map +0 -1
- package/cjs/lib/objIsEmpty.d.ts +0 -18
- package/cjs/lib/objIsEmpty.d.ts.map +0 -1
- package/cjs/lib/objIsEmpty.js +0 -28
- package/cjs/lib/objIsEmpty.js.map +0 -1
- package/cjs/lib/objMap.d.ts +0 -17
- package/cjs/lib/objMap.d.ts.map +0 -1
- package/cjs/lib/objMap.js +0 -26
- package/cjs/lib/objMap.js.map +0 -1
- package/cjs/lib/objMapKeys.d.ts +0 -17
- package/cjs/lib/objMapKeys.d.ts.map +0 -1
- package/cjs/lib/objMapKeys.js +0 -27
- package/cjs/lib/objMapKeys.js.map +0 -1
- package/cjs/lib/objMapMutable.d.ts +0 -17
- package/cjs/lib/objMapMutable.d.ts.map +0 -1
- package/cjs/lib/objMapMutable.js +0 -26
- package/cjs/lib/objMapMutable.js.map +0 -1
- package/cjs/lib/objOmitKeysMutable.d.ts +0 -16
- package/cjs/lib/objOmitKeysMutable.d.ts.map +0 -1
- package/cjs/lib/objOmitKeysMutable.js +0 -25
- package/cjs/lib/objOmitKeysMutable.js.map +0 -1
- package/cjs/lib/objPropertyValueToGetter.d.ts +0 -23
- package/cjs/lib/objPropertyValueToGetter.d.ts.map +0 -1
- package/cjs/lib/objPropertyValueToGetter.js +0 -35
- package/cjs/lib/objPropertyValueToGetter.js.map +0 -1
- package/cjs/lib/objReduce.d.ts +0 -9
- package/cjs/lib/objReduce.d.ts.map +0 -1
- package/cjs/lib/objReduce.js +0 -18
- package/cjs/lib/objReduce.js.map +0 -1
- package/cjs/lib/objSet.d.ts +0 -5
- package/cjs/lib/objSet.d.ts.map +0 -1
- package/cjs/lib/objSet.js +0 -11
- package/cjs/lib/objSet.js.map +0 -1
- package/cjs/lib/objSize.d.ts +0 -5
- package/cjs/lib/objSize.d.ts.map +0 -1
- package/cjs/lib/objSize.js +0 -11
- package/cjs/lib/objSize.js.map +0 -1
- package/cjs/lib/objSortKeys.d.ts +0 -15
- package/cjs/lib/objSortKeys.d.ts.map +0 -1
- package/cjs/lib/objSortKeys.js +0 -25
- package/cjs/lib/objSortKeys.js.map +0 -1
- package/cjs/lib/objToMap.d.ts +0 -6
- package/cjs/lib/objToMap.d.ts.map +0 -1
- package/cjs/lib/objToMap.js +0 -11
- package/cjs/lib/objToMap.js.map +0 -1
- package/cjs/lib/objUpdate.d.ts +0 -18
- package/cjs/lib/objUpdate.d.ts.map +0 -1
- package/cjs/lib/objUpdate.js +0 -23
- package/cjs/lib/objUpdate.js.map +0 -1
- package/cjs/lib/objUpdatePropertyDescriptors.d.ts +0 -17
- package/cjs/lib/objUpdatePropertyDescriptors.d.ts.map +0 -1
- package/cjs/lib/objUpdatePropertyDescriptors.js +0 -28
- package/cjs/lib/objUpdatePropertyDescriptors.js.map +0 -1
- package/cjs/lib/objWalk.d.ts +0 -13
- package/cjs/lib/objWalk.d.ts.map +0 -1
- package/cjs/lib/objWalk.js +0 -37
- package/cjs/lib/objWalk.js.map +0 -1
- package/cjs/lib/ownKeys.d.ts +0 -18
- package/cjs/lib/ownKeys.d.ts.map +0 -1
- package/cjs/lib/ownKeys.js +0 -58
- package/cjs/lib/ownKeys.js.map +0 -1
- package/cjs/lib/prototypeChainOf.d.ts +0 -7
- package/cjs/lib/prototypeChainOf.d.ts.map +0 -1
- package/cjs/lib/prototypeChainOf.js +0 -12
- package/cjs/lib/prototypeChainOf.js.map +0 -1
- package/cjs/lib/realizeLazyProperty.d.ts +0 -2
- package/cjs/lib/realizeLazyProperty.d.ts.map +0 -1
- package/cjs/lib/realizeLazyProperty.js +0 -14
- package/cjs/lib/realizeLazyProperty.js.map +0 -1
- package/cjs/lib/setEnumerable.d.ts +0 -19
- package/cjs/lib/setEnumerable.d.ts.map +0 -1
- package/cjs/lib/setEnumerable.js +0 -28
- package/cjs/lib/setEnumerable.js.map +0 -1
- package/cjs/lib/setNonConfigurable.d.ts +0 -21
- package/cjs/lib/setNonConfigurable.d.ts.map +0 -1
- package/cjs/lib/setNonConfigurable.js +0 -30
- package/cjs/lib/setNonConfigurable.js.map +0 -1
- package/cjs/lib/setNonEnumerable.d.ts +0 -16
- package/cjs/lib/setNonEnumerable.d.ts.map +0 -1
- package/cjs/lib/setNonEnumerable.js +0 -25
- package/cjs/lib/setNonEnumerable.js.map +0 -1
- package/cjs/lib/setNonWritable.d.ts +0 -22
- package/cjs/lib/setNonWritable.d.ts.map +0 -1
- package/cjs/lib/setNonWritable.js +0 -31
- package/cjs/lib/setNonWritable.js.map +0 -1
- package/cjs/lib/setWritable.d.ts +0 -17
- package/cjs/lib/setWritable.d.ts.map +0 -1
- package/cjs/lib/setWritable.js +0 -26
- package/cjs/lib/setWritable.js.map +0 -1
- package/cjs/lib/superChain.d.ts +0 -5
- package/cjs/lib/superChain.d.ts.map +0 -1
- package/cjs/lib/superChain.js +0 -15
- package/cjs/lib/superChain.js.map +0 -1
package/cjs/lib/objUpdate.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objUpdate.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objUpdate.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH;;GAEG;AACH,SAAgB,SAAS,CACvB,GAAM,EACN,GAAY,EACZ,QAAsE;IAEtE,OAAO,CAAC,GAAG,CAAC,GAAc,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,CAAC;AAND,8BAMC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Updates the property descriptors of the specified properties on the given object.
|
|
4
|
-
* @param object - The object whose property descriptors are to be updated.
|
|
5
|
-
* @param properties - An array of property names for which the descriptors are to be updated.
|
|
6
|
-
* @param update - A function that takes a property descriptor and a property name, and returns a new property descriptor.
|
|
7
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
8
|
-
* @example ```ts
|
|
9
|
-
* const obj = { a: 1, b: 2 };
|
|
10
|
-
* objUpdatePropertyDescriptors(obj, ['a', 'b'], (descriptor, property) => {
|
|
11
|
-
* descriptor.writable = true;
|
|
12
|
-
* return obj;
|
|
13
|
-
* });
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function objUpdatePropertyDescriptors<V>(object: Record<ObjectKey, V>, properties: ObjectKey[], update: (descriptor: PropertyDescriptor, property: ObjectKey) => PropertyDescriptor): void;
|
|
17
|
-
//# sourceMappingURL=objUpdatePropertyDescriptors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objUpdatePropertyDescriptors.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objUpdatePropertyDescriptors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAC5C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,EAC5B,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE,CAAC,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,KAAK,kBAAkB,GAClF,IAAI,CAQN"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objUpdatePropertyDescriptors = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Updates the property descriptors of the specified properties on the given object.
|
|
6
|
-
* @param object - The object whose property descriptors are to be updated.
|
|
7
|
-
* @param properties - An array of property names for which the descriptors are to be updated.
|
|
8
|
-
* @param update - A function that takes a property descriptor and a property name, and returns a new property descriptor.
|
|
9
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
10
|
-
* @example ```ts
|
|
11
|
-
* const obj = { a: 1, b: 2 };
|
|
12
|
-
* objUpdatePropertyDescriptors(obj, ['a', 'b'], (descriptor, property) => {
|
|
13
|
-
* descriptor.writable = true;
|
|
14
|
-
* return obj;
|
|
15
|
-
* });
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
function objUpdatePropertyDescriptors(object, properties, update) {
|
|
19
|
-
for (const p of properties) {
|
|
20
|
-
if (!Reflect.has(object, p)) {
|
|
21
|
-
throw new Error(`Property, '${String(p)}' does not exist on object.`);
|
|
22
|
-
}
|
|
23
|
-
const descriptor = update(Object.getOwnPropertyDescriptor(object, p), p);
|
|
24
|
-
Object.defineProperty(object, p, descriptor);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.objUpdatePropertyDescriptors = objUpdatePropertyDescriptors;
|
|
28
|
-
//# sourceMappingURL=objUpdatePropertyDescriptors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objUpdatePropertyDescriptors.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objUpdatePropertyDescriptors.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;GAaG;AACH,SAAgB,4BAA4B,CAC1C,MAA4B,EAC5B,UAAuB,EACvB,MAAmF;IAEnF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE;QAC1B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,cAAc,MAAM,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAA;SACtE;QACD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,CAAuB,EAAE,CAAC,CAAC,CAAA;QAC9F,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,CAAA;KAC7C;AACH,CAAC;AAZD,oEAYC"}
|
package/cjs/lib/objWalk.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Any } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Recursively traverses an object and invokes a callback function for every encountered non-object value.
|
|
4
|
-
* The callback function is passed the non-object value and an array representing the path to the value.
|
|
5
|
-
* @param node - The object to be traversed.
|
|
6
|
-
* ```
|
|
7
|
-
*/
|
|
8
|
-
export declare function objWalk(node: Record<string, Any>, callback: (type: 'primitive' | 'object' | 'array', value: Any, node: Any, path: string[]) => false | void, options?: {
|
|
9
|
-
noPrimitives?: boolean;
|
|
10
|
-
noArrays?: boolean;
|
|
11
|
-
noObjects?: boolean;
|
|
12
|
-
}): void;
|
|
13
|
-
//# sourceMappingURL=objWalk.d.ts.map
|
package/cjs/lib/objWalk.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objWalk.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objWalk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAEnC;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,KAAK,GAAG,IAAI,EACzG,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GAChF,IAAI,CAoBN"}
|
package/cjs/lib/objWalk.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objWalk = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Recursively traverses an object and invokes a callback function for every encountered non-object value.
|
|
6
|
-
* The callback function is passed the non-object value and an array representing the path to the value.
|
|
7
|
-
* @param node - The object to be traversed.
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
function objWalk(node, callback, options = {}) {
|
|
11
|
-
const { noPrimitives, noArrays, noObjects } = options;
|
|
12
|
-
function recurse(node, path = []) {
|
|
13
|
-
for (const [key, child] of Object.entries(node)) {
|
|
14
|
-
if (typeof child === 'object' && child != null) {
|
|
15
|
-
if (Array.isArray(child)) {
|
|
16
|
-
if (!noArrays && callback('array', child, node, path.concat(key)) === false)
|
|
17
|
-
continue;
|
|
18
|
-
child.forEach((node, index) => {
|
|
19
|
-
recurse(node, path.concat([`${key}[${index}]`]));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
if (!noObjects && callback('object', child, node, path.concat(key)) === false)
|
|
24
|
-
continue;
|
|
25
|
-
recurse(child, path.concat(key));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
if (!noPrimitives && callback('array', child, node, path.concat(key)) === false)
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
recurse(node);
|
|
35
|
-
}
|
|
36
|
-
exports.objWalk = objWalk;
|
|
37
|
-
//# sourceMappingURL=objWalk.js.map
|
package/cjs/lib/objWalk.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objWalk.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objWalk.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,OAAO,CACrB,IAAyB,EACzB,QAAyG,EACzG,UAA+E,EAAE;IAEjF,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;IACrD,SAAS,OAAO,CAAC,IAAyB,EAAE,OAAiB,EAAE;QAC7D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;gBAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACxB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;wBAAE,SAAQ;oBACrF,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;wBAC5B,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;oBAClD,CAAC,CAAC,CAAA;iBACH;qBAAM;oBACL,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;wBAAE,SAAQ;oBACvF,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;iBACjC;aACF;iBAAM;gBACL,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;oBAAE,SAAQ;aAC1F;SACF;IACH,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAxBD,0BAwBC"}
|
package/cjs/lib/ownKeys.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns ALL own property keys of an object.
|
|
3
|
-
* Ie. own enumerable, non-enumerable and symbol keys,
|
|
4
|
-
* but not keys inherited from the object's prototype are returned.
|
|
5
|
-
* Identical to Reflect.ownKeys.
|
|
6
|
-
*/
|
|
7
|
-
export declare function ownKeys(o: object): (string | symbol)[];
|
|
8
|
-
export declare namespace ownKeys {
|
|
9
|
-
var _a: (o: object) => string[];
|
|
10
|
-
export var nonEnum: (o: object) => string[];
|
|
11
|
-
export var symbol: (o: object) => symbol[];
|
|
12
|
-
export var enumAndNonEnum: (o: object) => string[];
|
|
13
|
-
export var enumAndSymbol: (o: object) => (string | symbol)[];
|
|
14
|
-
export var nonEnumAndSymbol: (o: object) => (string | symbol)[];
|
|
15
|
-
export var enumAndNonEnumAndSymbol: typeof ownKeys;
|
|
16
|
-
export { _a as enum };
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ownKeys.d.ts.map
|
package/cjs/lib/ownKeys.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ownKeys.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/ownKeys.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,uBAEhC;yBAFe,OAAO"}
|
package/cjs/lib/ownKeys.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ownKeys = void 0;
|
|
4
|
-
const isPropEnum_1 = require("./isPropEnum");
|
|
5
|
-
/**
|
|
6
|
-
* Returns ALL own property keys of an object.
|
|
7
|
-
* Ie. own enumerable, non-enumerable and symbol keys,
|
|
8
|
-
* but not keys inherited from the object's prototype are returned.
|
|
9
|
-
* Identical to Reflect.ownKeys.
|
|
10
|
-
*/
|
|
11
|
-
function ownKeys(o) {
|
|
12
|
-
return Reflect.ownKeys(o);
|
|
13
|
-
}
|
|
14
|
-
exports.ownKeys = ownKeys;
|
|
15
|
-
/**
|
|
16
|
-
* Returns all own enumerable property keys of an object.
|
|
17
|
-
* Identical to Object.keys.
|
|
18
|
-
*/
|
|
19
|
-
ownKeys.enum = function (o) {
|
|
20
|
-
return Object.keys(o);
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Returns all own non-enumerable property keys of an object.
|
|
24
|
-
*/
|
|
25
|
-
ownKeys.nonEnum = function (o) {
|
|
26
|
-
return Object.getOwnPropertyNames(o).filter((k) => !(0, isPropEnum_1.isPropEnum)(o, k));
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Returns all own symbol property keys of an object.
|
|
30
|
-
* Identical to Object.getOwnPropertySymbols.
|
|
31
|
-
*/
|
|
32
|
-
ownKeys.symbol = function (o) {
|
|
33
|
-
return Object.getOwnPropertySymbols(o);
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Returns all own symbol property keys of an object.
|
|
37
|
-
* Identical to Object.getOwnPropertySymbols.
|
|
38
|
-
*/
|
|
39
|
-
ownKeys.enumAndNonEnum = function (o) {
|
|
40
|
-
return Object.getOwnPropertyNames(o);
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Returns all own enumerable and symbol property keys of an object.
|
|
44
|
-
*/
|
|
45
|
-
ownKeys.enumAndSymbol = function (o) {
|
|
46
|
-
return [...Object.keys(o), ...Object.getOwnPropertySymbols(o)];
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Returns all own non-enumerable and symbol property keys of an object.
|
|
50
|
-
*/
|
|
51
|
-
ownKeys.nonEnumAndSymbol = function (o) {
|
|
52
|
-
return Reflect.ownKeys(o).filter((k) => !(0, isPropEnum_1.isPropEnum)(o, k));
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Alias for @see ownKeys()
|
|
56
|
-
*/
|
|
57
|
-
ownKeys.enumAndNonEnumAndSymbol = ownKeys;
|
|
58
|
-
//# sourceMappingURL=ownKeys.js.map
|
package/cjs/lib/ownKeys.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ownKeys.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/ownKeys.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,CAAS;IAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,OAAO,CAAC,IAAI,GAAG,UAAU,CAAS;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACvB,CAAC,CAAA;AAED;;GAEG;AACH,OAAO,CAAC,OAAO,GAAG,UAAU,CAAS;IACnC,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,uBAAU,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACvE,CAAC,CAAA;AAED;;;GAGG;AACH,OAAO,CAAC,MAAM,GAAG,UAAU,CAAS;IAClC,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC,CAAA;AAED;;;GAGG;AACH,OAAO,CAAC,cAAc,GAAG,UAAU,CAAS;IAC1C,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC,CAAA;AAED;;GAEG;AACH,OAAO,CAAC,aAAa,GAAG,UAAU,CAAS;IACzC,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAA;AAChE,CAAC,CAAA;AAED;;GAEG;AACH,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAS;IAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,uBAAU,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5D,CAAC,CAAA;AAED;;GAEG;AACH,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prototypeChainOf.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/prototypeChainOf.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,MAAM,EAAE,CAAC,EACT,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/B,CAAC,OAAO,MAAM,CAAC,SAAS,CAAC,EAAE,CAE7B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prototypeChainOf = void 0;
|
|
4
|
-
const iteratePrototypeChainOf_1 = require("./iteratePrototypeChainOf");
|
|
5
|
-
/**
|
|
6
|
-
* Get the prototype chain of a given object.
|
|
7
|
-
*/
|
|
8
|
-
function prototypeChainOf(object, opts) {
|
|
9
|
-
return [...(0, iteratePrototypeChainOf_1.iteratePrototypeChainOfOf)(object, opts)];
|
|
10
|
-
}
|
|
11
|
-
exports.prototypeChainOf = prototypeChainOf;
|
|
12
|
-
//# sourceMappingURL=prototypeChainOf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prototypeChainOf.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/prototypeChainOf.ts"],"names":[],"mappings":";;;AAAA,uEAAqE;AAErE;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,MAAS,EACT,IAAgC;IAEhC,OAAO,CAAC,GAAG,IAAA,mDAAyB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AACrD,CAAC;AALD,4CAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realizeLazyProperty.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/realizeLazyProperty.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAQzE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.realizeLazyProperty = void 0;
|
|
4
|
-
function realizeLazyProperty(obj, key, value) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
writable: false,
|
|
8
|
-
configurable: false,
|
|
9
|
-
value,
|
|
10
|
-
});
|
|
11
|
-
return value;
|
|
12
|
-
}
|
|
13
|
-
exports.realizeLazyProperty = realizeLazyProperty;
|
|
14
|
-
//# sourceMappingURL=realizeLazyProperty.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realizeLazyProperty.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/realizeLazyProperty.ts"],"names":[],"mappings":";;;AAAA,SAAgB,mBAAmB,CAAI,GAAY,EAAE,GAAW,EAAE,KAAQ;IACxE,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;QAC9B,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,KAAK;QACnB,KAAK;KACN,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACd,CAAC;AARD,kDAQC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Sets the enumerable property of the specified properties of an object to true.
|
|
4
|
-
* @template T - The type of the object.
|
|
5
|
-
* @param object The object whose properties' enumerable property will be set to true.
|
|
6
|
-
* @param propertyNames The names of the properties to be set enumerable.
|
|
7
|
-
* @returns void
|
|
8
|
-
* @example ```ts
|
|
9
|
-
* const obj = { a: 1, b: 2, c: 3 };
|
|
10
|
-
* setEnumerable(obj, 'a', 'b');
|
|
11
|
-
* Object.keys(obj);
|
|
12
|
-
* //=> ['a', 'b']
|
|
13
|
-
* ```
|
|
14
|
-
* @remarks This function uses `Object.defineProperty` to set the enumerable property.
|
|
15
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
16
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty | Object.defineProperty}
|
|
17
|
-
*/
|
|
18
|
-
export declare function setEnumerable(object: Record<ObjectKey, any>, ...properties: string[]): void;
|
|
19
|
-
//# sourceMappingURL=setEnumerable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setEnumerable.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setEnumerable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAK3F"}
|
package/cjs/lib/setEnumerable.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setEnumerable = void 0;
|
|
4
|
-
const objUpdatePropertyDescriptors_1 = require("./objUpdatePropertyDescriptors");
|
|
5
|
-
/**
|
|
6
|
-
* Sets the enumerable property of the specified properties of an object to true.
|
|
7
|
-
* @template T - The type of the object.
|
|
8
|
-
* @param object The object whose properties' enumerable property will be set to true.
|
|
9
|
-
* @param propertyNames The names of the properties to be set enumerable.
|
|
10
|
-
* @returns void
|
|
11
|
-
* @example ```ts
|
|
12
|
-
* const obj = { a: 1, b: 2, c: 3 };
|
|
13
|
-
* setEnumerable(obj, 'a', 'b');
|
|
14
|
-
* Object.keys(obj);
|
|
15
|
-
* //=> ['a', 'b']
|
|
16
|
-
* ```
|
|
17
|
-
* @remarks This function uses `Object.defineProperty` to set the enumerable property.
|
|
18
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
19
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty | Object.defineProperty}
|
|
20
|
-
*/
|
|
21
|
-
function setEnumerable(object, ...properties) {
|
|
22
|
-
(0, objUpdatePropertyDescriptors_1.objUpdatePropertyDescriptors)(object, properties, (descriptor) => {
|
|
23
|
-
descriptor.enumerable = true;
|
|
24
|
-
return descriptor;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
exports.setEnumerable = setEnumerable;
|
|
28
|
-
//# sourceMappingURL=setEnumerable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setEnumerable.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setEnumerable.ts"],"names":[],"mappings":";;;AACA,iFAA8E;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,aAAa,CAAC,MAA8B,EAAE,GAAG,UAAoB;IACnF,IAAA,2DAA4B,EAAC,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;QAC9D,UAAU,CAAC,UAAU,GAAG,IAAI,CAAA;QAC5B,OAAO,UAAU,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC;AALD,sCAKC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Sets the specified properties of an object as non-configurable.
|
|
4
|
-
* @remarks This function modifies the original object by setting the `configurable` attribute of the specified properties to `false`.
|
|
5
|
-
* Once a property is made non-configurable, it can neither be deleted from the object nor changed to configurable.
|
|
6
|
-
* @typeparam T - The type of the object.
|
|
7
|
-
* @param object The object whose properties are to be made non-configurable.
|
|
8
|
-
* @param properties The names of the properties to be made non-configurable.
|
|
9
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
10
|
-
* @example ```ts
|
|
11
|
-
* setNonConfigurable({ a: 1, b: 2, c: 3 }, 'a', 'b');
|
|
12
|
-
* Object.getOwnPropertyDescriptor({ a: 1, b: 2, c: 3 }, 'a');
|
|
13
|
-
* //=> {value: 1, writable: true, enumerable: true, configurable: false}
|
|
14
|
-
* Object.getOwnPropertyDescriptor({ a: 1, b: 2, c: 3 }, 'b');
|
|
15
|
-
* //=> {value: 2, writable: true, enumerable: true, configurable: false}
|
|
16
|
-
* Object.getOwnPropertyDescriptor({ a: 1, b: 2, c: 3 }, 'c');
|
|
17
|
-
* //=> {value: 3, writable: true, enumerable: true, configurable: true}
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare function setNonConfigurable(object: Record<ObjectKey, any>, ...properties: string[]): void;
|
|
21
|
-
//# sourceMappingURL=setNonConfigurable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setNonConfigurable.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setNonConfigurable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAKhG"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setNonConfigurable = void 0;
|
|
4
|
-
const objUpdatePropertyDescriptors_1 = require("./objUpdatePropertyDescriptors");
|
|
5
|
-
/**
|
|
6
|
-
* Sets the specified properties of an object as non-configurable.
|
|
7
|
-
* @remarks This function modifies the original object by setting the `configurable` attribute of the specified properties to `false`.
|
|
8
|
-
* Once a property is made non-configurable, it can neither be deleted from the object nor changed to configurable.
|
|
9
|
-
* @typeparam T - The type of the object.
|
|
10
|
-
* @param object The object whose properties are to be made non-configurable.
|
|
11
|
-
* @param properties The names of the properties to be made non-configurable.
|
|
12
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
13
|
-
* @example ```ts
|
|
14
|
-
* setNonConfigurable({ a: 1, b: 2, c: 3 }, 'a', 'b');
|
|
15
|
-
* Object.getOwnPropertyDescriptor({ a: 1, b: 2, c: 3 }, 'a');
|
|
16
|
-
* //=> {value: 1, writable: true, enumerable: true, configurable: false}
|
|
17
|
-
* Object.getOwnPropertyDescriptor({ a: 1, b: 2, c: 3 }, 'b');
|
|
18
|
-
* //=> {value: 2, writable: true, enumerable: true, configurable: false}
|
|
19
|
-
* Object.getOwnPropertyDescriptor({ a: 1, b: 2, c: 3 }, 'c');
|
|
20
|
-
* //=> {value: 3, writable: true, enumerable: true, configurable: true}
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
function setNonConfigurable(object, ...properties) {
|
|
24
|
-
(0, objUpdatePropertyDescriptors_1.objUpdatePropertyDescriptors)(object, properties, (descriptor) => {
|
|
25
|
-
descriptor.configurable = false;
|
|
26
|
-
return descriptor;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.setNonConfigurable = setNonConfigurable;
|
|
30
|
-
//# sourceMappingURL=setNonConfigurable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setNonConfigurable.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setNonConfigurable.ts"],"names":[],"mappings":";;;AACA,iFAA8E;AAE9E;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,kBAAkB,CAAC,MAA8B,EAAE,GAAG,UAAoB;IACxF,IAAA,2DAA4B,EAAC,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;QAC9D,UAAU,CAAC,YAAY,GAAG,KAAK,CAAA;QAC/B,OAAO,UAAU,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC;AALD,gDAKC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Sets the specified properties of an object as non-enumerable.
|
|
4
|
-
* @remarks This function modifies the original object by setting the specified properties as non-enumerable.
|
|
5
|
-
* If the object or any of the property names are not valid, it throws an error.
|
|
6
|
-
* @param object The object whose properties are to be set as non-enumerable.
|
|
7
|
-
* @param properties The names of the properties to be set as non-enumerable.
|
|
8
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
9
|
-
* @example ```ts
|
|
10
|
-
* setNonEnumerable({ a: 1, b: 2, c: 3 }, 'a', 'b');
|
|
11
|
-
* Object.keys({ a: 1, b: 2, c: 3 });
|
|
12
|
-
* //=> ['c']
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare function setNonEnumerable(object: Record<ObjectKey, any>, ...properties: string[]): void;
|
|
16
|
-
//# sourceMappingURL=setNonEnumerable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setNonEnumerable.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setNonEnumerable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAK9F"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setNonEnumerable = void 0;
|
|
4
|
-
const objUpdatePropertyDescriptors_1 = require("./objUpdatePropertyDescriptors");
|
|
5
|
-
/**
|
|
6
|
-
* Sets the specified properties of an object as non-enumerable.
|
|
7
|
-
* @remarks This function modifies the original object by setting the specified properties as non-enumerable.
|
|
8
|
-
* If the object or any of the property names are not valid, it throws an error.
|
|
9
|
-
* @param object The object whose properties are to be set as non-enumerable.
|
|
10
|
-
* @param properties The names of the properties to be set as non-enumerable.
|
|
11
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
12
|
-
* @example ```ts
|
|
13
|
-
* setNonEnumerable({ a: 1, b: 2, c: 3 }, 'a', 'b');
|
|
14
|
-
* Object.keys({ a: 1, b: 2, c: 3 });
|
|
15
|
-
* //=> ['c']
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
function setNonEnumerable(object, ...properties) {
|
|
19
|
-
(0, objUpdatePropertyDescriptors_1.objUpdatePropertyDescriptors)(object, properties, (descriptor) => {
|
|
20
|
-
descriptor.enumerable = false;
|
|
21
|
-
return descriptor;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
exports.setNonEnumerable = setNonEnumerable;
|
|
25
|
-
//# sourceMappingURL=setNonEnumerable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setNonEnumerable.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setNonEnumerable.ts"],"names":[],"mappings":";;;AACA,iFAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAAC,MAA8B,EAAE,GAAG,UAAoB;IACtF,IAAA,2DAA4B,EAAC,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;QAC9D,UAAU,CAAC,UAAU,GAAG,KAAK,CAAA;QAC7B,OAAO,UAAU,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC;AALD,4CAKC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Sets the specified properties of an object to be non-writable.
|
|
4
|
-
* @template T - The type of the object.
|
|
5
|
-
* @param object The object whose properties are to be made non-writable.
|
|
6
|
-
* @param properties The names of the properties to be made non-writable.
|
|
7
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
8
|
-
* @example ```ts
|
|
9
|
-
* const obj = { a: 1, b: 2, c: 3 };
|
|
10
|
-
* setNonWritable(obj, 'a', 'b');
|
|
11
|
-
* obj;
|
|
12
|
-
* //=> { a: 1, b: 2, c: 3 }
|
|
13
|
-
* obj.a = 10;
|
|
14
|
-
* //=> Throws an error
|
|
15
|
-
* obj.b = 20;
|
|
16
|
-
* //=> Throws an error
|
|
17
|
-
* obj.c = 30;
|
|
18
|
-
* //=> Works fine
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function setNonWritable(object: Record<ObjectKey, any>, ...properties: string[]): void;
|
|
22
|
-
//# sourceMappingURL=setNonWritable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setNonWritable.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setNonWritable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAK5F"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setNonWritable = void 0;
|
|
4
|
-
const objUpdatePropertyDescriptors_1 = require("./objUpdatePropertyDescriptors");
|
|
5
|
-
/**
|
|
6
|
-
* Sets the specified properties of an object to be non-writable.
|
|
7
|
-
* @template T - The type of the object.
|
|
8
|
-
* @param object The object whose properties are to be made non-writable.
|
|
9
|
-
* @param properties The names of the properties to be made non-writable.
|
|
10
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
11
|
-
* @example ```ts
|
|
12
|
-
* const obj = { a: 1, b: 2, c: 3 };
|
|
13
|
-
* setNonWritable(obj, 'a', 'b');
|
|
14
|
-
* obj;
|
|
15
|
-
* //=> { a: 1, b: 2, c: 3 }
|
|
16
|
-
* obj.a = 10;
|
|
17
|
-
* //=> Throws an error
|
|
18
|
-
* obj.b = 20;
|
|
19
|
-
* //=> Throws an error
|
|
20
|
-
* obj.c = 30;
|
|
21
|
-
* //=> Works fine
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
function setNonWritable(object, ...properties) {
|
|
25
|
-
(0, objUpdatePropertyDescriptors_1.objUpdatePropertyDescriptors)(object, properties, (descriptor) => {
|
|
26
|
-
descriptor.writable = false;
|
|
27
|
-
return descriptor;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.setNonWritable = setNonWritable;
|
|
31
|
-
//# sourceMappingURL=setNonWritable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setNonWritable.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setNonWritable.ts"],"names":[],"mappings":";;;AACA,iFAA8E;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,cAAc,CAAC,MAA8B,EAAE,GAAG,UAAoB;IACpF,IAAA,2DAA4B,EAAC,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;QAC9D,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAA;QAC3B,OAAO,UAAU,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC;AALD,wCAKC"}
|
package/cjs/lib/setWritable.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from '@bemoje/types';
|
|
2
|
-
/**
|
|
3
|
-
* Sets the specified properties of an object to be writable.
|
|
4
|
-
* @template T - The type of the object.
|
|
5
|
-
* @param object The object whose properties are to be made writable.
|
|
6
|
-
* @param propertyNames The names of the properties to be made writable.
|
|
7
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
8
|
-
* @example ```ts
|
|
9
|
-
* setWritable({ a: 1, b: 2 }, 'a', 'b').a = 3;
|
|
10
|
-
* //=> 3
|
|
11
|
-
* setWritable({ a: 1, b: 2 }, 'a', 'b').b = 4;
|
|
12
|
-
* //=> 4
|
|
13
|
-
* ```
|
|
14
|
-
* @returns void
|
|
15
|
-
*/
|
|
16
|
-
export declare function setWritable(object: Record<ObjectKey, any>, ...properties: string[]): void;
|
|
17
|
-
//# sourceMappingURL=setWritable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setWritable.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setWritable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAKzF"}
|
package/cjs/lib/setWritable.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setWritable = void 0;
|
|
4
|
-
const objUpdatePropertyDescriptors_1 = require("./objUpdatePropertyDescriptors");
|
|
5
|
-
/**
|
|
6
|
-
* Sets the specified properties of an object to be writable.
|
|
7
|
-
* @template T - The type of the object.
|
|
8
|
-
* @param object The object whose properties are to be made writable.
|
|
9
|
-
* @param propertyNames The names of the properties to be made writable.
|
|
10
|
-
* @throws Will throw an error if any of the specified properties do not exist on the object.
|
|
11
|
-
* @example ```ts
|
|
12
|
-
* setWritable({ a: 1, b: 2 }, 'a', 'b').a = 3;
|
|
13
|
-
* //=> 3
|
|
14
|
-
* setWritable({ a: 1, b: 2 }, 'a', 'b').b = 4;
|
|
15
|
-
* //=> 4
|
|
16
|
-
* ```
|
|
17
|
-
* @returns void
|
|
18
|
-
*/
|
|
19
|
-
function setWritable(object, ...properties) {
|
|
20
|
-
(0, objUpdatePropertyDescriptors_1.objUpdatePropertyDescriptors)(object, properties, (descriptor) => {
|
|
21
|
-
descriptor.writable = true;
|
|
22
|
-
return descriptor;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
exports.setWritable = setWritable;
|
|
26
|
-
//# sourceMappingURL=setWritable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setWritable.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/setWritable.ts"],"names":[],"mappings":";;;AACA,iFAA8E;AAE9E;;;;;;;;;;;;;GAaG;AACH,SAAgB,WAAW,CAAC,MAA8B,EAAE,GAAG,UAAoB;IACjF,IAAA,2DAA4B,EAAC,MAAM,EAAE,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;QAC9D,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAA;QAC1B,OAAO,UAAU,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC;AALD,kCAKC"}
|
package/cjs/lib/superChain.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"superChain.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/superChain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAAC,CAK1G"}
|
package/cjs/lib/superChain.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.superChain = void 0;
|
|
4
|
-
const is_1 = require("@bemoje/is");
|
|
5
|
-
function superChain(o, opts) {
|
|
6
|
-
if ((0, is_1.isObject)(o))
|
|
7
|
-
o = Object.getPrototypeOf(o).constructor;
|
|
8
|
-
if (typeof o !== 'function')
|
|
9
|
-
throw new Error('Expected object or constructor.');
|
|
10
|
-
if (!o.name || o === Object)
|
|
11
|
-
return [Object];
|
|
12
|
-
return (opts?.excludeSelf ? [] : [o]).concat(superChain(Object.getPrototypeOf(o)));
|
|
13
|
-
}
|
|
14
|
-
exports.superChain = superChain;
|
|
15
|
-
//# sourceMappingURL=superChain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"superChain.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/superChain.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAGrC,SAAgB,UAAU,CAAC,CAAwB,EAAE,IAAgC;IACnF,IAAI,IAAA,aAAQ,EAAC,CAAC,CAAC;QAAE,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;IACzD,IAAI,OAAO,CAAC,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IAC/E,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,MAAM;QAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5C,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAwB,CAAA;AAC3G,CAAC;AALD,gCAKC"}
|