Skip to content

Commit 07d7fcd

Browse files
committed
chore: upgrade dependency
1 parent 82107d8 commit 07d7fcd

File tree

18 files changed

+625
-415
lines changed

18 files changed

+625
-415
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
},
2222

2323
rules: {
24+
'@typescript-eslint/ban-ts-comment': 'off',
2425
'@typescript-eslint/no-non-null-assertion': 'off',
2526
'@typescript-eslint/ban-ts-ignore': 'off',
2627
'@typescript-eslint/member-delimiter-style': 'off',

dist/index.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ PERFORMANCE OF THIS SOFTWARE.
2323
var extendStatics = function(d, b) {
2424
extendStatics = Object.setPrototypeOf ||
2525
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
26+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2727
return extendStatics(d, b);
2828
};
2929

3030
function __extends(d, b) {
31+
if (typeof b !== "function" && b !== null)
32+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3133
extendStatics(d, b);
3234
function __() { this.constructor = d; }
3335
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -89,12 +91,10 @@ function __generator(thisArg, body) {
8991
}
9092
}
9193

92-
function __spreadArrays() {
93-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
94-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
95-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
96-
r[k] = a[j];
97-
return r;
94+
function __spreadArray(to, from) {
95+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
96+
to[j] = from[i];
97+
return to;
9898
}
9999

100100
var Status;
@@ -119,6 +119,7 @@ function deepClone(obj, cache) {
119119
Object.keys(obj).forEach(function (key) { return (clone[key] = deepClone(obj[key], cache)); });
120120
return clone;
121121
}
122+
// eslint-disable-next-line
122123
function debounce(callback, delay) {
123124
var _this = this;
124125
if (delay === void 0) { delay = 0; }
@@ -132,7 +133,7 @@ function debounce(callback, delay) {
132133
clearTimeout(timer);
133134
timer = window.setTimeout(function () {
134135
// @ts-ignore
135-
callback.call.apply(callback, __spreadArrays([_this], args));
136+
callback.call.apply(callback, __spreadArray([_this], args));
136137
}, delay);
137138
};
138139
}
@@ -349,7 +350,7 @@ var CRender = /** @class */ (function () {
349350
CRender.prototype.delGraph = function (graph, wait) {
350351
if (wait === void 0) { wait = false; }
351352
if (Array.isArray(graph)) {
352-
__spreadArrays(graph).forEach(this.graphDelProcessor);
353+
__spreadArray([], graph).forEach(this.graphDelProcessor);
353354
}
354355
else {
355356
this.graphDelProcessor(graph);
@@ -412,7 +413,7 @@ var CRender = /** @class */ (function () {
412413
var key = _a.key, frameState = _a.frameState;
413414
Object.assign(graph[key], frameState.shift());
414415
if (frameState.length) {
415-
return __spreadArrays(queue, [{ key: key, frameState: frameState }]);
416+
return __spreadArray(__spreadArray([], queue, true), [{ key: key, frameState: frameState }]);
416417
}
417418
else {
418419
return queue;
@@ -508,7 +509,7 @@ var CRender = /** @class */ (function () {
508509
point = getTranslatePointPos(translate.map(function (v) { return v * -1; }), point);
509510
}
510511
if (hoverRect)
511-
return checkPointIsInRect.apply(void 0, __spreadArrays([point], hoverRect));
512+
return checkPointIsInRect.apply(void 0, __spreadArray([point], hoverRect));
512513
return graph.hoverCheck(point);
513514
};
514515
/**
@@ -558,7 +559,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
558559
See the Apache Version 2.0 License for specific language governing permissions
559560
and limitations under the License.
560561
***************************************************************************** */
561-
function __spreadArrays$1() {
562+
function __spreadArrays() {
562563
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
563564

564565
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
@@ -837,7 +838,7 @@ function getOpacity(color) {
837838

838839
function getRgbaValue(color) {
839840
var rgbValue = getRgbValue(color);
840-
return rgbValue && __spreadArrays$1(rgbValue, [getOpacity(color)]);
841+
return rgbValue && __spreadArrays(rgbValue, [getOpacity(color)]);
841842
}
842843
/**
843844
* @description Get Color from Rgb|Rgba value
@@ -864,7 +865,7 @@ function transformColor(reverse) {
864865
if (isString && reverse)
865866
return color;
866867
if (isArray && !reverse)
867-
return __spreadArrays(color);
868+
return __spreadArray([], color);
868869
if (isString && !reverse)
869870
return getRgbaValue(color);
870871
if (isArray && reverse)
@@ -874,7 +875,7 @@ function transformColor(reverse) {
874875
}
875876
function getCtxRealColorWithOpacity(opacity) {
876877
return function (color) {
877-
var _color = __spreadArrays(color);
878+
var _color = __spreadArray([], color);
878879
_color[3] *= opacity;
879880
return getColorFromRgbValue(_color);
880881
};
@@ -1746,6 +1747,7 @@ var Graph = /** @class */ (function () {
17461747
// @ts-ignore
17471748
var Constructor = this.__proto__.constructor;
17481749
var config = __assign({}, this);
1750+
// @ts-ignore
17491751
delete config.render;
17501752
var graph = new Constructor(config);
17511753
if (add)
@@ -1870,7 +1872,7 @@ function checkPointIsNearPolyline(point, polyline, lineWidth) {
18701872
var x = _a[0], y = _a[1];
18711873
return [x, y + halfLineWidth];
18721874
});
1873-
var polygon = __spreadArrays(moveUpPolyline, moveDownPolyline.reverse());
1875+
var polygon = __spreadArray(__spreadArray([], moveUpPolyline, true), moveDownPolyline.reverse());
18741876
return checkPointIsInPolygon(point, polygon);
18751877
}
18761878
/**
@@ -1998,7 +2000,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
19982000
See the Apache Version 2.0 License for specific language governing permissions
19992001
and limitations under the License.
20002002
***************************************************************************** */
2001-
function __spreadArrays$2() {
2003+
function __spreadArrays$1() {
20022004
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
20032005

20042006
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
@@ -2044,7 +2046,7 @@ function getTwoPointDistance$1(_a, _b) {
20442046

20452047
function flatten(input) {
20462048
return input.reduce(function (_, __) {
2047-
return __spreadArrays$2(_, __);
2049+
return __spreadArrays$1(_, __);
20482050
}, []);
20492051
}
20502052
/**
@@ -2080,7 +2082,7 @@ function createGetSegmentTPointFuns(bezierCurve) {
20802082
var startPoint = getBezierCurveStartPoint(bezierCurve);
20812083
return segments.map(function (segment, i) {
20822084
var beginPoint = i === 0 ? startPoint : segments[i - 1][2];
2083-
return createGetBezierCurveTPointFun.apply(void 0, __spreadArrays$2([beginPoint], segment));
2085+
return createGetBezierCurveTPointFun.apply(void 0, __spreadArrays$1([beginPoint], segment));
20842086
});
20852087
}
20862088

@@ -2355,7 +2357,7 @@ function polylineToBezierCurve(polyline, close, offsetA, offsetB) {
23552357
var startPoint = polyline[0];
23562358
var bezierCurveLineNum = polyline.length - 1;
23572359
var bezierCurvePoints = new Array(bezierCurveLineNum).fill(0).map(function (_, i) {
2358-
return __spreadArrays$2(getBezierCurveLineControlPoints(polyline, i, close, offsetA, offsetB), [polyline[i + 1]]);
2360+
return __spreadArrays$1(getBezierCurveLineControlPoints(polyline, i, close, offsetA, offsetB), [polyline[i + 1]]);
23592361
});
23602362
if (close) closeBezierCurve(bezierCurvePoints, startPoint);
23612363
bezierCurvePoints.unshift(polyline[0]);
@@ -2421,7 +2423,7 @@ var BezierCurve = /** @class */ (function (_super) {
24212423
var _b = this, points = _b.shape.points, cache = _b.cache;
24222424
var _c = points[0], fx = _c[0], fy = _c[1];
24232425
var curves = points.slice(1);
2424-
var bezierCurvePoints = __spreadArrays([
2426+
var bezierCurvePoints = __spreadArray([
24252427
[fx + movementX, fy + movementY]
24262428
], curves.map(function (curve) {
24272429
return curve.map(function (_a) {
@@ -2873,7 +2875,7 @@ var Smoothline = /** @class */ (function (_super) {
28732875
cache.points = moveAfterPoints;
28742876
var _c = cache.bezierCurve[0], fx = _c[0], fy = _c[1];
28752877
var curves = cache.bezierCurve.slice(1);
2876-
cache.bezierCurve = __spreadArrays([
2878+
cache.bezierCurve = __spreadArray([
28772879
[fx + movementX, fy + movementY]
28782880
], curves.map(function (curve) {
28792881
return curve.map(function (_a) {
@@ -2971,7 +2973,7 @@ var Text = /** @class */ (function (_super) {
29712973
};
29722974
Text.prototype.setGraphCenter = function () {
29732975
var _a = this, position = _a.shape.position, style = _a.style;
2974-
style.graphCenter = __spreadArrays(position);
2976+
style.graphCenter = __spreadArray([], position);
29752977
};
29762978
Text.prototype.move = function (_a) {
29772979
var movementX = _a.movementX, movementY = _a.movementY;

dist/index.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

es/core/crender.class.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ var CRender = (_class = (_temp = /*#__PURE__*/function () {
209209
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
210210

211211
if (Array.isArray(graph)) {
212+
// eslint-disable-next-line
212213
;
213214

214215
_toConsumableArray(graph).forEach(this.graphDelProcessor);

es/core/graph.class.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ var Graph = /*#__PURE__*/function () {
424424

425425
var Constructor = this.__proto__.constructor;
426426

427-
var config = _objectSpread({}, this);
427+
var config = _objectSpread({}, this); // @ts-ignore
428+
428429

429430
delete config.render;
430431
var graph = new Constructor(config);

es/index.mjs

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

es/types/common.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export declare type LiteralUnion<T extends U, U> = T | (U & {});
2-
export declare type UnFunctionParams<T> = T extends (params: infer U) => any ? U : any[];
1+
/// <reference types="offscreencanvas" />
2+
export declare type GetFunctionParams<T> = T extends (...params: infer U) => any ? U : any[];
33
export declare type CanvasCtx = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;

es/types/core/graph.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ export declare type GraphConfig<Shape = any> = {
5858
/**
5959
* @description Mouse enter event handler
6060
*/
61-
onMouseEnter?: Function;
61+
onMouseEnter?: () => void;
6262
/**
6363
* @description Mouse outer event handler
6464
*/
65-
onMouseOuter?: Function;
65+
onMouseOuter?: () => void;
6666
/**
6767
* @description Mouse click event handler
6868
*/
69-
onClick?: Function;
69+
onClick?: () => void;
7070
/**
7171
* @description Funciton of draw graph
7272
*/
73-
draw?: Function;
73+
draw?: () => void;
7474
/**
7575
* @description Function of set Graph center
7676
*/

es/utils/common.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
import { GetFunctionParams } from '../types/common';
12
export declare function deepClone<T = any>(obj: T, cache?: Map<any, any>): T;
2-
export declare function debounce<T extends Function>(callback: T, delay?: number): Function;
3+
export declare function debounce<T extends (...params: any) => any>(callback: T, delay?: number): (...args: GetFunctionParams<T>) => void;

es/utils/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export function deepClone(obj) {
1212
return clone[key] = deepClone(obj[key], cache);
1313
});
1414
return clone;
15-
}
15+
} // eslint-disable-next-line
16+
1617
export function debounce(callback) {
1718
var _this = this;
1819

0 commit comments

Comments
 (0)