@visactor/vutils 0.19.6 → 1.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 (49) hide show
  1. package/cjs/common/ascending.js +2 -1
  2. package/cjs/common/cloneDeep.js +1 -2
  3. package/cjs/common/interpolate.js +2 -1
  4. package/cjs/common/isEmpty.js +1 -2
  5. package/cjs/common/isObjectLike.js +1 -1
  6. package/cjs/common/isPlainObject.js +1 -1
  7. package/cjs/common/isPrototype.js +2 -1
  8. package/cjs/common/isRegExp.js +1 -1
  9. package/cjs/common/isShallowEqual.js +1 -1
  10. package/cjs/common/isString.js +1 -1
  11. package/cjs/common/isType.js +1 -1
  12. package/cjs/common/isUndefined.js +1 -1
  13. package/cjs/common/isValid.js +1 -1
  14. package/cjs/common/isValidNumber.js +1 -1
  15. package/cjs/data-structure/bounds.js +1 -1
  16. package/cjs/data-structure/hashTable.js +1 -1
  17. package/cjs/data-structure/index.js +1 -1
  18. package/cjs/data-structure/matrix.js +1 -1
  19. package/cjs/data-structure/point.js +1 -1
  20. package/cjs/fmin/blas1.js +1 -1
  21. package/cjs/fmin/conjugate-gradient.js +1 -1
  22. package/cjs/fmin/index.js +1 -1
  23. package/cjs/fmin/linesearch.js +1 -2
  24. package/cjs/fmin/nelder-mead.js +1 -1
  25. package/es/common/ascending.js +2 -1
  26. package/es/common/cloneDeep.js +1 -2
  27. package/es/common/interpolate.js +2 -1
  28. package/es/common/isEmpty.js +1 -2
  29. package/es/common/isObjectLike.js +1 -1
  30. package/es/common/isPlainObject.js +1 -1
  31. package/es/common/isPrototype.js +2 -1
  32. package/es/common/isRegExp.js +1 -1
  33. package/es/common/isShallowEqual.js +1 -1
  34. package/es/common/isString.js +1 -1
  35. package/es/common/isType.js +1 -1
  36. package/es/common/isUndefined.js +1 -1
  37. package/es/common/isValid.js +1 -1
  38. package/es/common/isValidNumber.js +1 -1
  39. package/es/data-structure/bounds.js +1 -1
  40. package/es/data-structure/hashTable.js +1 -1
  41. package/es/data-structure/index.js +1 -1
  42. package/es/data-structure/matrix.js +1 -1
  43. package/es/data-structure/point.js +1 -1
  44. package/es/fmin/blas1.js +1 -1
  45. package/es/fmin/conjugate-gradient.js +1 -1
  46. package/es/fmin/index.js +1 -1
  47. package/es/fmin/linesearch.js +1 -2
  48. package/es/fmin/nelder-mead.js +1 -1
  49. package/package.json +17 -17
@@ -6,4 +6,5 @@ function ascending(a, b) {
6
6
 
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: !0
9
- }), exports.ascending = void 0, exports.ascending = ascending;
9
+ }), exports.ascending = void 0, exports.ascending = ascending;
10
+ //# sourceMappingURL=ascending.js.map
@@ -27,5 +27,4 @@ function cloneDeep(value, ignoreWhen, excludeKeys) {
27
27
  return result;
28
28
  }
29
29
 
30
- exports.default = cloneDeep;
31
- //# sourceMappingURL=cloneDeep.js.map
30
+ exports.default = cloneDeep;
@@ -51,4 +51,5 @@ function interpolateString(a, b) {
51
51
  });
52
52
  }
53
53
 
54
- exports.interpolateString = interpolateString;
54
+ exports.interpolateString = interpolateString;
55
+ //# sourceMappingURL=interpolate.js.map
@@ -22,5 +22,4 @@ function isEmpty(value) {
22
22
  return !0;
23
23
  }
