@cjhd/cj-decimal 1.0.0 → 1.1.2
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/.cj-package.json +13 -0
- package/assets/Decimal.d.ts +464 -0
- package/assets/Decimal.js +6 -0
- package/bin/package-postinstall.js +32 -0
- package/encrypted-payload/files/assets__Decimal.js.bin +0 -0
- package/encrypted-payload/files/index.js.bin +1 -0
- package/encrypted-payload/manifest.json +29 -0
- package/{index.ts → index.d.ts} +2 -2
- package/index.js +6 -0
- package/package.json +43 -7
- package/assets/Decimal.ts +0 -1428
- package/assets/Decimal.ts.meta +0 -9
- package/assets.meta +0 -9
- package/index.ts.meta +0 -9
- package/package.json.meta +0 -11
- /package/{.cj-decimal.md → README.md} +0 -0
package/.cj-package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "cj-package-v1",
|
|
3
|
+
"name": "@cjhd/cj-decimal",
|
|
4
|
+
"version": "1.1.2",
|
|
5
|
+
"payloadManifest": "encrypted-payload/manifest.json",
|
|
6
|
+
"entry": "index.js",
|
|
7
|
+
"assetsDir": "assets",
|
|
8
|
+
"generatedFiles": [
|
|
9
|
+
"assets/Decimal.js",
|
|
10
|
+
"index.js"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": []
|
|
13
|
+
}
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
type DecimalSign = 1 | -1;
|
|
2
|
+
type IntNumber = number;
|
|
3
|
+
/**
|
|
4
|
+
* Decimal 原地修改观察器。
|
|
5
|
+
* 默认不绑定,只有 @EcsObservedDecimal 这类业务装饰器显式绑定后才会触发。
|
|
6
|
+
*/
|
|
7
|
+
export interface IDecimalMutationObserver {
|
|
8
|
+
onDecimalMutated(decimal: Decimal): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 定点数计算
|
|
12
|
+
*/
|
|
13
|
+
export declare class Decimal {
|
|
14
|
+
static copy(other: Decimal): Decimal;
|
|
15
|
+
static createInt(value: IntNumber): Decimal;
|
|
16
|
+
static createFloat(value: string): Decimal;
|
|
17
|
+
static create(sign: DecimalSign, v1: IntNumber, v2: IntNumber): Decimal;
|
|
18
|
+
/**
|
|
19
|
+
* 精确度保留n位小数点, 默认是8。
|
|
20
|
+
* @description 注意整数与小数部分长度和不要超过16位,并且整数位大小不要超过「9 * Math.pow(10, 15-n)」,否则运算过程中会出现大整数导致的精度丢失。
|
|
21
|
+
*/
|
|
22
|
+
static set accuracy(value: IntNumber);
|
|
23
|
+
static get accuracy(): IntNumber;
|
|
24
|
+
/**
|
|
25
|
+
* 180度对应的弧度值 (不要修改此值)
|
|
26
|
+
*/
|
|
27
|
+
static get PI(): Decimal;
|
|
28
|
+
/**
|
|
29
|
+
* 180度的一半(90度)对应的弧度值 (不要修改此值)
|
|
30
|
+
*/
|
|
31
|
+
static get PI_HALF(): Decimal;
|
|
32
|
+
/**
|
|
33
|
+
* 1度对应的弧度值 (不要修改此值)
|
|
34
|
+
*/
|
|
35
|
+
static get DEG_TO_RAD(): Decimal;
|
|
36
|
+
/**
|
|
37
|
+
* 1弧度对应的角度值 (不要修改此值)
|
|
38
|
+
*/
|
|
39
|
+
static get RAD_TO_DEG(): Decimal;
|
|
40
|
+
/**
|
|
41
|
+
* 0
|
|
42
|
+
*/
|
|
43
|
+
static get zero(): Decimal;
|
|
44
|
+
/**
|
|
45
|
+
* 0 (不要修改此值)
|
|
46
|
+
*/
|
|
47
|
+
static get ZERO(): Decimal;
|
|
48
|
+
/**
|
|
49
|
+
* 1
|
|
50
|
+
*/
|
|
51
|
+
static get one(): Decimal;
|
|
52
|
+
/**
|
|
53
|
+
* 1 (不要修改此值)
|
|
54
|
+
*/
|
|
55
|
+
static get ONE(): Decimal;
|
|
56
|
+
/**
|
|
57
|
+
* 2
|
|
58
|
+
*/
|
|
59
|
+
static get two(): Decimal;
|
|
60
|
+
/**
|
|
61
|
+
* 2 (不要修改此值)
|
|
62
|
+
*/
|
|
63
|
+
static get TWO(): Decimal;
|
|
64
|
+
/**
|
|
65
|
+
* -1
|
|
66
|
+
*/
|
|
67
|
+
static get(): Decimal;
|
|
68
|
+
/**
|
|
69
|
+
* -1 (不要修改此值)
|
|
70
|
+
*/
|
|
71
|
+
static get MINUS(): Decimal;
|
|
72
|
+
/**
|
|
73
|
+
* NaN
|
|
74
|
+
*/
|
|
75
|
+
static get NaN(): Decimal;
|
|
76
|
+
/**
|
|
77
|
+
* 取较大
|
|
78
|
+
*/
|
|
79
|
+
static max(...args: Decimal[]): Decimal;
|
|
80
|
+
/**
|
|
81
|
+
* 取较小
|
|
82
|
+
*/
|
|
83
|
+
static min(...args: Decimal[]): Decimal;
|
|
84
|
+
/**
|
|
85
|
+
* 弧度转角度
|
|
86
|
+
*/
|
|
87
|
+
static radiansToDegrees(out: Decimal, radians: Decimal): Decimal;
|
|
88
|
+
/**
|
|
89
|
+
* 角度转弧度
|
|
90
|
+
* @param out 输出结果
|
|
91
|
+
* @param degrees 角度
|
|
92
|
+
* @returns 结果
|
|
93
|
+
*/
|
|
94
|
+
static degreesToRadians(out: Decimal, degrees: Decimal): Decimal;
|
|
95
|
+
/**
|
|
96
|
+
* 正弦函数
|
|
97
|
+
*/
|
|
98
|
+
static sin(out: Decimal, angle: Decimal): Decimal;
|
|
99
|
+
/**
|
|
100
|
+
* 余弦函数
|
|
101
|
+
*/
|
|
102
|
+
static cos(out: Decimal, angle: Decimal): Decimal;
|
|
103
|
+
/**
|
|
104
|
+
* 正切函数
|
|
105
|
+
*/
|
|
106
|
+
static tan(out: Decimal, angle: Decimal): Decimal;
|
|
107
|
+
/**
|
|
108
|
+
* 计算反正弦
|
|
109
|
+
*/
|
|
110
|
+
static asin(out: Decimal, value: Decimal): Decimal;
|
|
111
|
+
/**
|
|
112
|
+
* 计算反余弦
|
|
113
|
+
*/
|
|
114
|
+
static acos(out: Decimal, value: Decimal): Decimal;
|
|
115
|
+
/**
|
|
116
|
+
* 计算反正切
|
|
117
|
+
*/
|
|
118
|
+
static atan(out: Decimal, value: Decimal): Decimal;
|
|
119
|
+
/**
|
|
120
|
+
* 计算反正切,给定 x 和 y 的值
|
|
121
|
+
*/
|
|
122
|
+
static atan2(out: Decimal, y: Decimal, x: Decimal): Decimal;
|
|
123
|
+
private _sign;
|
|
124
|
+
get sign(): DecimalSign;
|
|
125
|
+
private set sign(value);
|
|
126
|
+
private _v1;
|
|
127
|
+
get v1(): IntNumber;
|
|
128
|
+
private set v1(value);
|
|
129
|
+
private _v2;
|
|
130
|
+
get v2(): IntNumber;
|
|
131
|
+
private set v2(value);
|
|
132
|
+
/** 可选 observer。默认 null,算法 scratch Decimal 不承担观察成本。 */
|
|
133
|
+
private __observer;
|
|
134
|
+
/** 嵌套 mutation 深度,用于 batch 合并多次原地修改。 */
|
|
135
|
+
private __mutationDepth;
|
|
136
|
+
/** batch 内是否发生过实际数值变化。 */
|
|
137
|
+
private __mutationPending;
|
|
138
|
+
/** 静默写入深度。大批量业务写屏障可用 setSilent/copySilent 后手动 markDirty。 */
|
|
139
|
+
private __silentDepth;
|
|
140
|
+
/**
|
|
141
|
+
* 绑定或解绑 Decimal mutation observer。
|
|
142
|
+
* 仅 @EcsObservedDecimal 管理的组件字段需要绑定;普通 Decimal、SAT/MTV 临时值不要绑定。
|
|
143
|
+
*/
|
|
144
|
+
bindMutationObserver(observer: IDecimalMutationObserver | null): this;
|
|
145
|
+
/** 开始合并多次 Decimal 修改,直到 endMutationBatch 才通知一次 observer。 */
|
|
146
|
+
beginMutationBatch(): this;
|
|
147
|
+
/** 结束 batch;如果期间值发生变化且已回到最外层,则通知一次 observer。 */
|
|
148
|
+
endMutationBatch(): this;
|
|
149
|
+
/** 用函数作用域包住 batch,避免异常时忘记 endMutationBatch。 */
|
|
150
|
+
runMutationBatch<T>(action: () => T): T;
|
|
151
|
+
/** 静默执行 Decimal 修改,不通知 observer。适合业务写屏障合并后手动 markDirty。 */
|
|
152
|
+
runSilentMutation<T>(action: () => T): T;
|
|
153
|
+
/** 静默 set,不触发 Decimal observer。 */
|
|
154
|
+
setSilent(sign?: DecimalSign, v1?: IntNumber, v2?: IntNumber): this;
|
|
155
|
+
/** 静默 copy,不触发 Decimal observer。 */
|
|
156
|
+
copySilent(other: Decimal): this;
|
|
157
|
+
private static compareAbs;
|
|
158
|
+
private static compareSigned;
|
|
159
|
+
private normalizeZero;
|
|
160
|
+
private snapshot;
|
|
161
|
+
private changedSince;
|
|
162
|
+
/** 所有会原地修改 Decimal 的 public 方法都应通过这里包裹,确保值变才通知。 */
|
|
163
|
+
private runMutation;
|
|
164
|
+
/** batch/silent 状态允许时,把一次已合并的 mutation 通知给 observer。 */
|
|
165
|
+
private flushMutationObserverIfReady;
|
|
166
|
+
private setAbsSub;
|
|
167
|
+
private setAbsAdd;
|
|
168
|
+
private setFromRawBigInt;
|
|
169
|
+
/**
|
|
170
|
+
* 用于等号赋值
|
|
171
|
+
* @example
|
|
172
|
+
* const a = new Decimal('1');
|
|
173
|
+
* const b = new Decimal('10');
|
|
174
|
+
* a.value = b;
|
|
175
|
+
*/
|
|
176
|
+
set value(other: Decimal);
|
|
177
|
+
/**
|
|
178
|
+
* 传入字符串数字
|
|
179
|
+
* @param value 字符串数字(不支持科学计数)
|
|
180
|
+
*/
|
|
181
|
+
constructor(value: string);
|
|
182
|
+
/**
|
|
183
|
+
* 构造 0
|
|
184
|
+
*/
|
|
185
|
+
constructor();
|
|
186
|
+
/**
|
|
187
|
+
* 设置, 默认为0
|
|
188
|
+
*/
|
|
189
|
+
set(sign?: DecimalSign, v1?: IntNumber, v2?: IntNumber): this;
|
|
190
|
+
/**
|
|
191
|
+
* 通过float字符串设置, 默认为0
|
|
192
|
+
*/
|
|
193
|
+
setFloat(value?: string): this;
|
|
194
|
+
/**
|
|
195
|
+
* 通过int设置, 默认为0
|
|
196
|
+
*/
|
|
197
|
+
setInt(value?: IntNumber): this;
|
|
198
|
+
/**
|
|
199
|
+
* 通过其他Decimal设置
|
|
200
|
+
*/
|
|
201
|
+
copy(other: Decimal): this;
|
|
202
|
+
/**
|
|
203
|
+
* 转为浮点数
|
|
204
|
+
* @param strict 严格模式,默认关闭。开启后额外消耗性能,避免定点数转小数时出现精度问题。
|
|
205
|
+
*/
|
|
206
|
+
toNumber(strict?: boolean): number;
|
|
207
|
+
/**
|
|
208
|
+
* 转为字符串
|
|
209
|
+
*/
|
|
210
|
+
toString(): string;
|
|
211
|
+
/**
|
|
212
|
+
* 转为大整数
|
|
213
|
+
*/
|
|
214
|
+
toBigInt(): IntNumber;
|
|
215
|
+
/**
|
|
216
|
+
* 是否为0
|
|
217
|
+
*/
|
|
218
|
+
isZero(): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* 是否是负数
|
|
221
|
+
*/
|
|
222
|
+
isNegative(): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* 是否是NaN
|
|
225
|
+
*/
|
|
226
|
+
isNaN(): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* 克隆
|
|
229
|
+
*/
|
|
230
|
+
clone(): Decimal;
|
|
231
|
+
/**
|
|
232
|
+
* 向下取整
|
|
233
|
+
*/
|
|
234
|
+
floor(): this;
|
|
235
|
+
/**
|
|
236
|
+
* 向上取整
|
|
237
|
+
*/
|
|
238
|
+
ceil(): this;
|
|
239
|
+
/**
|
|
240
|
+
* 四舍五入
|
|
241
|
+
*/
|
|
242
|
+
round(): this;
|
|
243
|
+
/**
|
|
244
|
+
* 绝对值
|
|
245
|
+
*/
|
|
246
|
+
abs(): Decimal;
|
|
247
|
+
/**
|
|
248
|
+
* @deprecated 使用negative代替
|
|
249
|
+
*/
|
|
250
|
+
reverse(): Decimal;
|
|
251
|
+
/**
|
|
252
|
+
* 相反数
|
|
253
|
+
*/
|
|
254
|
+
negative(): Decimal;
|
|
255
|
+
/**
|
|
256
|
+
* 倒数
|
|
257
|
+
*/
|
|
258
|
+
reciprocal(): Decimal;
|
|
259
|
+
/**
|
|
260
|
+
* 加法
|
|
261
|
+
* @param other
|
|
262
|
+
*/
|
|
263
|
+
add(other: Decimal): Decimal;
|
|
264
|
+
/**
|
|
265
|
+
* 加法
|
|
266
|
+
* @param other
|
|
267
|
+
*/
|
|
268
|
+
addInt(other: IntNumber): Decimal;
|
|
269
|
+
/**
|
|
270
|
+
* 加法
|
|
271
|
+
* @param other
|
|
272
|
+
*/
|
|
273
|
+
addFloat(other: string): Decimal;
|
|
274
|
+
/**
|
|
275
|
+
* 减法
|
|
276
|
+
* @param other
|
|
277
|
+
*/
|
|
278
|
+
sub(other: Decimal): Decimal;
|
|
279
|
+
/**
|
|
280
|
+
* 减法
|
|
281
|
+
* @param other
|
|
282
|
+
*/
|
|
283
|
+
subInt(other: IntNumber): Decimal;
|
|
284
|
+
/**
|
|
285
|
+
* 减法
|
|
286
|
+
* @param other
|
|
287
|
+
*/
|
|
288
|
+
subFloat(other: string): Decimal;
|
|
289
|
+
/**
|
|
290
|
+
* 乘法
|
|
291
|
+
* @param other
|
|
292
|
+
*/
|
|
293
|
+
mul(other: Decimal): Decimal;
|
|
294
|
+
/**
|
|
295
|
+
* 乘法
|
|
296
|
+
* @param other
|
|
297
|
+
*/
|
|
298
|
+
mulInt(other: IntNumber): Decimal;
|
|
299
|
+
/**
|
|
300
|
+
* 乘法
|
|
301
|
+
* @param other
|
|
302
|
+
*/
|
|
303
|
+
mulFloat(other: string): Decimal;
|
|
304
|
+
/**
|
|
305
|
+
* 除法
|
|
306
|
+
* @param other
|
|
307
|
+
*/
|
|
308
|
+
div(other: Decimal): Decimal;
|
|
309
|
+
/**
|
|
310
|
+
* 除法
|
|
311
|
+
* @param other
|
|
312
|
+
*/
|
|
313
|
+
divInt(other: IntNumber): Decimal;
|
|
314
|
+
/**
|
|
315
|
+
* 除法
|
|
316
|
+
* @param other
|
|
317
|
+
*/
|
|
318
|
+
divFloat(other: string): Decimal;
|
|
319
|
+
/**
|
|
320
|
+
* 取余数
|
|
321
|
+
* @param other
|
|
322
|
+
*/
|
|
323
|
+
mod(other: Decimal): Decimal;
|
|
324
|
+
/**
|
|
325
|
+
* 取余数
|
|
326
|
+
* @param other
|
|
327
|
+
*/
|
|
328
|
+
modInt(other: IntNumber): Decimal;
|
|
329
|
+
/**
|
|
330
|
+
* 取余数
|
|
331
|
+
* @param other
|
|
332
|
+
*/
|
|
333
|
+
modFloat(other: string): Decimal;
|
|
334
|
+
/**
|
|
335
|
+
* n次方
|
|
336
|
+
* @param n 整数
|
|
337
|
+
*/
|
|
338
|
+
pow(n?: IntNumber): this;
|
|
339
|
+
/**
|
|
340
|
+
* 开方
|
|
341
|
+
*/
|
|
342
|
+
sqrt(): this;
|
|
343
|
+
/**
|
|
344
|
+
* 小于
|
|
345
|
+
* @param other
|
|
346
|
+
*/
|
|
347
|
+
LT(other: Decimal): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* 小于
|
|
350
|
+
* @param other
|
|
351
|
+
*/
|
|
352
|
+
['<'](other: Decimal): boolean;
|
|
353
|
+
/**
|
|
354
|
+
* 小于
|
|
355
|
+
* @param other
|
|
356
|
+
*/
|
|
357
|
+
LTInt(other: IntNumber): boolean;
|
|
358
|
+
/**
|
|
359
|
+
* 小于
|
|
360
|
+
* @param other
|
|
361
|
+
*/
|
|
362
|
+
LTFloat(other: string): boolean;
|
|
363
|
+
/**
|
|
364
|
+
* 小于等于
|
|
365
|
+
* @param other
|
|
366
|
+
*/
|
|
367
|
+
LE(other: Decimal): boolean;
|
|
368
|
+
/**
|
|
369
|
+
* 小于等于
|
|
370
|
+
* @param other
|
|
371
|
+
*/
|
|
372
|
+
['<='](other: Decimal): boolean;
|
|
373
|
+
/**
|
|
374
|
+
* 小于等于
|
|
375
|
+
* @param other
|
|
376
|
+
*/
|
|
377
|
+
LEInt(other: IntNumber): boolean;
|
|
378
|
+
/**
|
|
379
|
+
* 小于等于
|
|
380
|
+
* @param other
|
|
381
|
+
*/
|
|
382
|
+
LEFloat(other: string): boolean;
|
|
383
|
+
/**
|
|
384
|
+
* 等于
|
|
385
|
+
* @param other
|
|
386
|
+
*/
|
|
387
|
+
EQ(other: Decimal): boolean;
|
|
388
|
+
/**
|
|
389
|
+
* 等于
|
|
390
|
+
* @param other
|
|
391
|
+
*/
|
|
392
|
+
['=='](other: Decimal): boolean;
|
|
393
|
+
/**
|
|
394
|
+
* 等于
|
|
395
|
+
* @param other
|
|
396
|
+
*/
|
|
397
|
+
EQInt(other: IntNumber): boolean;
|
|
398
|
+
/**
|
|
399
|
+
* 等于
|
|
400
|
+
* @param other
|
|
401
|
+
*/
|
|
402
|
+
EQFloat(other: string): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* 不等于
|
|
405
|
+
* @param other
|
|
406
|
+
*/
|
|
407
|
+
NE(other: Decimal): boolean;
|
|
408
|
+
/**
|
|
409
|
+
* 不等于
|
|
410
|
+
* @param other
|
|
411
|
+
*/
|
|
412
|
+
['!='](other: Decimal): boolean;
|
|
413
|
+
/**
|
|
414
|
+
* 不等于
|
|
415
|
+
* @param other
|
|
416
|
+
*/
|
|
417
|
+
NEInt(other: IntNumber): boolean;
|
|
418
|
+
/**
|
|
419
|
+
* 不等于
|
|
420
|
+
* @param other
|
|
421
|
+
*/
|
|
422
|
+
NEFloat(other: string): boolean;
|
|
423
|
+
/**
|
|
424
|
+
* 大于
|
|
425
|
+
* @param other
|
|
426
|
+
*/
|
|
427
|
+
GT(other: Decimal): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* 大于
|
|
430
|
+
* @param other
|
|
431
|
+
*/
|
|
432
|
+
['>'](other: Decimal): boolean;
|
|
433
|
+
/**
|
|
434
|
+
* 大于
|
|
435
|
+
* @param other
|
|
436
|
+
*/
|
|
437
|
+
GTInt(other: IntNumber): boolean;
|
|
438
|
+
/**
|
|
439
|
+
* 大于
|
|
440
|
+
* @param other
|
|
441
|
+
*/
|
|
442
|
+
GTFloat(other: string): boolean;
|
|
443
|
+
/**
|
|
444
|
+
* 大于等于
|
|
445
|
+
* @param other
|
|
446
|
+
*/
|
|
447
|
+
GE(other: Decimal): boolean;
|
|
448
|
+
/**
|
|
449
|
+
* 大于等于
|
|
450
|
+
* @param other
|
|
451
|
+
*/
|
|
452
|
+
['>='](other: Decimal): boolean;
|
|
453
|
+
/**
|
|
454
|
+
* 大于等于
|
|
455
|
+
* @param other
|
|
456
|
+
*/
|
|
457
|
+
GEInt(other: IntNumber): boolean;
|
|
458
|
+
/**
|
|
459
|
+
* 大于等于
|
|
460
|
+
* @param other
|
|
461
|
+
*/
|
|
462
|
+
GEFloat(other: string): boolean;
|
|
463
|
+
}
|
|
464
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function __cjLicenseError() {
|
|
2
|
+
throw new Error("[CJHD License] Runtime package is not unlocked. Expected license file: extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-runtime-license.json. Then run: node extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-license.js --mode install --force");
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export class Decimal { constructor() { __cjLicenseError(); } }
|
|
6
|
+
export function __cj_package_not_unlocked__() { __cjLicenseError(); }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import childProcess from 'node:child_process';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
8
|
+
const cjhdRoot = path.dirname(packageRoot);
|
|
9
|
+
const pkgRoot = path.resolve(cjhdRoot, '../..');
|
|
10
|
+
const cli = path.join(cjhdRoot, 'cj-cocos-license', 'bin', 'cj-license.js');
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(cli)) {
|
|
13
|
+
console.warn('[CJHD License] @cjhd/cj-cocos-license is not installed; keeping unauthorized stubs.');
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const result = childProcess.spawnSync(process.execPath, [
|
|
18
|
+
cli,
|
|
19
|
+
'--mode',
|
|
20
|
+
'install',
|
|
21
|
+
'--soft',
|
|
22
|
+
'--pkg-root',
|
|
23
|
+
pkgRoot
|
|
24
|
+
], {
|
|
25
|
+
cwd: pkgRoot,
|
|
26
|
+
stdio: 'inherit',
|
|
27
|
+
shell: false
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (result.status !== 0) {
|
|
31
|
+
console.warn('[CJHD License] install unlock check did not complete; keeping unauthorized stubs.');
|
|
32
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a���ケǷ��������`��٣�g'E�|�Kʱ`�`َ[|I�
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "cj-encrypted-payload-v1",
|
|
3
|
+
"packageName": "@cjhd/cj-decimal",
|
|
4
|
+
"packageVersion": "1.1.2",
|
|
5
|
+
"algorithm": "AES-256-GCM",
|
|
6
|
+
"kdf": "HKDF-SHA256",
|
|
7
|
+
"sourceHash": "ef241625808b93480b2c4e880901e9b8345081fef968b4f4f6669a25bda2cd77",
|
|
8
|
+
"payloadHash": "d6921a00f2e48c3faa51fa369d82d5aa5d45f9463aba87c57ee9f00d698eb926",
|
|
9
|
+
"files": [
|
|
10
|
+
{
|
|
11
|
+
"out": "assets/Decimal.js",
|
|
12
|
+
"bin": "files/assets__Decimal.js.bin",
|
|
13
|
+
"iv": "cRNtEXix0DUozEka",
|
|
14
|
+
"authTag": "sMMEmUaAqR8Z6W8cO3Ej5A==",
|
|
15
|
+
"sha256": "c920e2ec189a291f8afab44929faf901d018c11c7f9d49cf14467f9c9f7646e5"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"out": "index.js",
|
|
19
|
+
"bin": "files/index.js.bin",
|
|
20
|
+
"iv": "qz7+q4JWi8k9IT0/",
|
|
21
|
+
"authTag": "7wQ5pZBy5H1E+oqqjG7juQ==",
|
|
22
|
+
"sha256": "1f4ad00b8da4e8d0a211500507f63f6031ccfb0fb89d2c0e4d8184fc6d1cfa05"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"publicExports": [
|
|
26
|
+
"Decimal"
|
|
27
|
+
],
|
|
28
|
+
"createdAt": "2026-05-20T02:39:02.234Z"
|
|
29
|
+
}
|
package/{index.ts → index.d.ts}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Decimal } from './assets/Decimal';
|
|
2
|
-
export type { IDecimalMutationObserver } from './assets/Decimal';
|
|
1
|
+
export { Decimal } from './assets/Decimal';
|
|
2
|
+
export type { IDecimalMutationObserver } from './assets/Decimal';
|
package/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function __cjLicenseError() {
|
|
2
|
+
throw new Error("[CJHD License] Runtime package is not unlocked. Expected license file: extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-runtime-license.json. Then run: node extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-license.js --mode install --force");
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export { Decimal } from './assets/Decimal.js';
|
|
6
|
+
export function __cj_package_not_unlocked__() { __cjLicenseError(); }
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cjhd/cj-decimal",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"engine": ">=3.8.0",
|
|
3
|
+
"version": "1.1.2",
|
|
5
4
|
"description": "定点数学计算模块",
|
|
6
|
-
"main": "index.
|
|
5
|
+
"main": "./index.js",
|
|
7
6
|
"scripts": {
|
|
8
|
-
"
|
|
7
|
+
"postinstall": "node ./bin/package-postinstall.js"
|
|
9
8
|
},
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
@@ -16,6 +15,43 @@
|
|
|
16
15
|
"registry": "https://registry.npmjs.org"
|
|
17
16
|
},
|
|
18
17
|
"author": "超M <402879660@qq.com>",
|
|
19
|
-
"license": "
|
|
20
|
-
"
|
|
21
|
-
|
|
18
|
+
"license": "SEE LICENSE IN README.md",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"browser": "./index.js",
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./index.d.ts",
|
|
25
|
+
"browser": "./index.js",
|
|
26
|
+
"import": "./index.js",
|
|
27
|
+
"default": "./index.js"
|
|
28
|
+
},
|
|
29
|
+
"./assets/*": {
|
|
30
|
+
"types": "./assets/*.d.ts",
|
|
31
|
+
"browser": "./assets/*.js",
|
|
32
|
+
"import": "./assets/*.js",
|
|
33
|
+
"default": "./assets/*.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"package.json",
|
|
39
|
+
"README.md",
|
|
40
|
+
"index.d.ts",
|
|
41
|
+
"index.js",
|
|
42
|
+
"assets/**/*.d.ts",
|
|
43
|
+
"assets/**/*.js",
|
|
44
|
+
"encrypted-payload/**",
|
|
45
|
+
"bin/**",
|
|
46
|
+
".cj-package.json"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@cjhd/cj-cocos-license": "^1.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@cjhd/cj-cocos-license": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|