dgeoutils 2.2.11 → 2.2.12
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/dist/DPoint.js +3 -3
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +3 -1
- package/package.json +1 -1
package/dist/DPoint.js
CHANGED
|
@@ -189,20 +189,20 @@ class DPoint {
|
|
|
189
189
|
if (x instanceof DPoint) {
|
|
190
190
|
xV = this.x + x.x;
|
|
191
191
|
yV = this.y + x.y;
|
|
192
|
-
if (this.z && x.z) {
|
|
192
|
+
if ((0, utils_1.isDefAndNotNull)(this.z) && (0, utils_1.isDefAndNotNull)(x.z)) {
|
|
193
193
|
zV = this.z + x.z;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
else {
|
|
197
197
|
xV = this.x + x;
|
|
198
198
|
yV = this.y + y;
|
|
199
|
-
if (this.z && z) {
|
|
199
|
+
if ((0, utils_1.isDefAndNotNull)(this.z) && (0, utils_1.isDefAndNotNull)(z)) {
|
|
200
200
|
zV = this.z + z;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
this.x = xV;
|
|
204
204
|
this.y = yV;
|
|
205
|
-
if (zV) {
|
|
205
|
+
if ((0, utils_1.isDefAndNotNull)(zV)) {
|
|
206
206
|
this.z = zV;
|
|
207
207
|
}
|
|
208
208
|
return this;
|
package/dist/utils.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export declare const checkFunction: (funcName: string) => CheckFunction;
|
|
|
15
15
|
export declare const createArray: (v: number) => number[];
|
|
16
16
|
export declare const createMatrix: ({ h, w }: DPoint) => number[][];
|
|
17
17
|
export declare const gaussianElimination: (matrix: number[][]) => number[];
|
|
18
|
+
export declare const isDefAndNotNull: (a: any) => boolean;
|
|
18
19
|
export {};
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gaussianElimination = exports.createMatrix = exports.createArray = exports.checkFunction = exports.warn = void 0;
|
|
3
|
+
exports.isDefAndNotNull = exports.gaussianElimination = exports.createMatrix = exports.createArray = exports.checkFunction = exports.warn = void 0;
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
const DPoint_1 = require("./DPoint");
|
|
6
6
|
const warn = (...args) => {
|
|
@@ -111,3 +111,5 @@ const gaussianElimination = (matrix) => {
|
|
|
111
111
|
return answer;
|
|
112
112
|
};
|
|
113
113
|
exports.gaussianElimination = gaussianElimination;
|
|
114
|
+
const isDefAndNotNull = (a) => a != undefined;
|
|
115
|
+
exports.isDefAndNotNull = isDefAndNotNull;
|