24
24
 
25
- exports.default = isEmpty;
26
- //# sourceMappingURL=isEmpty.js.map
25
+ exports.default = isEmpty;
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const isObjectLike = value => "object" == typeof value && null !== value;
8
8
 
9
9
  exports.default = isObjectLike;
10
- //# sourceMappingURL=isObjectLike.js.map
10
+ //# sourceMappingURL=isObjectLike.js.map
@@ -19,4 +19,4 @@ const isObjectLike_1 = __importDefault(require("./isObjectLike")), isType_1 = __
19
19
  };
20
20
 
21
21
  exports.default = isPlainObject;
22
- //# sourceMappingURL=isPlainObject.js.map
22
+ //# sourceMappingURL=isPlainObject.js.map
@@ -9,4 +9,5 @@ const objectProto = Object.prototype, isPrototype = function(value) {
9
9
  return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
10
10
  };
11
11
 
12
- exports.default = isPrototype;
12
+ exports.default = isPrototype;
13
+ //# sourceMappingURL=isPrototype.js.map
@@ -13,4 +13,4 @@ Object.defineProperty(exports, "__esModule", {
13
13
  const isType_1 = __importDefault(require("./isType")), isRegExp = value => (0, isType_1.default)(value, "RegExp");
14
14
 
15
15
  exports.default = isRegExp;
16
- //# sourceMappingURL=isRegExp.js.map
16
+ //# sourceMappingURL=isRegExp.js.map
@@ -31,4 +31,4 @@ function isShallowEqual(objA, objB) {
31
31
  }
32
32
 
33
33
  exports.isShallowEqual = isShallowEqual;
34
- //# sourceMappingURL=isShallowEqual.js.map
34
+ //# sourceMappingURL=isShallowEqual.js.map
@@ -16,4 +16,4 @@ const isType_1 = __importDefault(require("./isType")), isString = (value, fuzzy
16
16
  };
17
17
 
18
18
  exports.default = isString;
19
- //# sourceMappingURL=isString.js.map
19
+ //# sourceMappingURL=isString.js.map
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
8
8
 
9
9
  exports.default = isType;
10
- //# sourceMappingURL=isType.js.map
10
+ //# sourceMappingURL=isType.js.map
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const isUndefined = value => void 0 === value;
8
8
 
9
9
  exports.default = isUndefined;
10
- //# sourceMappingURL=isUndefined.js.map
10
+ //# sourceMappingURL=isUndefined.js.map
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const isValid = value => null != value;
8
8
 
9
9
  exports.default = isValid;
10
- //# sourceMappingURL=isValid.js.map
10
+ //# sourceMappingURL=isValid.js.map
@@ -14,4 +14,4 @@ const isNumber_1 = __importDefault(require("./isNumber")), isValidNumber = value
14
14
  isNumber_1.default)(value) && Number.isFinite(value);
15
15
 
16
16
  exports.default = isValidNumber;
17
- //# sourceMappingURL=isValidNumber.js.map
17
+ //# sourceMappingURL=isValidNumber.js.map
@@ -169,4 +169,4 @@ class OBBBounds extends Bounds {
169
169
  }
170
170
 
171
171
  exports.OBBBounds = OBBBounds;
172
- //# sourceMappingURL=bounds.js.map
172
+ //# sourceMappingURL=bounds.js.map
@@ -112,4 +112,4 @@ class HashTable {
112
112
  }
113
113
 
114
114
  exports.HashTable = HashTable;
115
- //# sourceMappingURL=hashTable.js.map
115
+ //# sourceMappingURL=hashTable.js.map
@@ -19,4 +19,4 @@ Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./hashTable"), exports), __exportStar(require("./point"), exports),
21
21
  __exportStar(require("./bounds"), exports), __exportStar(require("./matrix"), exports);
22
- //# sourceMappingURL=index.js.map
22
+ //# sourceMappingURL=index.js.map
@@ -110,4 +110,4 @@ function normalTransform(out, origin, x, y, scaleX, scaleY, angle, rotateCenter)
110
110
  }
