@safeticsinc/dra 0.0.1
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/algorithm/formulas.d.ts +165 -0
- package/dist/algorithm/formulas.d.ts.map +1 -0
- package/dist/algorithm/formulas.js +385 -0
- package/dist/algorithm/formulas.js.map +1 -0
- package/dist/algorithm/index.d.ts +2 -0
- package/dist/algorithm/index.d.ts.map +1 -0
- package/dist/algorithm/index.js +18 -0
- package/dist/algorithm/index.js.map +1 -0
- package/dist/cli/algorithm/formulas.js +382 -0
- package/dist/cli/algorithm/formulas.js.map +1 -0
- package/dist/cli/cli/index.js +133 -0
- package/dist/cli/cli/index.js.map +1 -0
- package/dist/cli/core/error.js +252 -0
- package/dist/cli/core/error.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +133 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/error.d.ts +131 -0
- package/dist/core/error.d.ts.map +1 -0
- package/dist/core/error.js +264 -0
- package/dist/core/error.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +18 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/robot.d.ts +1 -0
- package/dist/schema/robot.d.ts.map +1 -0
- package/dist/schema/robot.js +2 -0
- package/dist/schema/robot.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DRA (Danger Risk Assessment) 에러 처리 시스템
|
|
4
|
+
* 안전거리 계산 중 발생하는 다양한 에러를 구분하여 처리
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ErrorHandler = exports.SafetyThresholdError = exports.TypeError = exports.InvalidStateError = exports.CalculationError = exports.MissingParameterError = exports.OutOfRangeError = exports.ValidationError = exports.DRAError = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* DRA 기본 에러 클래스
|
|
10
|
+
* 모든 DRA 특화 에러는 이 클래스를 상속받음
|
|
11
|
+
*/
|
|
12
|
+
class DRAError extends Error {
|
|
13
|
+
constructor(message, code = 'DRA_ERROR', context) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'DRAError';
|
|
16
|
+
this.code = code;
|
|
17
|
+
this.context = context;
|
|
18
|
+
this.timestamp = new Date();
|
|
19
|
+
// 프로토타입 체인 설정 (TypeScript에서 클래스 상속 시 필요)
|
|
20
|
+
Object.setPrototypeOf(this, DRAError.prototype);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 에러 정보를 객체로 반환
|
|
24
|
+
*/
|
|
25
|
+
toJSON() {
|
|
26
|
+
return {
|
|
27
|
+
name: this.name,
|
|
28
|
+
code: this.code,
|
|
29
|
+
message: this.message,
|
|
30
|
+
context: this.context,
|
|
31
|
+
timestamp: this.timestamp,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 에러 정보를 문자열로 반환
|
|
36
|
+
*/
|
|
37
|
+
toString() {
|
|
38
|
+
const contextStr = this.context
|
|
39
|
+
? `\n컨텍스트: ${JSON.stringify(this.context, null, 2)}`
|
|
40
|
+
: '';
|
|
41
|
+
return `[${this.code}] ${this.message}${contextStr}`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.DRAError = DRAError;
|
|
45
|
+
exports.default = DRAError;
|
|
46
|
+
/**
|
|
47
|
+
* 입력 파라미터 검증 에러
|
|
48
|
+
* 필수 파라미터가 누락되었거나 잘못된 형식일 때 발생
|
|
49
|
+
*/
|
|
50
|
+
class ValidationError extends DRAError {
|
|
51
|
+
constructor(message, context) {
|
|
52
|
+
super(message, 'VALIDATION_ERROR', context);
|
|
53
|
+
this.name = 'ValidationError';
|
|
54
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.ValidationError = ValidationError;
|
|
58
|
+
/**
|
|
59
|
+
* 파라미터 범위 벗어남 에러
|
|
60
|
+
* 입력값이 허용된 범위를 벗어났을 때 발생
|
|
61
|
+
*/
|
|
62
|
+
class OutOfRangeError extends DRAError {
|
|
63
|
+
constructor(paramName, value, minValue, maxValue) {
|
|
64
|
+
const message = minValue !== undefined && maxValue !== undefined
|
|
65
|
+
? `파라미터 '${paramName}'은(는) ${minValue}~${maxValue} 범위여야 합니다. (현재값: ${value})`
|
|
66
|
+
: minValue !== undefined
|
|
67
|
+
? `파라미터 '${paramName}'은(는) ${minValue} 이상이어야 합니다. (현재값: ${value})`
|
|
68
|
+
: `파라미터 '${paramName}'은(는) ${maxValue} 이하여야 합니다. (현재값: ${value})`;
|
|
69
|
+
super(message, 'OUT_OF_RANGE_ERROR', {
|
|
70
|
+
paramName,
|
|
71
|
+
value,
|
|
72
|
+
minValue,
|
|
73
|
+
maxValue,
|
|
74
|
+
});
|
|
75
|
+
this.name = 'OutOfRangeError';
|
|
76
|
+
this.paramName = paramName;
|
|
77
|
+
this.value = value;
|
|
78
|
+
this.minValue = minValue;
|
|
79
|
+
this.maxValue = maxValue;
|
|
80
|
+
Object.setPrototypeOf(this, OutOfRangeError.prototype);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.OutOfRangeError = OutOfRangeError;
|
|
84
|
+
/**
|
|
85
|
+
* 필수 파라미터 누락 에러
|
|
86
|
+
* 필수 파라미터가 제공되지 않았을 때 발생
|
|
87
|
+
*/
|
|
88
|
+
class MissingParameterError extends DRAError {
|
|
89
|
+
constructor(requiredParams) {
|
|
90
|
+
const paramList = requiredParams.join(', ');
|
|
91
|
+
const message = `필수 파라미터가 누락되었습니다: ${paramList}`;
|
|
92
|
+
super(message, 'MISSING_PARAMETER_ERROR', { requiredParams });
|
|
93
|
+
this.name = 'MissingParameterError';
|
|
94
|
+
this.requiredParams = requiredParams;
|
|
95
|
+
Object.setPrototypeOf(this, MissingParameterError.prototype);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.MissingParameterError = MissingParameterError;
|
|
99
|
+
/**
|
|
100
|
+
* 계산 에러
|
|
101
|
+
* 계산 과정에서 수학적 오류 또는 불가능한 연산이 발생했을 때
|
|
102
|
+
*/
|
|
103
|
+
class CalculationError extends DRAError {
|
|
104
|
+
constructor(message, formulaCode, params) {
|
|
105
|
+
super(message, 'CALCULATION_ERROR', { formulaCode, params });
|
|
106
|
+
this.name = 'CalculationError';
|
|
107
|
+
this.formulaCode = formulaCode;
|
|
108
|
+
this.params = params;
|
|
109
|
+
Object.setPrototypeOf(this, CalculationError.prototype);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.CalculationError = CalculationError;
|
|
113
|
+
/**
|
|
114
|
+
* 불가능한 상태 에러
|
|
115
|
+
* 현재 상태에서 요청된 작업을 수행할 수 없을 때 발생
|
|
116
|
+
*/
|
|
117
|
+
class InvalidStateError extends DRAError {
|
|
118
|
+
constructor(message, currentState, requiredState) {
|
|
119
|
+
super(message, 'INVALID_STATE_ERROR', {
|
|
120
|
+
currentState,
|
|
121
|
+
requiredState,
|
|
122
|
+
});
|
|
123
|
+
this.name = 'InvalidStateError';
|
|
124
|
+
this.currentState = currentState;
|
|
125
|
+
this.requiredState = requiredState || '';
|
|
126
|
+
Object.setPrototypeOf(this, InvalidStateError.prototype);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.InvalidStateError = InvalidStateError;
|
|
130
|
+
/**
|
|
131
|
+
* 타입 에러
|
|
132
|
+
* 예상과 다른 타입의 값이 제공되었을 때 발생
|
|
133
|
+
*/
|
|
134
|
+
class TypeError extends DRAError {
|
|
135
|
+
constructor(paramName, expectedType, actualType) {
|
|
136
|
+
const message = `파라미터 '${paramName}'의 타입이 잘못되었습니다. (예상: ${expectedType}, 실제: ${actualType})`;
|
|
137
|
+
super(message, 'TYPE_ERROR', {
|
|
138
|
+
paramName,
|
|
139
|
+
expectedType,
|
|
140
|
+
actualType,
|
|
141
|
+
});
|
|
142
|
+
this.name = 'TypeError';
|
|
143
|
+
this.paramName = paramName;
|
|
144
|
+
this.expectedType = expectedType;
|
|
145
|
+
this.actualType = actualType;
|
|
146
|
+
Object.setPrototypeOf(this, TypeError.prototype);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.TypeError = TypeError;
|
|
150
|
+
/**
|
|
151
|
+
* 안전 기준 미만 에러
|
|
152
|
+
* 계산된 안전거리가 최소 안전거리 기준을 만족하지 못할 때 발생
|
|
153
|
+
*/
|
|
154
|
+
class SafetyThresholdError extends DRAError {
|
|
155
|
+
constructor(calculatedValue, minimumRequired) {
|
|
156
|
+
const safetyMargin = minimumRequired - calculatedValue;
|
|
157
|
+
const message = `안전거리가 기준을 충족하지 못했습니다. (계산값: ${calculatedValue}mm, 필요값: ${minimumRequired}mm, 부족: ${safetyMargin}mm)`;
|
|
158
|
+
super(message, 'SAFETY_THRESHOLD_ERROR', {
|
|
159
|
+
calculatedValue,
|
|
160
|
+
minimumRequired,
|
|
161
|
+
safetyMargin,
|
|
162
|
+
});
|
|
163
|
+
this.name = 'SafetyThresholdError';
|
|
164
|
+
this.calculatedValue = calculatedValue;
|
|
165
|
+
this.minimumRequired = minimumRequired;
|
|
166
|
+
this.safetyMargin = safetyMargin;
|
|
167
|
+
Object.setPrototypeOf(this, SafetyThresholdError.prototype);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.SafetyThresholdError = SafetyThresholdError;
|
|
171
|
+
/**
|
|
172
|
+
* 에러 검증 및 처리 유틸리티
|
|
173
|
+
*/
|
|
174
|
+
class ErrorHandler {
|
|
175
|
+
/**
|
|
176
|
+
* 값이 범위 내에 있는지 검증
|
|
177
|
+
*/
|
|
178
|
+
static validateRange(paramName, value, minValue, maxValue) {
|
|
179
|
+
if (minValue !== undefined &&
|
|
180
|
+
maxValue !== undefined &&
|
|
181
|
+
(value < minValue || value > maxValue)) {
|
|
182
|
+
throw new OutOfRangeError(paramName, value, minValue, maxValue);
|
|
183
|
+
}
|
|
184
|
+
if (minValue !== undefined && value < minValue) {
|
|
185
|
+
throw new OutOfRangeError(paramName, value, minValue, undefined);
|
|
186
|
+
}
|
|
187
|
+
if (maxValue !== undefined && value > maxValue) {
|
|
188
|
+
throw new OutOfRangeError(paramName, value, undefined, maxValue);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 필수 파라미터 검증
|
|
193
|
+
*/
|
|
194
|
+
static validateRequired(params, requiredKeys) {
|
|
195
|
+
const missingKeys = requiredKeys.filter((key) => !(key in params));
|
|
196
|
+
if (missingKeys.length > 0) {
|
|
197
|
+
throw new MissingParameterError(missingKeys);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 타입 검증
|
|
202
|
+
*/
|
|
203
|
+
static validateType(paramName, value, expectedType) {
|
|
204
|
+
const actualType = typeof value;
|
|
205
|
+
if (actualType !== expectedType) {
|
|
206
|
+
throw new TypeError(paramName, expectedType, actualType);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 값이 0이 아닌지 검증 (나눗셈 방지)
|
|
211
|
+
*/
|
|
212
|
+
static validateNonZero(paramName, value) {
|
|
213
|
+
if (value === 0) {
|
|
214
|
+
throw new ValidationError(`파라미터 '${paramName}'은(는) 0이 될 수 없습니다.`, { paramName, value });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 배열이 최소 길이 이상인지 검증
|
|
219
|
+
*/
|
|
220
|
+
static validateArrayLength(paramName, array, minLength) {
|
|
221
|
+
if (array.length < minLength) {
|
|
222
|
+
throw new ValidationError(`파라미터 '${paramName}'은(는) 최소 ${minLength}개 이상의 요소를 가져야 합니다. (현재: ${array.length}개)`, { paramName, minLength, actualLength: array.length });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* 안전거리 기준 검증
|
|
227
|
+
*/
|
|
228
|
+
static validateSafetyThreshold(calculatedValue, minimumRequired) {
|
|
229
|
+
if (calculatedValue < minimumRequired) {
|
|
230
|
+
throw new SafetyThresholdError(calculatedValue, minimumRequired);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* 에러를 캐치하고 로깅
|
|
235
|
+
*/
|
|
236
|
+
static catch(error, fallbackMessage = '알 수 없는 에러가 발생했습니다') {
|
|
237
|
+
if (error instanceof DRAError) {
|
|
238
|
+
console.error(`[${error.code}] ${error.message}`);
|
|
239
|
+
return error;
|
|
240
|
+
}
|
|
241
|
+
if (error instanceof Error) {
|
|
242
|
+
console.error(`[ERROR] ${error.message}`);
|
|
243
|
+
return new DRAError(error.message);
|
|
244
|
+
}
|
|
245
|
+
console.error(`[ERROR] ${fallbackMessage}`);
|
|
246
|
+
return new DRAError(fallbackMessage);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* 에러 정보를 상세히 출력
|
|
250
|
+
*/
|
|
251
|
+
static log(error) {
|
|
252
|
+
console.error(`
|
|
253
|
+
═══════════════════════════════════════════════════════════
|
|
254
|
+
[${error.code}] ${error.name}
|
|
255
|
+
═══════════════════════════════════════════════════════════
|
|
256
|
+
메시지: ${error.message}
|
|
257
|
+
시간: ${error.timestamp.toISOString()}
|
|
258
|
+
${error.context ? ` 상세정보:\n${JSON.stringify(error.context, null, 4)}` : ''}
|
|
259
|
+
═══════════════════════════════════════════════════════════
|
|
260
|
+
`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
exports.ErrorHandler = ErrorHandler;
|
|
264
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/core/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AY,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;;KAEtE,CAAC,CAAC;IACL,CAAC;CACF;AAjID,oCAiIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./error"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./core/index"), exports);
|
|
18
|
+
__exportStar(require("./algorithm/index"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,oDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=robot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"robot.d.ts","sourceRoot":"","sources":["../../src/schema/robot.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"robot.js","sourceRoot":"","sources":["../../src/schema/robot.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@safeticsinc/dra",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "digital risk assessment system algorithm and formula",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.esm.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.esm.js",
|
|
14
|
+
"require": "./dist/index.cjs.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"package.json",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "npm run build:esm && npm run build:cjs && npm run build:cli",
|
|
24
|
+
"build:esm": "tsc --project tsconfig.json",
|
|
25
|
+
"build:cjs": "tsc --project tsconfig.cjs.json --outDir dist && node -e \"require('fs').renameSync('dist/index.js', 'dist/index.cjs')\"",
|
|
26
|
+
"build:cli": "tsc --project tsconfig.cli.json",
|
|
27
|
+
"type-check": "tsc --noEmit",
|
|
28
|
+
"prepublishOnly": "npm run build",
|
|
29
|
+
"cli": "tsx src/cli/index.ts"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": ""
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^20.0.0",
|
|
40
|
+
"@types/seedrandom": "^3",
|
|
41
|
+
"@types/three": "^0.159.0",
|
|
42
|
+
"readline": "^1.3.0",
|
|
43
|
+
"ts-node": "^10.9.2",
|
|
44
|
+
"tsx": "^4.21.0",
|
|
45
|
+
"typedoc": "^0.28.15",
|
|
46
|
+
"typescript": "^5.6.3"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"mathjs": "^15.1.0",
|
|
50
|
+
"seedrandom": "^3.0.5",
|
|
51
|
+
"three": "^0.159.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
55
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"react": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"react-dom": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|