@vope/utils 1.6.0-bate.7 → 1.6.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 (75) hide show
  1. package/dist/clamp.js +3 -23
  2. package/dist/classnames.js +7 -27
  3. package/dist/compare/version.js +3 -23
  4. package/dist/compare/weak-equal.js +5 -25
  5. package/dist/convert/json.js +3 -23
  6. package/dist/convert/object.js +3 -23
  7. package/dist/convert/strings.js +3 -23
  8. package/dist/desens.js +7 -27
  9. package/dist/encoding.js +3 -23
  10. package/dist/index.cjs.js +1265 -0
  11. package/dist/index.js +72 -102
  12. package/dist/input-regex.js +3 -23
  13. package/dist/is/class.js +3 -23
  14. package/dist/is/empty.js +4 -24
  15. package/dist/is/key.js +3 -23
  16. package/dist/is/null.js +3 -23
  17. package/dist/load/image.js +3 -23
  18. package/dist/memory/basic.js +5 -25
  19. package/dist/memory/list.js +5 -25
  20. package/dist/memory/power.js +7 -27
  21. package/dist/memory/simple.js +5 -25
  22. package/dist/neo4j-anchors.js +6 -26
  23. package/dist/neo4j.js +12 -32
  24. package/dist/once.js +3 -23
  25. package/dist/parse/num.js +5 -25
  26. package/dist/power/decon.js +3 -23
  27. package/dist/rotate/angle.js +4 -24
  28. package/dist/rotate/rad.js +3 -23
  29. package/dist/serialize/url-params.js +8 -28
  30. package/dist/style/css.js +7 -27
  31. package/dist/subscriber.js +5 -25
  32. package/dist/table/flex.js +3 -23
  33. package/dist/union.js +3 -23
  34. package/dist/url/join.js +3 -23
  35. package/dist/url/params.js +5 -25
  36. package/dist/wait.js +3 -23
  37. package/package.json +8 -8
  38. package/sub_storage/{offline.mjs → offline.cjs.js} +59 -27
  39. package/sub_storage/offline.js +15 -45
  40. package/sub_storage/package.json +2 -2
  41. package/dist/clamp.mjs +0 -11
  42. package/dist/classnames.mjs +0 -17
  43. package/dist/compare/version.mjs +0 -15
  44. package/dist/compare/weak-equal.mjs +0 -33
  45. package/dist/convert/json.mjs +0 -7
  46. package/dist/convert/object.mjs +0 -7
  47. package/dist/convert/strings.mjs +0 -7
  48. package/dist/desens.mjs +0 -51
  49. package/dist/encoding.mjs +0 -56
  50. package/dist/index.mjs +0 -73
  51. package/dist/input-regex.mjs +0 -8
  52. package/dist/is/class.mjs +0 -22
  53. package/dist/is/empty.mjs +0 -5
  54. package/dist/is/key.mjs +0 -4
  55. package/dist/is/null.mjs +0 -4
  56. package/dist/load/image.mjs +0 -11
  57. package/dist/memory/basic.mjs +0 -167
  58. package/dist/memory/list.mjs +0 -12
  59. package/dist/memory/power.mjs +0 -13
  60. package/dist/memory/simple.mjs +0 -94
  61. package/dist/neo4j-anchors.mjs +0 -169
  62. package/dist/neo4j.mjs +0 -161
  63. package/dist/once.mjs +0 -8
  64. package/dist/parse/num.mjs +0 -31
  65. package/dist/power/decon.mjs +0 -22
  66. package/dist/rotate/angle.mjs +0 -5
  67. package/dist/rotate/rad.mjs +0 -11
  68. package/dist/serialize/url-params.mjs +0 -53
  69. package/dist/style/css.mjs +0 -25
  70. package/dist/subscriber.mjs +0 -64
  71. package/dist/table/flex.mjs +0 -96
  72. package/dist/union.mjs +0 -47
  73. package/dist/url/join.mjs +0 -9
  74. package/dist/url/params.mjs +0 -8
  75. package/dist/wait.mjs +0 -4