111
111
 
112
112
  exports.Matrix = Matrix, exports.normalTransform = normalTransform;
113
- //# sourceMappingURL=matrix.js.map
113
+ //# sourceMappingURL=matrix.js.map
@@ -78,4 +78,4 @@ class PolarPoint {
78
78
  }
79
79
 
80
80
  exports.PolarPoint = PolarPoint;
81
- //# sourceMappingURL=point.js.map
81
+ //# sourceMappingURL=point.js.map
package/cjs/fmin/blas1.js CHANGED
@@ -36,4 +36,4 @@ function gemv(output, A, x) {
36
36
 
37
37
  exports.zeros = zeros, exports.zerosM = zerosM, exports.norm2 = norm2, exports.scale = scale,
38
38
  exports.weightedSum = weightedSum, exports.gemv = gemv;
39
- //# sourceMappingURL=blas1.js.map
39
+ //# sourceMappingURL=blas1.js.map
@@ -46,4 +46,4 @@ function conjugateGradient(f, initial, params) {
46
46
  }
47
47
 
48
48
  exports.conjugateGradient = conjugateGradient;
49
- //# sourceMappingURL=conjugate-gradient.js.map
49
+ //# sourceMappingURL=conjugate-gradient.js.map
package/cjs/fmin/index.js CHANGED
@@ -19,4 +19,4 @@ Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./blas1"), exports), __exportStar(require("./nelder-mead"), exports),
21
21
  __exportStar(require("./conjugate-gradient"), exports);
22
- //# sourceMappingURL=index.js.map
22
+ //# sourceMappingURL=index.js.map
@@ -29,5 +29,4 @@ function wolfeLineSearch(f, pk, current, next, a, c1, c2) {
29
29
  return a;
30
30
  }
31
31
 
32
- exports.wolfeLineSearch = wolfeLineSearch;
33
- //# sourceMappingURL=linesearch.js.map
32
+ exports.wolfeLineSearch = wolfeLineSearch;
@@ -67,4 +67,4 @@ function nelderMead(f, x0, parameters) {
67
67
  }
68
68
 
69
69
  exports.nelderMead = nelderMead;
70
- //# sourceMappingURL=nelder-mead.js.map
70
+ //# sourceMappingURL=nelder-mead.js.map
@@ -1,3 +1,4 @@
1
1
  export function ascending(a, b) {
2
2
  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
3
- }
3
+ }
4
+ //# sourceMappingURL=ascending.js.map
@@ -22,5 +22,4 @@ export default function cloneDeep(value, ignoreWhen, excludeKeys) {
22
22
  excludeKeys && excludeKeys.includes(key.toString()) ? result[key] = subValue : result[key] = cloneDeep(subValue, ignoreWhen, excludeKeys);
23
23
  }
24
24
  return result;
25
- }
26
- //# sourceMappingURL=cloneDeep.js.map
25
+ }
@@ -41,4 +41,5 @@ export function interpolateString(a, b) {
41
41
  for (let o, i = 0; i < b; ++i) s[(o = q[i]).i] = o.x(t);
42
42
  return s.join("");
43
43
  });
44
- }
44
+ }
45
+ //# sourceMappingURL=interpolate.js.map
@@ -18,5 +18,4 @@ function isEmpty(value) {
18
18
  return !0;
19
19
  }
20
20
 
21
- export default isEmpty;
22
- //# sourceMappingURL=isEmpty.js.map
21
+ export default isEmpty;
@@ -1,4 +1,4 @@
1
1
  const isObjectLike = value => "object" == typeof value && null !== value;
2
2
 
3
3
  export default isObjectLike;
4
- //# sourceMappingURL=isObjectLike.js.map
4
+ //# sourceMappingURL=isObjectLike.js.map
@@ -11,4 +11,4 @@ const isPlainObject = function(value) {
11
11
  };
