@visulima/deep-clone 2.1.10 → 3.0.0

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +62 -9
  3. package/dist/handler.js +1 -0
  4. package/dist/index.js +1 -0
  5. package/dist/packem_shared/copyArrayBuffer-_dUBQIVn.js +1 -0
  6. package/dist/packem_shared/copyArrayLoose-BEBF0PeG.js +1 -0
  7. package/dist/packem_shared/copyBlob-S-Z7ux38.js +1 -0
  8. package/dist/packem_shared/copyDataView-EF9L1_xC.js +1 -0
  9. package/dist/packem_shared/copyDate-b-cxY0ZF.js +1 -0
  10. package/dist/packem_shared/copyError-Bdcealjm.js +1 -0
  11. package/dist/packem_shared/copyMapLoose-BodEbKp7.js +1 -0
  12. package/dist/packem_shared/copyObjectLoose-C5x-tHKP.js +1 -0
  13. package/dist/packem_shared/copyOwnProperties-QEhjt2x8.js +1 -0
  14. package/dist/packem_shared/copyRegExpLoose-Cio6jQWx.js +1 -0
  15. package/dist/packem_shared/copySetLoose-L-swSTFR.js +1 -0
  16. package/dist/packem_shared/getCleanClone-D0FN9QGR.js +1 -0
  17. package/dist/utils.js +1 -0
  18. package/package.json +8 -42
  19. package/dist/handler.cjs +0 -32
  20. package/dist/handler.d.cts +0 -33
  21. package/dist/handler.d.mts +0 -33
  22. package/dist/handler.mjs +0 -10
  23. package/dist/index.cjs +0 -121
  24. package/dist/index.d.cts +0 -9
  25. package/dist/index.d.mts +0 -9
  26. package/dist/index.mjs +0 -117
  27. package/dist/packem_shared/copyArrayBuffer-CCGJtx0g.cjs +0 -36
  28. package/dist/packem_shared/copyArrayBuffer-DnYU3Ab_.mjs +0 -34
  29. package/dist/packem_shared/copyArrayLoose-DutO2eEt.mjs +0 -19
  30. package/dist/packem_shared/copyArrayLoose-jv5B0O8W.cjs +0 -24
  31. package/dist/packem_shared/copyBlob-B8SnIatQ.cjs +0 -7
  32. package/dist/packem_shared/copyBlob-ChzBsdC1.mjs +0 -5
  33. package/dist/packem_shared/copyDataView-BJMKTRTm.mjs +0 -7
  34. package/dist/packem_shared/copyDataView-DHMi5seB.cjs +0 -9
  35. package/dist/packem_shared/copyDate-Bgbm3mwe.mjs +0 -5
  36. package/dist/packem_shared/copyDate-CSIVko_l.cjs +0 -7
  37. package/dist/packem_shared/copyError-8k5J3dj4.mjs +0 -22
  38. package/dist/packem_shared/copyError-C1oK1eBT.cjs +0 -24
  39. package/dist/packem_shared/copyMapLoose-6OISt6H6.mjs +0 -15
  40. package/dist/packem_shared/copyMapLoose-DpoR0LmV.cjs +0 -20
  41. package/dist/packem_shared/copyObjectLoose-C0Xe4P0E.mjs +0 -47
  42. package/dist/packem_shared/copyObjectLoose-PHaYRVaE.cjs +0 -52
  43. package/dist/packem_shared/copyOwnProperties-FDDRgAnK.mjs +0 -30
  44. package/dist/packem_shared/copyOwnProperties-NdANNH2P.cjs +0 -32
  45. package/dist/packem_shared/copyRegExpLoose-455kIpwH.cjs +0 -20
  46. package/dist/packem_shared/copyRegExpLoose-CPAMvOoY.mjs +0 -15
  47. package/dist/packem_shared/copySetLoose-BBgAFOdx.cjs +0 -20
  48. package/dist/packem_shared/copySetLoose-BIxHjmWz.mjs +0 -15
  49. package/dist/packem_shared/getCleanClone-BhfRMqgx.cjs +0 -22
  50. package/dist/packem_shared/getCleanClone-Ch3gqIzM.mjs +0 -20
  51. package/dist/packem_shared/types-_Qve7nv8.d.cts +0 -31
  52. package/dist/packem_shared/types-_Qve7nv8.d.mts +0 -31
  53. package/dist/utils.cjs +0 -11
  54. package/dist/utils.d.cts +0 -7
  55. package/dist/utils.d.mts +0 -7
  56. package/dist/utils.mjs +0 -2
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyArrayBuffer = /* @__PURE__ */ __name((arrayBuffer) => {
6
- const typeHandlers = {
7
- BigInt64Array,
8
- BigUint64Array,
9
- // @ts-expect-error - Buffer has no constructor
10
- // eslint-disable-next-line @typescript-eslint/unbound-method
11
- Buffer: Buffer.from,
12
- Float32Array,
13
- Float64Array,
14
- Int8Array,
15
- Int16Array,
16
- Int32Array,
17
- Uint8Array,
18
- Uint8ClampedArray,
19
- Uint16Array,
20
- Uint32Array
21
- };
22
- if (arrayBuffer instanceof ArrayBuffer) {
23
- const newBuffer = new ArrayBuffer(arrayBuffer.byteLength);
24
- const origView = new Uint8Array(arrayBuffer);
25
- const newView = new Uint8Array(newBuffer);
26
- newView.set(origView);
27
- return newBuffer;
28
- }
29
- const Ctor = typeHandlers[arrayBuffer.constructor.name] ?? void 0;
30
- if (Ctor) {
31
- return new Ctor(arrayBuffer);
32
- }
33
- return new arrayBuffer.constructor([...arrayBuffer.buffer], arrayBuffer.byteOffset, arrayBuffer.length);
34
- }, "copyArrayBuffer");
35
-
36
- module.exports = copyArrayBuffer;
@@ -1,34 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const copyArrayBuffer = /* @__PURE__ */ __name((arrayBuffer) => {
4
- const typeHandlers = {
5
- BigInt64Array,
6
- BigUint64Array,
7
- // @ts-expect-error - Buffer has no constructor
8
- // eslint-disable-next-line @typescript-eslint/unbound-method
9
- Buffer: Buffer.from,
10
- Float32Array,
11
- Float64Array,
12
- Int8Array,
13
- Int16Array,
14
- Int32Array,
15
- Uint8Array,
16
- Uint8ClampedArray,
17
- Uint16Array,
18
- Uint32Array
19
- };
20
- if (arrayBuffer instanceof ArrayBuffer) {
21
- const newBuffer = new ArrayBuffer(arrayBuffer.byteLength);
22
- const origView = new Uint8Array(arrayBuffer);
23
- const newView = new Uint8Array(newBuffer);
24
- newView.set(origView);
25
- return newBuffer;
26
- }
27
- const Ctor = typeHandlers[arrayBuffer.constructor.name] ?? void 0;
28
- if (Ctor) {
29
- return new Ctor(arrayBuffer);
30
- }
31
- return new arrayBuffer.constructor([...arrayBuffer.buffer], arrayBuffer.byteOffset, arrayBuffer.length);
32
- }, "copyArrayBuffer");
33
-
34
- export { copyArrayBuffer as default };
@@ -1,19 +0,0 @@
1
- import copyOwnProperties from './copyOwnProperties-FDDRgAnK.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyArrayLoose = /* @__PURE__ */ __name((array, state) => {
6
- const clone = [];
7
- state.cache.set(array, clone);
8
- for (let index = 0, { length } = array; index < length; ++index) {
9
- clone[index] = state.clone(array[index], state);
10
- }
11
- return clone;
12
- }, "copyArrayLoose");
13
- const copyArrayStrict = /* @__PURE__ */ __name((array, state) => {
14
- const clone = [];
15
- state.cache.set(array, clone);
16
- return copyOwnProperties(array, clone, state);
17
- }, "copyArrayStrict");
18
-
19
- export { copyArrayLoose, copyArrayStrict };
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const copyOwnProperties = require('./copyOwnProperties-NdANNH2P.cjs');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- const copyArrayLoose = /* @__PURE__ */ __name((array, state) => {
10
- const clone = [];
11
- state.cache.set(array, clone);
12
- for (let index = 0, { length } = array; index < length; ++index) {
13
- clone[index] = state.clone(array[index], state);
14
- }
15
- return clone;
16
- }, "copyArrayLoose");
17
- const copyArrayStrict = /* @__PURE__ */ __name((array, state) => {
18
- const clone = [];
19
- state.cache.set(array, clone);
20
- return copyOwnProperties(array, clone, state);
21
- }, "copyArrayStrict");
22
-
23
- exports.copyArrayLoose = copyArrayLoose;
24
- exports.copyArrayStrict = copyArrayStrict;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyBlob = /* @__PURE__ */ __name((blob) => blob.slice(0, blob.size, blob.type), "copyBlob");
6
-
7
- module.exports = copyBlob;
@@ -1,5 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const copyBlob = /* @__PURE__ */ __name((blob) => blob.slice(0, blob.size, blob.type), "copyBlob");
4
-
5
- export { copyBlob as default };
@@ -1,7 +0,0 @@
1
- import copyArrayBuffer from './copyArrayBuffer-DnYU3Ab_.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyDataView = /* @__PURE__ */ __name((dataView) => new DataView(copyArrayBuffer(dataView.buffer)), "copyDataView");
6
-
7
- export { copyDataView as default };
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- const copyArrayBuffer = require('./copyArrayBuffer-CCGJtx0g.cjs');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- const copyDataView = /* @__PURE__ */ __name((dataView) => new DataView(copyArrayBuffer(dataView.buffer)), "copyDataView");
8
-
9
- module.exports = copyDataView;
@@ -1,5 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const copyDate = /* @__PURE__ */ __name((date) => new Date(date.getTime()), "copyDate");
4
-
5
- export { copyDate as default };
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyDate = /* @__PURE__ */ __name((date) => new Date(date.getTime()), "copyDate");
6
-
7
- module.exports = copyDate;
@@ -1,22 +0,0 @@
1
- import copyOwnProperties from './copyOwnProperties-FDDRgAnK.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyError = /* @__PURE__ */ __name((object, state) => {
6
- const error = new object.constructor(object.message);
7
- if (object.stack) {
8
- error.stack = object.stack;
9
- }
10
- if (object.code) {
11
- error.code = object.code;
12
- }
13
- if (object.errno) {
14
- error.errno = object.errno;
15
- }
16
- if (object.syscall) {
17
- error.syscall = object.syscall;
18
- }
19
- return copyOwnProperties(object, error, state);
20
- }, "copyError");
21
-
22
- export { copyError as default };
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- const copyOwnProperties = require('./copyOwnProperties-NdANNH2P.cjs');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- const copyError = /* @__PURE__ */ __name((object, state) => {
8
- const error = new object.constructor(object.message);
9
- if (object.stack) {
10
- error.stack = object.stack;
11
- }
12
- if (object.code) {
13
- error.code = object.code;
14
- }
15
- if (object.errno) {
16
- error.errno = object.errno;
17
- }
18
- if (object.syscall) {
19
- error.syscall = object.syscall;
20
- }
21
- return copyOwnProperties(object, error, state);
22
- }, "copyError");
23
-
24
- module.exports = copyError;
@@ -1,15 +0,0 @@
1
- import copyOwnProperties from './copyOwnProperties-FDDRgAnK.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyMapLoose = /* @__PURE__ */ __name((map, state) => {
6
- const clone = /* @__PURE__ */ new Map();
7
- state.cache.set(map, clone);
8
- map.forEach((value, key) => {
9
- clone.set(key, state.clone(value, state));
10
- });
11
- return clone;
12
- }, "copyMapLoose");
13
- const copyMapStrict = /* @__PURE__ */ __name((map, state) => copyOwnProperties(map, copyMapLoose(map, state), state), "copyMapStrict");
14
-
15
- export { copyMapLoose, copyMapStrict };
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const copyOwnProperties = require('./copyOwnProperties-NdANNH2P.cjs');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- const copyMapLoose = /* @__PURE__ */ __name((map, state) => {
10
- const clone = /* @__PURE__ */ new Map();
11
- state.cache.set(map, clone);
12
- map.forEach((value, key) => {
13
- clone.set(key, state.clone(value, state));
14
- });
15
- return clone;
16
- }, "copyMapLoose");
17
- const copyMapStrict = /* @__PURE__ */ __name((map, state) => copyOwnProperties(map, copyMapLoose(map, state), state), "copyMapStrict");
18
-
19
- exports.copyMapLoose = copyMapLoose;
20
- exports.copyMapStrict = copyMapStrict;
@@ -1,47 +0,0 @@
1
- import copyOwnProperties from './copyOwnProperties-FDDRgAnK.mjs';
2
- import getCleanClone from './getCleanClone-Ch3gqIzM.mjs';
3
-
4
- var __defProp = Object.defineProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- const copyObjectIsFunctions = /* @__PURE__ */ __name((object, clone) => {
7
- if (!Object.isExtensible(object)) {
8
- Object.preventExtensions(clone);
9
- }
10
- if (Object.isSealed(object)) {
11
- Object.seal(clone);
12
- }
13
- if (Object.isFrozen(object)) {
14
- Object.freeze(clone);
15
- }
16
- }, "copyObjectIsFunctions");
17
- const copyObjectLoose = /* @__PURE__ */ __name((object, state) => {
18
- const clone = getCleanClone(object);
19
- state.cache.set(object, clone);
20
- for (const key in object) {
21
- if (Object.hasOwnProperty.call(object, key)) {
22
- clone[key] = state.clone(object[key], state);
23
- }
24
- }
25
- const symbols = Object.getOwnPropertySymbols(object);
26
- for (let index = 0, { length } = symbols, symbol; index < length; ++index) {
27
- symbol = symbols[index];
28
- if (Object.prototype.propertyIsEnumerable.call(object, symbol)) {
29
- clone[symbol] = state.clone(object[symbol], state);
30
- }
31
- }
32
- copyObjectIsFunctions(object, clone);
33
- return clone;
34
- }, "copyObjectLoose");
35
- const copyObjectStrict = /* @__PURE__ */ __name((object, state) => {
36
- const clone = getCleanClone(object);
37
- state.cache.set(object, clone);
38
- const clonedObject = copyOwnProperties(object, clone, state);
39
- const objectPrototype = Object.getPrototypeOf(object);
40
- if (Object.getPrototypeOf(clonedObject) !== objectPrototype) {
41
- Object.setPrototypeOf(clonedObject, objectPrototype);
42
- }
43
- copyObjectIsFunctions(object, clone);
44
- return clonedObject;
45
- }, "copyObjectStrict");
46
-
47
- export { copyObjectLoose, copyObjectStrict };
@@ -1,52 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const copyOwnProperties = require('./copyOwnProperties-NdANNH2P.cjs');
6
- const getCleanClone = require('./getCleanClone-BhfRMqgx.cjs');
7
-
8
- var __defProp = Object.defineProperty;
9
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
- const copyObjectIsFunctions = /* @__PURE__ */ __name((object, clone) => {
11
- if (!Object.isExtensible(object)) {
12
- Object.preventExtensions(clone);
13
- }
14
- if (Object.isSealed(object)) {
15
- Object.seal(clone);
16
- }
17
- if (Object.isFrozen(object)) {
18
- Object.freeze(clone);
19
- }
20
- }, "copyObjectIsFunctions");
21
- const copyObjectLoose = /* @__PURE__ */ __name((object, state) => {
22
- const clone = getCleanClone(object);
23
- state.cache.set(object, clone);
24
- for (const key in object) {
25
- if (Object.hasOwnProperty.call(object, key)) {
26
- clone[key] = state.clone(object[key], state);
27
- }
28
- }
29
- const symbols = Object.getOwnPropertySymbols(object);
30
- for (let index = 0, { length } = symbols, symbol; index < length; ++index) {
31
- symbol = symbols[index];
32
- if (Object.prototype.propertyIsEnumerable.call(object, symbol)) {
33
- clone[symbol] = state.clone(object[symbol], state);
34
- }
35
- }
36
- copyObjectIsFunctions(object, clone);
37
- return clone;
38
- }, "copyObjectLoose");
39
- const copyObjectStrict = /* @__PURE__ */ __name((object, state) => {
40
- const clone = getCleanClone(object);
41
- state.cache.set(object, clone);
42
- const clonedObject = copyOwnProperties(object, clone, state);
43
- const objectPrototype = Object.getPrototypeOf(object);
44
- if (Object.getPrototypeOf(clonedObject) !== objectPrototype) {
45
- Object.setPrototypeOf(clonedObject, objectPrototype);
46
- }
47
- copyObjectIsFunctions(object, clone);
48
- return clonedObject;
49
- }, "copyObjectStrict");
50
-
51
- exports.copyObjectLoose = copyObjectLoose;
52
- exports.copyObjectStrict = copyObjectStrict;
@@ -1,30 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const getStrictProperties = /* @__PURE__ */ __name((object) => [
4
- ...Object.getOwnPropertyNames(object),
5
- ...Object.getOwnPropertySymbols(object)
6
- ], "getStrictProperties");
7
- const copyOwnProperties = /* @__PURE__ */ __name((value, clone, state) => {
8
- const properties = getStrictProperties(value);
9
- for (const property of properties) {
10
- if (property === "callee" || property === "caller") {
11
- continue;
12
- }
13
- const descriptor = Object.getOwnPropertyDescriptor(value, property);
14
- if (!descriptor) {
15
- clone[property] = state.clone(value[property], state);
16
- continue;
17
- }
18
- if (!descriptor.get && !descriptor.set) {
19
- descriptor.value = state.clone(descriptor.value, state);
20
- }
21
- try {
22
- Object.defineProperty(clone, property, descriptor);
23
- } catch {
24
- clone[property] = descriptor.value;
25
- }
26
- }
27
- return clone;
28
- }, "copyOwnProperties");
29
-
30
- export { copyOwnProperties as default };
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const getStrictProperties = /* @__PURE__ */ __name((object) => [
6
- ...Object.getOwnPropertyNames(object),
7
- ...Object.getOwnPropertySymbols(object)
8
- ], "getStrictProperties");
9
- const copyOwnProperties = /* @__PURE__ */ __name((value, clone, state) => {
10
- const properties = getStrictProperties(value);
11
- for (const property of properties) {
12
- if (property === "callee" || property === "caller") {
13
- continue;
14
- }
15
- const descriptor = Object.getOwnPropertyDescriptor(value, property);
16
- if (!descriptor) {
17
- clone[property] = state.clone(value[property], state);
18
- continue;
19
- }
20
- if (!descriptor.get && !descriptor.set) {
21
- descriptor.value = state.clone(descriptor.value, state);
22
- }
23
- try {
24
- Object.defineProperty(clone, property, descriptor);
25
- } catch {
26
- clone[property] = descriptor.value;
27
- }
28
- }
29
- return clone;
30
- }, "copyOwnProperties");
31
-
32
- module.exports = copyOwnProperties;
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const copyOwnProperties = require('./copyOwnProperties-NdANNH2P.cjs');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- const copyRegExpLoose = /* @__PURE__ */ __name((regExp) => {
10
- const clone = new RegExp(regExp.source, regExp.flags);
11
- clone.lastIndex = regExp.lastIndex;
12
- return clone;
13
- }, "copyRegExpLoose");
14
- const copyRegExpStrict = /* @__PURE__ */ __name((regExp, state) => {
15
- const clone = new RegExp(regExp.source, regExp.flags);
16
- return copyOwnProperties(regExp, clone, state);
17
- }, "copyRegExpStrict");
18
-
19
- exports.copyRegExpLoose = copyRegExpLoose;
20
- exports.copyRegExpStrict = copyRegExpStrict;
@@ -1,15 +0,0 @@
1
- import copyOwnProperties from './copyOwnProperties-FDDRgAnK.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copyRegExpLoose = /* @__PURE__ */ __name((regExp) => {
6
- const clone = new RegExp(regExp.source, regExp.flags);
7
- clone.lastIndex = regExp.lastIndex;
8
- return clone;
9
- }, "copyRegExpLoose");
10
- const copyRegExpStrict = /* @__PURE__ */ __name((regExp, state) => {
11
- const clone = new RegExp(regExp.source, regExp.flags);
12
- return copyOwnProperties(regExp, clone, state);
13
- }, "copyRegExpStrict");
14
-
15
- export { copyRegExpLoose, copyRegExpStrict };
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const copyOwnProperties = require('./copyOwnProperties-NdANNH2P.cjs');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- const copySetLoose = /* @__PURE__ */ __name((set, state) => {
10
- const clone = /* @__PURE__ */ new Set();
11
- state.cache.set(set, clone);
12
- set.forEach((value) => {
13
- clone.add(state.clone(value, state));
14
- });
15
- return clone;
16
- }, "copySetLoose");
17
- const copySetStrict = /* @__PURE__ */ __name((set, state) => copyOwnProperties(set, copySetLoose(set, state), state), "copySetStrict");
18
-
19
- exports.copySetLoose = copySetLoose;
20
- exports.copySetStrict = copySetStrict;
@@ -1,15 +0,0 @@
1
- import copyOwnProperties from './copyOwnProperties-FDDRgAnK.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const copySetLoose = /* @__PURE__ */ __name((set, state) => {
6
- const clone = /* @__PURE__ */ new Set();
7
- state.cache.set(set, clone);
8
- set.forEach((value) => {
9
- clone.add(state.clone(value, state));
10
- });
11
- return clone;
12
- }, "copySetLoose");
13
- const copySetStrict = /* @__PURE__ */ __name((set, state) => copyOwnProperties(set, copySetLoose(set, state), state), "copySetStrict");
14
-
15
- export { copySetLoose, copySetStrict };
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const getCleanClone = /* @__PURE__ */ __name((input) => {
6
- if (!input) {
7
- return /* @__PURE__ */ Object.create(null);
8
- }
9
- const Constructor = input.constructor;
10
- if (Constructor === Object) {
11
- return input === Object.prototype ? {} : Object.create(input);
12
- }
13
- if (~Function.prototype.toString.call(Constructor).indexOf("[native code]")) {
14
- try {
15
- return new Constructor();
16
- } catch {
17
- }
18
- }
19
- return Object.create(input);
20
- }, "getCleanClone");
21
-
22
- module.exports = getCleanClone;
@@ -1,20 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const getCleanClone = /* @__PURE__ */ __name((input) => {
4
- if (!input) {
5
- return /* @__PURE__ */ Object.create(null);
6
- }
7
- const Constructor = input.constructor;
8
- if (Constructor === Object) {
9
- return input === Object.prototype ? {} : Object.create(input);
10
- }
11
- if (~Function.prototype.toString.call(Constructor).indexOf("[native code]")) {
12
- try {
13
- return new Constructor();
14
- } catch {
15
- }
16
- }
17
- return Object.create(input);
18
- }, "getCleanClone");
19
-
20
- export { getCleanClone as default };
@@ -1,31 +0,0 @@
1
- type InternalHandler<Value> = (value: Value, state: State) => Value;
2
- interface State {
3
- cache: WeakMap<any, unknown>;
4
- clone: InternalHandler<unknown>;
5
- }
6
- type Options = {
7
- handler?: {
8
- Array: InternalHandler<unknown[]>;
9
- ArrayBuffer: InternalHandler<ArrayBuffer>;
10
- Blob: InternalHandler<Blob>;
11
- DataView: InternalHandler<DataView>;
12
- Date: InternalHandler<Date>;
13
- Error: InternalHandler<Error>;
14
- Float32Array: InternalHandler<Float32Array>;
15
- Float64Array: InternalHandler<Float64Array>;
16
- Int8Array: InternalHandler<Int8Array>;
17
- Int16Array: InternalHandler<Int16Array>;
18
- Int32Array: InternalHandler<Int32Array>;
19
- Map: InternalHandler<Map<unknown, unknown>>;
20
- Object: InternalHandler<Record<string, unknown>>;
21
- Promise: InternalHandler<Promise<unknown>>;
22
- RegExp: InternalHandler<RegExp>;
23
- Set: InternalHandler<Set<unknown>>;
24
- WeakMap: InternalHandler<WeakMap<any, unknown>>;
25
- WeakSet: InternalHandler<WeakSet<any>>;
26
- };
27
- strict?: boolean;
28
- };
29
- type TypedArray = BigInt64Array | BigUint64Array | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
30
-
31
- export type { Options as O, State as S, TypedArray as T };
@@ -1,31 +0,0 @@
1
- type InternalHandler<Value> = (value: Value, state: State) => Value;
2
- interface State {
3
- cache: WeakMap<any, unknown>;
4
- clone: InternalHandler<unknown>;
5
- }
6
- type Options = {
7
- handler?: {
8
- Array: InternalHandler<unknown[]>;
9
- ArrayBuffer: InternalHandler<ArrayBuffer>;
10
- Blob: InternalHandler<Blob>;
11
- DataView: InternalHandler<DataView>;
12
- Date: InternalHandler<Date>;
13
- Error: InternalHandler<Error>;
14
- Float32Array: InternalHandler<Float32Array>;
15
- Float64Array: InternalHandler<Float64Array>;
16
- Int8Array: InternalHandler<Int8Array>;
17
- Int16Array: InternalHandler<Int16Array>;
18
- Int32Array: InternalHandler<Int32Array>;
19
- Map: InternalHandler<Map<unknown, unknown>>;
20
- Object: InternalHandler<Record<string, unknown>>;
21
- Promise: InternalHandler<Promise<unknown>>;
22
- RegExp: InternalHandler<RegExp>;
23
- Set: InternalHandler<Set<unknown>>;
24
- WeakMap: InternalHandler<WeakMap<any, unknown>>;
25
- WeakSet: InternalHandler<WeakSet<any>>;
26
- };
27
- strict?: boolean;
28
- };
29
- type TypedArray = BigInt64Array | BigUint64Array | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
30
-
31
- export type { Options as O, State as S, TypedArray as T };
package/dist/utils.cjs DELETED
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const copyOwnProperties = require('./packem_shared/copyOwnProperties-NdANNH2P.cjs');
6
- const getCleanClone = require('./packem_shared/getCleanClone-BhfRMqgx.cjs');
7
-
8
-
9
-
10
- exports.copyOwnProperties = copyOwnProperties;
11
- exports.getCleanClone = getCleanClone;
package/dist/utils.d.cts DELETED
@@ -1,7 +0,0 @@
1
- import { S as State } from './packem_shared/types-_Qve7nv8.cjs';
2
-
3
- declare const copyOwnProperties: <Value>(value: Value, clone: Value, state: State) => Value;
4
-
5
- declare const getCleanClone: (input: unknown) => any;
6
-
7
- export { copyOwnProperties, getCleanClone };
package/dist/utils.d.mts DELETED
@@ -1,7 +0,0 @@
1
- import { S as State } from './packem_shared/types-_Qve7nv8.mjs';
2
-
3
- declare const copyOwnProperties: <Value>(value: Value, clone: Value, state: State) => Value;
4
-
5
- declare const getCleanClone: (input: unknown) => any;
6
-
7
- export { copyOwnProperties, getCleanClone };
package/dist/utils.mjs DELETED
@@ -1,2 +0,0 @@
1
- export { default as copyOwnProperties } from './packem_shared/copyOwnProperties-FDDRgAnK.mjs';
2
- export { default as getCleanClone } from './packem_shared/getCleanClone-Ch3gqIzM.mjs';