deeptwins-cesium-engine 0.0.39 → 0.0.40
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/Build/Workers/chunk-22YARAUJ.js +629 -0
- package/Build/Workers/chunk-2HVM4MOI.js +220 -0
- package/Build/Workers/chunk-2PWEYBYR.js +75 -0
- package/Build/Workers/chunk-2ZI2BRKI.js +37 -0
- package/Build/Workers/chunk-3Q6HPHTH.js +684 -0
- package/Build/Workers/chunk-4LE3SGQH.js +634 -0
- package/Build/Workers/chunk-5IBSBFAA.js +287 -0
- package/Build/Workers/chunk-5ZELPLWF.js +58 -0
- package/Build/Workers/chunk-73EDFMPB.js +1073 -0
- package/Build/Workers/chunk-ALIDMMNJ.js +10357 -0
- package/Build/Workers/chunk-AXTXYHVG.js +59 -0
- package/Build/Workers/chunk-B3DSUDQQ.js +101 -0
- package/Build/Workers/chunk-B7R4KLQV.js +959 -0
- package/Build/Workers/chunk-CET7MMFD.js +1055 -0
- package/Build/Workers/chunk-DGWWFN6L.js +102 -0
- package/Build/Workers/chunk-DPZEBUVY.js +122 -0
- package/Build/Workers/chunk-EKUYACAZ.js +163 -0
- package/Build/Workers/chunk-ETQJFLBY.js +435 -0
- package/Build/Workers/chunk-HDJDQBU6.js +758 -0
- package/Build/Workers/chunk-HOO3H5M5.js +171 -0
- package/Build/Workers/chunk-JRFRSSGD.js +1800 -0
- package/Build/Workers/chunk-KMDXAR34.js +1481 -0
- package/Build/Workers/chunk-KZDZFG2L.js +157 -0
- package/Build/Workers/chunk-LDXSEGOX.js +2857 -0
- package/Build/Workers/chunk-LYJFG66W.js +196 -0
- package/Build/Workers/chunk-N2UJHZ4W.js +368 -0
- package/Build/Workers/chunk-NZU4VBYI.js +834 -0
- package/Build/Workers/chunk-OY2Z6SFD.js +100 -0
- package/Build/Workers/chunk-PA4JZFFM.js +353 -0
- package/Build/Workers/chunk-QUJ6BNQF.js +39 -0
- package/Build/Workers/chunk-ROPEB47Y.js +300 -0
- package/Build/Workers/chunk-S3RIIJID.js +781 -0
- package/Build/Workers/chunk-SPS2I45W.js +73 -0
- package/Build/Workers/chunk-TBJBVKDE.js +262 -0
- package/Build/Workers/chunk-TJAONFQM.js +44 -0
- package/Build/Workers/chunk-TJNJ6CLS.js +239 -0
- package/Build/Workers/chunk-U4SUBL6L.js +390 -0
- package/Build/Workers/chunk-U6RITS73.js +456 -0
- package/Build/Workers/chunk-UHPBZJQF.js +2717 -0
- package/Build/Workers/chunk-UHS2YM44.js +115 -0
- package/Build/Workers/chunk-UN3RMNI2.js +500 -0
- package/Build/Workers/chunk-UYS2HZVM.js +421 -0
- package/Build/Workers/chunk-VSEDVQN7.js +305 -0
- package/Build/Workers/chunk-W7KOAHR2.js +691 -0
- package/Build/Workers/chunk-WGHS4HMU.js +55 -0
- package/Build/Workers/chunk-XV4SYFDP.js +138 -0
- package/Build/Workers/chunk-XX7RETEX.js +1258 -0
- package/Build/Workers/chunk-XYMJZUFF.js +476 -0
- package/Build/Workers/chunk-YCU6WHSN.js +963 -0
- package/Build/Workers/chunk-YWEX5QFW.js +398 -0
- package/Build/Workers/chunk-Z2WOKKJM.js +511 -0
- package/Build/Workers/chunk-ZYUOPFWQ.js +139 -0
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +20 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Scene/Billboard.js +22 -0
- package/Source/Scene/BillboardTexture.js +92 -2
- package/index.js +97 -97
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.39
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
Cartesian3_default
|
|
28
|
+
} from "./chunk-LDXSEGOX.js";
|
|
29
|
+
import {
|
|
30
|
+
Check_default
|
|
31
|
+
} from "./chunk-EKUYACAZ.js";
|
|
32
|
+
import {
|
|
33
|
+
defined_default
|
|
34
|
+
} from "./chunk-2PWEYBYR.js";
|
|
35
|
+
|
|
36
|
+
// packages/engine/Source/Core/EncodedCartesian3.js
|
|
37
|
+
function EncodedCartesian3() {
|
|
38
|
+
this.high = Cartesian3_default.clone(Cartesian3_default.ZERO);
|
|
39
|
+
this.low = Cartesian3_default.clone(Cartesian3_default.ZERO);
|
|
40
|
+
}
|
|
41
|
+
EncodedCartesian3.encode = function(value, result) {
|
|
42
|
+
Check_default.typeOf.number("value", value);
|
|
43
|
+
if (!defined_default(result)) {
|
|
44
|
+
result = {
|
|
45
|
+
high: 0,
|
|
46
|
+
low: 0
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
let doubleHigh;
|
|
50
|
+
if (value >= 0) {
|
|
51
|
+
doubleHigh = Math.floor(value / 65536) * 65536;
|
|
52
|
+
result.high = doubleHigh;
|
|
53
|
+
result.low = value - doubleHigh;
|
|
54
|
+
} else {
|
|
55
|
+
doubleHigh = Math.floor(-value / 65536) * 65536;
|
|
56
|
+
result.high = -doubleHigh;
|
|
57
|
+
result.low = value + doubleHigh;
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
};
|
|
61
|
+
var scratchEncode = {
|
|
62
|
+
high: 0,
|
|
63
|
+
low: 0
|
|
64
|
+
};
|
|
65
|
+
EncodedCartesian3.fromCartesian = function(cartesian, result) {
|
|
66
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
|
67
|
+
if (!defined_default(result)) {
|
|
68
|
+
result = new EncodedCartesian3();
|
|
69
|
+
}
|
|
70
|
+
const high = result.high;
|
|
71
|
+
const low = result.low;
|
|
72
|
+
EncodedCartesian3.encode(cartesian.x, scratchEncode);
|
|
73
|
+
high.x = scratchEncode.high;
|
|
74
|
+
low.x = scratchEncode.low;
|
|
75
|
+
EncodedCartesian3.encode(cartesian.y, scratchEncode);
|
|
76
|
+
high.y = scratchEncode.high;
|
|
77
|
+
low.y = scratchEncode.low;
|
|
78
|
+
EncodedCartesian3.encode(cartesian.z, scratchEncode);
|
|
79
|
+
high.z = scratchEncode.high;
|
|
80
|
+
low.z = scratchEncode.low;
|
|
81
|
+
return result;
|
|
82
|
+
};
|
|
83
|
+
var encodedP = new EncodedCartesian3();
|
|
84
|
+
EncodedCartesian3.writeElements = function(cartesian, cartesianArray, index) {
|
|
85
|
+
Check_default.defined("cartesianArray", cartesianArray);
|
|
86
|
+
Check_default.typeOf.number("index", index);
|
|
87
|
+
Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
|
|
88
|
+
EncodedCartesian3.fromCartesian(cartesian, encodedP);
|
|
89
|
+
const high = encodedP.high;
|
|
90
|
+
const low = encodedP.low;
|
|
91
|
+
cartesianArray[index] = high.x;
|
|
92
|
+
cartesianArray[index + 1] = high.y;
|
|
93
|
+
cartesianArray[index + 2] = high.z;
|
|
94
|
+
cartesianArray[index + 3] = low.x;
|
|
95
|
+
cartesianArray[index + 4] = low.y;
|
|
96
|
+
cartesianArray[index + 5] = low.z;
|
|
97
|
+
};
|
|
98
|
+
var EncodedCartesian3_default = EncodedCartesian3;
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
EncodedCartesian3_default
|
|
102
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.39
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
OrientedBoundingBox_default
|
|
28
|
+
} from "./chunk-NZU4VBYI.js";
|
|
29
|
+
import {
|
|
30
|
+
Cartesian2_default,
|
|
31
|
+
Cartesian3_default,
|
|
32
|
+
Matrix3_default
|
|
33
|
+
} from "./chunk-LDXSEGOX.js";
|
|
34
|
+
import {
|
|
35
|
+
Check_default
|
|
36
|
+
} from "./chunk-EKUYACAZ.js";
|
|
37
|
+
|
|
38
|
+
// packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js
|
|
39
|
+
var CoplanarPolygonGeometryLibrary = {};
|
|
40
|
+
var scratchIntersectionPoint = new Cartesian3_default();
|
|
41
|
+
var scratchXAxis = new Cartesian3_default();
|
|
42
|
+
var scratchYAxis = new Cartesian3_default();
|
|
43
|
+
var scratchZAxis = new Cartesian3_default();
|
|
44
|
+
var obbScratch = new OrientedBoundingBox_default();
|
|
45
|
+
CoplanarPolygonGeometryLibrary.validOutline = function(positions) {
|
|
46
|
+
Check_default.defined("positions", positions);
|
|
47
|
+
const orientedBoundingBox = OrientedBoundingBox_default.fromPoints(
|
|
48
|
+
positions,
|
|
49
|
+
obbScratch
|
|
50
|
+
);
|
|
51
|
+
const halfAxes = orientedBoundingBox.halfAxes;
|
|
52
|
+
const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis);
|
|
53
|
+
const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis);
|
|
54
|
+
const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis);
|
|
55
|
+
const xMag = Cartesian3_default.magnitude(xAxis);
|
|
56
|
+
const yMag = Cartesian3_default.magnitude(yAxis);
|
|
57
|
+
const zMag = Cartesian3_default.magnitude(zAxis);
|
|
58
|
+
return !(xMag === 0 && (yMag === 0 || zMag === 0) || yMag === 0 && zMag === 0);
|
|
59
|
+
};
|
|
60
|
+
CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function(positions, centerResult, planeAxis1Result, planeAxis2Result) {
|
|
61
|
+
Check_default.defined("positions", positions);
|
|
62
|
+
Check_default.defined("centerResult", centerResult);
|
|
63
|
+
Check_default.defined("planeAxis1Result", planeAxis1Result);
|
|
64
|
+
Check_default.defined("planeAxis2Result", planeAxis2Result);
|
|
65
|
+
const orientedBoundingBox = OrientedBoundingBox_default.fromPoints(
|
|
66
|
+
positions,
|
|
67
|
+
obbScratch
|
|
68
|
+
);
|
|
69
|
+
const halfAxes = orientedBoundingBox.halfAxes;
|
|
70
|
+
const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis);
|
|
71
|
+
const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis);
|
|
72
|
+
const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis);
|
|
73
|
+
const xMag = Cartesian3_default.magnitude(xAxis);
|
|
74
|
+
const yMag = Cartesian3_default.magnitude(yAxis);
|
|
75
|
+
const zMag = Cartesian3_default.magnitude(zAxis);
|
|
76
|
+
const min = Math.min(xMag, yMag, zMag);
|
|
77
|
+
if (xMag === 0 && (yMag === 0 || zMag === 0) || yMag === 0 && zMag === 0) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
let planeAxis1;
|
|
81
|
+
let planeAxis2;
|
|
82
|
+
if (min === yMag || min === zMag) {
|
|
83
|
+
planeAxis1 = xAxis;
|
|
84
|
+
}
|
|
85
|
+
if (min === xMag) {
|
|
86
|
+
planeAxis1 = yAxis;
|
|
87
|
+
} else if (min === zMag) {
|
|
88
|
+
planeAxis2 = yAxis;
|
|
89
|
+
}
|
|
90
|
+
if (min === xMag || min === yMag) {
|
|
91
|
+
planeAxis2 = zAxis;
|
|
92
|
+
}
|
|
93
|
+
Cartesian3_default.normalize(planeAxis1, planeAxis1Result);
|
|
94
|
+
Cartesian3_default.normalize(planeAxis2, planeAxis2Result);
|
|
95
|
+
Cartesian3_default.clone(orientedBoundingBox.center, centerResult);
|
|
96
|
+
return true;
|
|
97
|
+
};
|
|
98
|
+
function projectTo2D(position, center, axis1, axis2, result) {
|
|
99
|
+
const v = Cartesian3_default.subtract(position, center, scratchIntersectionPoint);
|
|
100
|
+
const x = Cartesian3_default.dot(axis1, v);
|
|
101
|
+
const y = Cartesian3_default.dot(axis2, v);
|
|
102
|
+
return Cartesian2_default.fromElements(x, y, result);
|
|
103
|
+
}
|
|
104
|
+
CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function(center, axis1, axis2) {
|
|
105
|
+
return function(positions) {
|
|
106
|
+
const positionResults = new Array(positions.length);
|
|
107
|
+
for (let i = 0; i < positions.length; i++) {
|
|
108
|
+
positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);
|
|
109
|
+
}
|
|
110
|
+
return positionResults;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function(center, axis1, axis2) {
|
|
114
|
+
return function(position, result) {
|
|
115
|
+
return projectTo2D(position, center, axis1, axis2, result);
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
var CoplanarPolygonGeometryLibrary_default = CoplanarPolygonGeometryLibrary;
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
CoplanarPolygonGeometryLibrary_default
|
|
122
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.39
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
defined_default
|
|
28
|
+
} from "./chunk-2PWEYBYR.js";
|
|
29
|
+
|
|
30
|
+
// packages/engine/Source/Core/DeveloperError.js
|
|
31
|
+
function DeveloperError(message) {
|
|
32
|
+
this.name = "DeveloperError";
|
|
33
|
+
this.message = message;
|
|
34
|
+
let stack;
|
|
35
|
+
try {
|
|
36
|
+
throw new Error();
|
|
37
|
+
} catch (e) {
|
|
38
|
+
stack = e.stack;
|
|
39
|
+
}
|
|
40
|
+
this.stack = stack;
|
|
41
|
+
}
|
|
42
|
+
if (defined_default(Object.create)) {
|
|
43
|
+
DeveloperError.prototype = Object.create(Error.prototype);
|
|
44
|
+
DeveloperError.prototype.constructor = DeveloperError;
|
|
45
|
+
}
|
|
46
|
+
DeveloperError.prototype.toString = function() {
|
|
47
|
+
let str = `${this.name}: ${this.message}`;
|
|
48
|
+
if (defined_default(this.stack)) {
|
|
49
|
+
str += `
|
|
50
|
+
${this.stack.toString()}`;
|
|
51
|
+
}
|
|
52
|
+
return str;
|
|
53
|
+
};
|
|
54
|
+
DeveloperError.throwInstantiationError = function() {
|
|
55
|
+
throw new DeveloperError(
|
|
56
|
+
"This function defines an interface and should not be called directly."
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
var DeveloperError_default = DeveloperError;
|
|
60
|
+
|
|
61
|
+
// packages/engine/Source/Core/Check.js
|
|
62
|
+
var Check = {};
|
|
63
|
+
Check.typeOf = {};
|
|
64
|
+
function getUndefinedErrorMessage(name) {
|
|
65
|
+
return `${name} is required, actual value was undefined`;
|
|
66
|
+
}
|
|
67
|
+
function getFailedTypeErrorMessage(actual, expected, name) {
|
|
68
|
+
return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;
|
|
69
|
+
}
|
|
70
|
+
Check.defined = function(name, test) {
|
|
71
|
+
if (!defined_default(test)) {
|
|
72
|
+
throw new DeveloperError_default(getUndefinedErrorMessage(name));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
Check.typeOf.func = function(name, test) {
|
|
76
|
+
if (typeof test !== "function") {
|
|
77
|
+
throw new DeveloperError_default(
|
|
78
|
+
getFailedTypeErrorMessage(typeof test, "function", name)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
Check.typeOf.string = function(name, test) {
|
|
83
|
+
if (typeof test !== "string") {
|
|
84
|
+
throw new DeveloperError_default(
|
|
85
|
+
getFailedTypeErrorMessage(typeof test, "string", name)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
Check.typeOf.number = function(name, test) {
|
|
90
|
+
if (typeof test !== "number") {
|
|
91
|
+
throw new DeveloperError_default(
|
|
92
|
+
getFailedTypeErrorMessage(typeof test, "number", name)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
Check.typeOf.number.lessThan = function(name, test, limit) {
|
|
97
|
+
Check.typeOf.number(name, test);
|
|
98
|
+
if (test >= limit) {
|
|
99
|
+
throw new DeveloperError_default(
|
|
100
|
+
`Expected ${name} to be less than ${limit}, actual value was ${test}`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
Check.typeOf.number.lessThanOrEquals = function(name, test, limit) {
|
|
105
|
+
Check.typeOf.number(name, test);
|
|
106
|
+
if (test > limit) {
|
|
107
|
+
throw new DeveloperError_default(
|
|
108
|
+
`Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
Check.typeOf.number.greaterThan = function(name, test, limit) {
|
|
113
|
+
Check.typeOf.number(name, test);
|
|
114
|
+
if (test <= limit) {
|
|
115
|
+
throw new DeveloperError_default(
|
|
116
|
+
`Expected ${name} to be greater than ${limit}, actual value was ${test}`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
Check.typeOf.number.greaterThanOrEquals = function(name, test, limit) {
|
|
121
|
+
Check.typeOf.number(name, test);
|
|
122
|
+
if (test < limit) {
|
|
123
|
+
throw new DeveloperError_default(
|
|
124
|
+
`Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
Check.typeOf.object = function(name, test) {
|
|
129
|
+
if (typeof test !== "object") {
|
|
130
|
+
throw new DeveloperError_default(
|
|
131
|
+
getFailedTypeErrorMessage(typeof test, "object", name)
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
Check.typeOf.bool = function(name, test) {
|
|
136
|
+
if (typeof test !== "boolean") {
|
|
137
|
+
throw new DeveloperError_default(
|
|
138
|
+
getFailedTypeErrorMessage(typeof test, "boolean", name)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
Check.typeOf.bigint = function(name, test) {
|
|
143
|
+
if (typeof test !== "bigint") {
|
|
144
|
+
throw new DeveloperError_default(
|
|
145
|
+
getFailedTypeErrorMessage(typeof test, "bigint", name)
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
Check.typeOf.number.equals = function(name1, name2, test1, test2) {
|
|
150
|
+
Check.typeOf.number(name1, test1);
|
|
151
|
+
Check.typeOf.number(name2, test2);
|
|
152
|
+
if (test1 !== test2) {
|
|
153
|
+
throw new DeveloperError_default(
|
|
154
|
+
`${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
var Check_default = Check;
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
DeveloperError_default,
|
|
162
|
+
Check_default
|
|
163
|
+
};
|