12
12
 
13
13
  export default isPlainObject;
14
- //# sourceMappingURL=isPlainObject.js.map
14
+ //# sourceMappingURL=isPlainObject.js.map
@@ -3,4 +3,5 @@ const objectProto = Object.prototype, isPrototype = function(value) {
3
3
  return value === ("function" == typeof Ctor && Ctor.prototype || objectProto);
4
4
  };
5
5
 
6
- export default isPrototype;
6
+ export default isPrototype;
7
+ //# sourceMappingURL=isPrototype.js.map
@@ -3,4 +3,4 @@ import isType from "./isType";
3
3
  const isRegExp = value => isType(value, "RegExp");
4
4
 
5
5
  export default isRegExp;
6
- //# sourceMappingURL=isRegExp.js.map
6
+ //# sourceMappingURL=isRegExp.js.map
@@ -19,4 +19,4 @@ export function isShallowEqual(objA, objB) {
19
19
  return Object.keys(objA).forEach((k => !!is(objA[k], objB[k]) || (ret = !1, ret))),
20
20
  ret;
21
21
  }
22
- //# sourceMappingURL=isShallowEqual.js.map
22
+ //# sourceMappingURL=isShallowEqual.js.map
@@ -6,4 +6,4 @@ const isString = (value, fuzzy = !1) => {
6
6
  };
7
7
 
8
8
  export default isString;
9
- //# sourceMappingURL=isString.js.map
9
+ //# sourceMappingURL=isString.js.map
@@ -1,4 +1,4 @@
1
1
  const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
2
2
 
3
3
  export default isType;
4
- //# sourceMappingURL=isType.js.map
4
+ //# sourceMappingURL=isType.js.map
@@ -1,4 +1,4 @@
1
1
  const isUndefined = value => void 0 === value;
2
2
 
3
3
  export default isUndefined;
4
- //# sourceMappingURL=isUndefined.js.map
4
+ //# sourceMappingURL=isUndefined.js.map
@@ -1,4 +1,4 @@
1
1
  const isValid = value => null != value;
2
2
 
3
3
  export default isValid;
4
- //# sourceMappingURL=isValid.js.map
4
+ //# sourceMappingURL=isValid.js.map
@@ -3,4 +3,4 @@ import isNumber from "./isNumber";
3
3
  const isValidNumber = value => isNumber(value) && Number.isFinite(value);
4
4
 
5
5
  export default isValidNumber;
6
- //# sourceMappingURL=isValidNumber.js.map
6
+ //# sourceMappingURL=isValidNumber.js.map
@@ -159,4 +159,4 @@ export class OBBBounds extends Bounds {
159
159
  }, this.angle, originPoint) ];
160
160
  }
161
161
  }
162
- //# sourceMappingURL=bounds.js.map
162
+ //# sourceMappingURL=bounds.js.map
@@ -102,4 +102,4 @@ export class HashTable {
102
102
  }
103
103
  toImmutableMap() {}
104
104
  }
105
- //# sourceMappingURL=hashTable.js.map
105
+ //# sourceMappingURL=hashTable.js.map
@@ -5,4 +5,4 @@ export * from "./point";
5
5
  export * from "./bounds";
6
6
 
7
7
  export * from "./matrix";
8
- //# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
@@ -103,4 +103,4 @@ export function normalTransform(out, origin, x, y, scaleX, scaleY, angle, rotate
103
103
  out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY,
104
104
  out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;
105
105
  }
106
- //# sourceMappingURL=matrix.js.map
106
+ //# sourceMappingURL=matrix.js.map
@@ -62,4 +62,4 @@ export class PolarPoint {
62
62
  return this.r = r, this.theta = theta, this;
63
63
  }
64
64
  }