package/dist/clamp.js CHANGED
@@ -1,26 +1,3 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var clamp_exports = {};
20
- __export(clamp_exports, {
21
- clamp: () => clamp
22
- });
23
- module.exports = __toCommonJS(clamp_exports);
24
1
  const clamp = (value, min, max) => {
25
2
  if (min > max) {
26
3
  const swap = max;
@@ -29,3 +6,6 @@ const clamp = (value, min, max) => {
29
6
  }
30
7
  return Math.min(max, Math.max(min, value));
31
8
  };
9
+ export {
10
+ clamp
11
+ };
@@ -1,37 +1,17 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var classnames_exports = {};
20
- __export(classnames_exports, {
21
- classnames: () => classnames
22
- });
23
- module.exports = __toCommonJS(classnames_exports);
24
- var import_lodash_es = require("lodash-es");
1
+ import { isBoolean, isString } from "lodash-es";
25
2
  const add = (a, b) => a ? a + " " + b : b;
26
3
  const classnames = (...list) => list.reduce((caches, data) => {
27
- if ((0, import_lodash_es.isString)(data)) {
4
+ if (isString(data)) {
28
5
  data && (caches = add(caches, data));
29
6
  } else if (Array.isArray(data)) {
30
- data.forEach((value) => value && (0, import_lodash_es.isString)(value) && (caches = add(caches, value)));
31
- } else if (!(0, import_lodash_es.isBoolean)(data)) {
7
+ data.forEach((value) => value && isString(value) && (caches = add(caches, value)));
8
+ } else if (!isBoolean(data)) {
32
9
  for (const key in data) {
33
10
  key && data[key] && (caches = add(caches, key));
34
11
  }
35
12
  }
36
13
  return caches;
37
14
  }, "");
15
+ export {
16
+ classnames
17
+ };
@@ -1,26 +1,3 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var version_exports = {};
20
- __export(version_exports, {
21
- compareVersion: () => compareVersion
22
- });
23
- module.exports = __toCommonJS(version_exports);
24
1
  const CHAR = ".";
25
2
  const compareVersion = (from, to) => {
26
3
  const froms = from.split(CHAR);
@@ -33,3 +10,6 @@ const compareVersion = (from, to) => {
33
10
  }
34
11
  return 0;
35
12
  };
13
+ export {
14
+ compareVersion
15
+ };
@@ -1,27 +1,4 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var weak_equal_exports = {};
20
- __export(weak_equal_exports, {
21
- deepWeakEqual: () => deepWeakEqual
22
- });
23
- module.exports = __toCommonJS(weak_equal_exports);
24
- var import_strings = require("../convert/strings");
1
+ import { hash8strings } from "../convert/strings";
25
2
  const deepWeakEqual = (from, to, exclude) => {
26
3
  if (typeof from !== "object" || from === null || typeof to !== "object" || to === null) return from === to;
27
4
  if (Array.isArray(from) && Array.isArray(to)) {
@@ -33,7 +10,7 @@ const deepWeakEqual = (from, to, exclude) => {
33
10
  });
34
11
  } else {
35
12
  const caches = {};
36
- const excludeCaches = exclude && (0, import_strings.hash8strings)(exclude);
13
+ const excludeCaches = exclude && hash8strings(exclude);
37
14
  for (const key in from) {
38
15
  if (excludeCaches && key in excludeCaches) continue;
39
16
  if (!deepWeakEqual(from[key], to[key])) {
@@ -51,3 +28,6 @@ const deepWeakEqual = (from, to, exclude) => {
51
28
  }
52
29
  return true;
53
30
  };
31
+ export {
32
+ deepWeakEqual
33
+ };
@@ -1,27 +1,7 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var json_exports = {};
20
- __export(json_exports, {
21
- hash8json: () => hash8json
22
- });
23
- module.exports = __toCommonJS(json_exports);
24
1
  const hash8json = (list, key) => list.reduce((caches, data) => {
25
2
  caches[data[key]] = data;
26
3
  return caches;
27
4
  }, {});
5
+ export {
6
+ hash8json
7
+ };
@@ -1,27 +1,7 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var object_exports = {};
20
- __export(object_exports, {
21
- hash8object: () => hash8object
22
- });
23
- module.exports = __toCommonJS(object_exports);
24
1
  const hash8object = (list, key) => list.reduce((caches, data) => {
25
2
  caches.set(data[key], data);
26
3
  return caches;
27
4
  }, /* @__PURE__ */ new Map());
5
+ export {
6
+ hash8object
7
+ };
@@ -1,27 +1,7 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var strings_exports = {};
20
- __export(strings_exports, {
21
- hash8strings: () => hash8strings
22
- });
23
- module.exports = __toCommonJS(strings_exports);
24
1
  const hash8strings = (list) => list.reduce((caches, data, index) => {
25
2
  caches[data] = index;
26
3
  return caches;
27
4
  }, {});
5
+ export {
6
+ hash8strings
7
+ };
package/dist/desens.js CHANGED
@@ -1,29 +1,4 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var desens_exports = {};
20
- __export(desens_exports, {
21
- desensDecrypt: () => desensDecrypt,
22
- desensEncrypt: () => desensEncrypt,
23
- desensReplace: () => desensReplace
24
- });
25
- module.exports = __toCommonJS(desens_exports);
26
- var import_lodash_es = require("lodash-es");
1
+ import { isString } from "lodash-es";
27
2
  const desensEncrypt = (plaintext, encrypt) => {
28
3
  const rules = [];
29
4
  let point = -1;
@@ -62,10 +37,15 @@ const desensReplace = (ciphertext, rules, replacer = "*") => {
62
37
  return rules.reduce((cache, { range: [start, stop], modify }) => {
63
38
  const part = ciphertext.slice(start + offset, start + offset + modify);
64
39
  const size = stop + 1 - start;
65
- const replaceValue = (0, import_lodash_es.isString)(replacer) ? replacer.repeat(size) : replacer[Symbol.replace](part, size);
40
+ const replaceValue = isString(replacer) ? replacer.repeat(size) : replacer[Symbol.replace](part, size);
66
41
  cache += ciphertext.slice(from, start + offset) + replaceValue;
67
42
  from = start + offset + modify;
68
43
  offset += modify - size;
69
44
  return cache;
70
45
  }, "") + ciphertext.slice(from);
71
46
  };
47
+ export {
48
+ desensDecrypt,
49
+ desensEncrypt,
50
+ desensReplace
51
+ };
package/dist/encoding.js CHANGED
@@ -1,26 +1,3 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var encoding_exports = {};
20
- __export(encoding_exports, {
21
- getEncoding: () => getEncoding
22
- });
23
- module.exports = __toCommonJS(encoding_exports);
24
1
  const utf8_first_prefix = /^1{2,}/g;
25
2
  const utf8_other_prefix = /^10/;
26
3
  const Encodes = {
@@ -74,3 +51,6 @@ const getEncoding = (uint, limit = 1024) => {
74
51
  }
75
52
  return { encoding, offset };
76
53
  };
54
+ export {
55
+ getEncoding
56
+ };