65
- //# sourceMappingURL=point.js.map
65
+ //# sourceMappingURL=point.js.map
package/es/fmin/blas1.js CHANGED
@@ -27,4 +27,4 @@ export function weightedSum(ret, w1, v1, w2, v2) {
27
27
  export function gemv(output, A, x) {
28
28
  for (let i = 0; i < output.length; ++i) output[i] = dotProduct(A[i], x);
29
29
  }
30
- //# sourceMappingURL=blas1.js.map
30
+ //# sourceMappingURL=blas1.js.map
@@ -40,4 +40,4 @@ export function conjugateGradient(f, initial, params) {
40
40
  alpha: a
41
41
  }), current;
42
42
  }
43
- //# sourceMappingURL=conjugate-gradient.js.map
43
+ //# sourceMappingURL=conjugate-gradient.js.map
package/es/fmin/index.js CHANGED
@@ -3,4 +3,4 @@ export * from "./blas1";
3
3
  export * from "./nelder-mead";
4
4
 
5
5
  export * from "./conjugate-gradient";
6
- //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -23,5 +23,4 @@ export function wolfeLineSearch(f, pk, current, next, a, c1, c2) {
23
23
  phi_old = phi, a0 = a, a *= 2;
24
24
  }
25
25
  return a;
26
- }
27
- //# sourceMappingURL=linesearch.js.map
26
+ }
@@ -59,4 +59,4 @@ export function nelderMead(f, x0, parameters) {
59
59
  x: simplex[0]
60
60
  };
61
61
  }
62
- //# sourceMappingURL=nelder-mead.js.map
62
+ //# sourceMappingURL=nelder-mead.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vutils",
3
- "version": "0.19.6",
3
+ "version": "1.0.0",
4
4
  "main": "cjs/index.js",
5
5
  "module": "es/index.js",
6
6
  "types": "es/index.d.ts",
@@ -20,20 +20,30 @@
20
20
  "utility"
21
21
  ],
22
22
  "sideEffects": false,
23
+ "scripts": {
24
+ "compile": "tsc --noEmit",
25
+ "eslint": "eslint --debug --fix src/",
26
+ "build": "bundle",
27
+ "dev": "bundle --clean -f es -w",
28
+ "start": "vite ./vite",
29
+ "test": "jest",
30
+ "test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand",
31
+ "test-cov": "jest -w 16 --coverage"
32
+ },
23
33
  "devDependencies": {
34
+ "@internal/bundler": "0.0.1",
35
+ "@internal/eslint-config": "0.0.1",
36
+ "@internal/ts-config": "0.0.1",
24
37
  "@rushstack/eslint-patch": "~1.1.4",
25
38
  "eslint": "~8.18.0",
26
39
  "vite": "3.2.6",
40
+ "@internal/jest-config": "0.0.1",
27
41
  "jest": "~29.5.0",
28
42
  "@jest/globals": "~29.5.0",
29
43
  "ts-jest": "~29.1.0",
30
44
  "@types/jest": "~29.5.0",
31
45
  "typescript": "4.9.5",
32
- "@types/node": "*",
33
- "@internal/eslint-config": "0.0.1",
34
- "@internal/ts-config": "0.0.1",
35
- "@internal/jest-config": "0.0.1",
36
- "@internal/bundler": "0.0.1"
46
+ "@types/node": "*"
37
47
  },
38
48
  "dependencies": {
39
49
  "eventemitter3": "^4.0.7",
@@ -42,15 +52,5 @@
42
52
  },
43
53
  "publishConfig": {
44
54
  "access": "public"
45
- },
46
- "scripts": {
47
- "compile": "tsc --noEmit",
48
- "eslint": "eslint --debug --fix src/",
49
- "build": "bundle",
50
- "dev": "bundle --clean -f es -w",
51
- "start": "vite ./vite",
52
- "test": "jest",
53
- "test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand",
54
- "test-cov": "jest -w 16 --coverage"
55
55
  }
56
- }
56
+ }