@takumi-rs/core 2.15.0 → 2.15.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/dist/export.cjs +66 -30
- package/dist/export.mjs +66 -30
- package/index.d.ts +3 -3
- package/package.json +10 -10
package/dist/export.cjs
CHANGED
|
@@ -59,7 +59,7 @@ function requireNative() {
|
|
|
59
59
|
try {
|
|
60
60
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/core.android-arm64.node");
|
|
61
61
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/package.json").version;
|
|
62
|
-
if (bindingPackageVersion !== "2.15.
|
|
62
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
63
63
|
return binding;
|
|
64
64
|
} catch (e) {
|
|
65
65
|
loadErrors.push(e);
|
|
@@ -73,7 +73,7 @@ function requireNative() {
|
|
|
73
73
|
try {
|
|
74
74
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/core.android-arm-eabi.node");
|
|
75
75
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/package.json").version;
|
|
76
|
-
if (bindingPackageVersion !== "2.15.
|
|
76
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
77
77
|
return binding;
|
|
78
78
|
} catch (e) {
|
|
79
79
|
loadErrors.push(e);
|
|
@@ -90,7 +90,7 @@ function requireNative() {
|
|
|
90
90
|
try {
|
|
91
91
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/core.win32-x64-gnu.node");
|
|
92
92
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/package.json").version;
|
|
93
|
-
if (bindingPackageVersion !== "2.15.
|
|
93
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
94
94
|
return binding;
|
|
95
95
|
} catch (e) {
|
|
96
96
|
loadErrors.push(e);
|
|
@@ -104,7 +104,7 @@ function requireNative() {
|
|
|
104
104
|
try {
|
|
105
105
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/core.win32-x64-msvc.node");
|
|
106
106
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/package.json").version;
|
|
107
|
-
if (bindingPackageVersion !== "2.15.
|
|
107
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
108
108
|
return binding;
|
|
109
109
|
} catch (e) {
|
|
110
110
|
loadErrors.push(e);
|
|
@@ -119,7 +119,7 @@ function requireNative() {
|
|
|
119
119
|
try {
|
|
120
120
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/core.win32-ia32-msvc.node");
|
|
121
121
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/package.json").version;
|
|
122
|
-
if (bindingPackageVersion !== "2.15.
|
|
122
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
123
123
|
return binding;
|
|
124
124
|
} catch (e) {
|
|
125
125
|
loadErrors.push(e);
|
|
@@ -133,7 +133,7 @@ function requireNative() {
|
|
|
133
133
|
try {
|
|
134
134
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/core.win32-arm64-msvc.node");
|
|
135
135
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/package.json").version;
|
|
136
|
-
if (bindingPackageVersion !== "2.15.
|
|
136
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
137
137
|
return binding;
|
|
138
138
|
} catch (e) {
|
|
139
139
|
loadErrors.push(e);
|
|
@@ -148,7 +148,7 @@ function requireNative() {
|
|
|
148
148
|
try {
|
|
149
149
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/core.darwin-universal.node");
|
|
150
150
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/package.json").version;
|
|
151
|
-
if (bindingPackageVersion !== "2.15.
|
|
151
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
152
152
|
return binding;
|
|
153
153
|
} catch (e) {
|
|
154
154
|
loadErrors.push(e);
|
|
@@ -162,7 +162,7 @@ function requireNative() {
|
|
|
162
162
|
try {
|
|
163
163
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/core.darwin-x64.node");
|
|
164
164
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/package.json").version;
|
|
165
|
-
if (bindingPackageVersion !== "2.15.
|
|
165
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
166
166
|
return binding;
|
|
167
167
|
} catch (e) {
|
|
168
168
|
loadErrors.push(e);
|
|
@@ -176,7 +176,7 @@ function requireNative() {
|
|
|
176
176
|
try {
|
|
177
177
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/core.darwin-arm64.node");
|
|
178
178
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/package.json").version;
|
|
179
|
-
if (bindingPackageVersion !== "2.15.
|
|
179
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
180
180
|
return binding;
|
|
181
181
|
} catch (e) {
|
|
182
182
|
loadErrors.push(e);
|
|
@@ -192,7 +192,7 @@ function requireNative() {
|
|
|
192
192
|
try {
|
|
193
193
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/core.freebsd-x64.node");
|
|
194
194
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/package.json").version;
|
|
195
|
-
if (bindingPackageVersion !== "2.15.
|
|
195
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
196
196
|
return binding;
|
|
197
197
|
} catch (e) {
|
|
198
198
|
loadErrors.push(e);
|
|
@@ -206,7 +206,7 @@ function requireNative() {
|
|
|
206
206
|
try {
|
|
207
207
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/core.freebsd-arm64.node");
|
|
208
208
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/package.json").version;
|
|
209
|
-
if (bindingPackageVersion !== "2.15.
|
|
209
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
210
210
|
return binding;
|
|
211
211
|
} catch (e) {
|
|
212
212
|
loadErrors.push(e);
|
|
@@ -223,7 +223,7 @@ function requireNative() {
|
|
|
223
223
|
try {
|
|
224
224
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/core.linux-x64-musl.node");
|
|
225
225
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/package.json").version;
|
|
226
|
-
if (bindingPackageVersion !== "2.15.
|
|
226
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
227
227
|
return binding;
|
|
228
228
|
} catch (e) {
|
|
229
229
|
loadErrors.push(e);
|
|
@@ -237,7 +237,7 @@ function requireNative() {
|
|
|
237
237
|
try {
|
|
238
238
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/core.linux-x64-gnu.node");
|
|
239
239
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/package.json").version;
|
|
240
|
-
if (bindingPackageVersion !== "2.15.
|
|
240
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
241
241
|
return binding;
|
|
242
242
|
} catch (e) {
|
|
243
243
|
loadErrors.push(e);
|
|
@@ -253,7 +253,7 @@ function requireNative() {
|
|
|
253
253
|
try {
|
|
254
254
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/core.linux-arm64-musl.node");
|
|
255
255
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/package.json").version;
|
|
256
|
-
if (bindingPackageVersion !== "2.15.
|
|
256
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
257
257
|
return binding;
|
|
258
258
|
} catch (e) {
|
|
259
259
|
loadErrors.push(e);
|
|
@@ -267,7 +267,7 @@ function requireNative() {
|
|
|
267
267
|
try {
|
|
268
268
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/core.linux-arm64-gnu.node");
|
|
269
269
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/package.json").version;
|
|
270
|
-
if (bindingPackageVersion !== "2.15.
|
|
270
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
271
271
|
return binding;
|
|
272
272
|
} catch (e) {
|
|
273
273
|
loadErrors.push(e);
|
|
@@ -283,7 +283,7 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/core.linux-arm-musleabihf.node");
|
|
285
285
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/package.json").version;
|
|
286
|
-
if (bindingPackageVersion !== "2.15.
|
|
286
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
287
287
|
return binding;
|
|
288
288
|
} catch (e) {
|
|
289
289
|
loadErrors.push(e);
|
|
@@ -297,7 +297,7 @@ function requireNative() {
|
|
|
297
297
|
try {
|
|
298
298
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/core.linux-arm-gnueabihf.node");
|
|
299
299
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/package.json").version;
|
|
300
|
-
if (bindingPackageVersion !== "2.15.
|
|
300
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
301
301
|
return binding;
|
|
302
302
|
} catch (e) {
|
|
303
303
|
loadErrors.push(e);
|
|
@@ -313,7 +313,7 @@ function requireNative() {
|
|
|
313
313
|
try {
|
|
314
314
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/core.linux-loong64-musl.node");
|
|
315
315
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/package.json").version;
|
|
316
|
-
if (bindingPackageVersion !== "2.15.
|
|
316
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
317
317
|
return binding;
|
|
318
318
|
} catch (e) {
|
|
319
319
|
loadErrors.push(e);
|
|
@@ -327,7 +327,7 @@ function requireNative() {
|
|
|
327
327
|
try {
|
|
328
328
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/core.linux-loong64-gnu.node");
|
|
329
329
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/package.json").version;
|
|
330
|
-
if (bindingPackageVersion !== "2.15.
|
|
330
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
331
331
|
return binding;
|
|
332
332
|
} catch (e) {
|
|
333
333
|
loadErrors.push(e);
|
|
@@ -343,7 +343,7 @@ function requireNative() {
|
|
|
343
343
|
try {
|
|
344
344
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/core.linux-riscv64-musl.node");
|
|
345
345
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/package.json").version;
|
|
346
|
-
if (bindingPackageVersion !== "2.15.
|
|
346
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
347
347
|
return binding;
|
|
348
348
|
} catch (e) {
|
|
349
349
|
loadErrors.push(e);
|
|
@@ -357,7 +357,7 @@ function requireNative() {
|
|
|
357
357
|
try {
|
|
358
358
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/core.linux-riscv64-gnu.node");
|
|
359
359
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/package.json").version;
|
|
360
|
-
if (bindingPackageVersion !== "2.15.
|
|
360
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
361
361
|
return binding;
|
|
362
362
|
} catch (e) {
|
|
363
363
|
loadErrors.push(e);
|
|
@@ -372,7 +372,7 @@ function requireNative() {
|
|
|
372
372
|
try {
|
|
373
373
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/core.linux-ppc64-gnu.node");
|
|
374
374
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/package.json").version;
|
|
375
|
-
if (bindingPackageVersion !== "2.15.
|
|
375
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
376
376
|
return binding;
|
|
377
377
|
} catch (e) {
|
|
378
378
|
loadErrors.push(e);
|
|
@@ -386,7 +386,7 @@ function requireNative() {
|
|
|
386
386
|
try {
|
|
387
387
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/core.linux-s390x-gnu.node");
|
|
388
388
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/package.json").version;
|
|
389
|
-
if (bindingPackageVersion !== "2.15.
|
|
389
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
390
390
|
return binding;
|
|
391
391
|
} catch (e) {
|
|
392
392
|
loadErrors.push(e);
|
|
@@ -402,7 +402,7 @@ function requireNative() {
|
|
|
402
402
|
try {
|
|
403
403
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/core.openharmony-arm64.node");
|
|
404
404
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/package.json").version;
|
|
405
|
-
if (bindingPackageVersion !== "2.15.
|
|
405
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
406
406
|
return binding;
|
|
407
407
|
} catch (e) {
|
|
408
408
|
loadErrors.push(e);
|
|
@@ -416,7 +416,7 @@ function requireNative() {
|
|
|
416
416
|
try {
|
|
417
417
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/core.openharmony-x64.node");
|
|
418
418
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/package.json").version;
|
|
419
|
-
if (bindingPackageVersion !== "2.15.
|
|
419
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
420
420
|
return binding;
|
|
421
421
|
} catch (e) {
|
|
422
422
|
loadErrors.push(e);
|
|
@@ -430,7 +430,7 @@ function requireNative() {
|
|
|
430
430
|
try {
|
|
431
431
|
const binding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/core.openharmony-arm.node");
|
|
432
432
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/package.json").version;
|
|
433
|
-
if (bindingPackageVersion !== "2.15.
|
|
433
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
434
434
|
return binding;
|
|
435
435
|
} catch (e) {
|
|
436
436
|
loadErrors.push(e);
|
|
@@ -520,7 +520,7 @@ if (!nativeBinding || forceWasi) {
|
|
|
520
520
|
if (!candidateFailed) {
|
|
521
521
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
522
522
|
const bindingPackageVersion = require$1(/* turbopackOptional: true */ "@takumi-rs/core-wasm32-wasi/package.json").version;
|
|
523
|
-
if (bindingPackageVersion !== "2.15.
|
|
523
|
+
if (bindingPackageVersion !== "2.15.2") throw new Error(`WASI binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
524
524
|
}
|
|
525
525
|
wasiBinding = require$1(/* turbopackOptional: true */ "@takumi-rs/core-wasm32-wasi/core.wasm32-wasi.node");
|
|
526
526
|
nativeBinding = wasiBinding;
|
|
@@ -552,6 +552,42 @@ if (!nativeBinding) {
|
|
|
552
552
|
}
|
|
553
553
|
const { Renderer: Renderer$1, AnimationOutputFormat, DitheringAlgorithm, ImageCacheMode, OutputFormat, setGlyphCacheMaxBytes } = nativeBinding;
|
|
554
554
|
//#endregion
|
|
555
|
+
//#region src/node-source.ts
|
|
556
|
+
const LONE_SURROGATE = /\p{Cs}/u;
|
|
557
|
+
/** The most arrays and objects `serde_json` reads nested inside each other. */
|
|
558
|
+
const MAX_DEPTH = 127;
|
|
559
|
+
/**
|
|
560
|
+
* `node` as JSON, which the native side parses off the main thread, when JSON keeps every value
|
|
561
|
+
* in it within {@link MAX_DEPTH}; `node` itself otherwise.
|
|
562
|
+
*/
|
|
563
|
+
function toNativeSource(node) {
|
|
564
|
+
const depths = /* @__PURE__ */ new WeakMap();
|
|
565
|
+
try {
|
|
566
|
+
return JSON.stringify(node, function(key, value) {
|
|
567
|
+
if (this[key] !== value || LONE_SURROGATE.test(key) || !isJsonValue(value)) throw node;
|
|
568
|
+
if (typeof value === "object" && value !== null) {
|
|
569
|
+
const depth = (depths.get(this) ?? 0) + 1;
|
|
570
|
+
if (depth > MAX_DEPTH) throw node;
|
|
571
|
+
depths.set(value, depth);
|
|
572
|
+
}
|
|
573
|
+
return value ?? null;
|
|
574
|
+
});
|
|
575
|
+
} catch {
|
|
576
|
+
return node;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
/** Whether JSON keeps `value` as the native side reads it from an object. */
|
|
580
|
+
function isJsonValue(value) {
|
|
581
|
+
switch (typeof value) {
|
|
582
|
+
case "string": return !LONE_SURROGATE.test(value);
|
|
583
|
+
case "number": return Number.isFinite(value);
|
|
584
|
+
case "boolean":
|
|
585
|
+
case "undefined": return true;
|
|
586
|
+
case "object": return value === null || Array.isArray(value) || [Object.prototype, null].includes(Object.getPrototypeOf(value));
|
|
587
|
+
default: return false;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
//#endregion
|
|
555
591
|
//#region src/export.ts
|
|
556
592
|
var Renderer = class {
|
|
557
593
|
inner;
|
|
@@ -562,15 +598,15 @@ var Renderer = class {
|
|
|
562
598
|
}
|
|
563
599
|
async render(node, options) {
|
|
564
600
|
const { options: opts, signal } = await (0, _takumi_rs_helpers_renderer.prepareRenderInput)(this.fonts, options ?? {}, node);
|
|
565
|
-
return this.inner.render(node, opts, signal);
|
|
601
|
+
return this.inner.render(toNativeSource(node), opts, signal);
|
|
566
602
|
}
|
|
567
603
|
async renderSvg(node, options) {
|
|
568
604
|
const { options: opts, signal } = await (0, _takumi_rs_helpers_renderer.prepareRenderInput)(this.fonts, options ?? {}, node);
|
|
569
|
-
return this.inner.renderSvg(node, opts, signal);
|
|
605
|
+
return this.inner.renderSvg(toNativeSource(node), opts, signal);
|
|
570
606
|
}
|
|
571
607
|
async measure(node, options) {
|
|
572
608
|
const { options: opts, signal } = await (0, _takumi_rs_helpers_renderer.prepareRenderInput)(this.fonts, options ?? {}, node);
|
|
573
|
-
return this.inner.measure(node, opts, signal);
|
|
609
|
+
return this.inner.measure(toNativeSource(node), opts, signal);
|
|
574
610
|
}
|
|
575
611
|
async renderAnimation(options) {
|
|
576
612
|
const nodes = options.scenes.map((scene) => scene.node);
|
package/dist/export.mjs
CHANGED
|
@@ -58,7 +58,7 @@ function requireNative() {
|
|
|
58
58
|
try {
|
|
59
59
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/core.android-arm64.node");
|
|
60
60
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm64/package.json").version;
|
|
61
|
-
if (bindingPackageVersion !== "2.15.
|
|
61
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
62
62
|
return binding;
|
|
63
63
|
} catch (e) {
|
|
64
64
|
loadErrors.push(e);
|
|
@@ -72,7 +72,7 @@ function requireNative() {
|
|
|
72
72
|
try {
|
|
73
73
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/core.android-arm-eabi.node");
|
|
74
74
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-android-arm-eabi/package.json").version;
|
|
75
|
-
if (bindingPackageVersion !== "2.15.
|
|
75
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
76
76
|
return binding;
|
|
77
77
|
} catch (e) {
|
|
78
78
|
loadErrors.push(e);
|
|
@@ -89,7 +89,7 @@ function requireNative() {
|
|
|
89
89
|
try {
|
|
90
90
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/core.win32-x64-gnu.node");
|
|
91
91
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-gnu/package.json").version;
|
|
92
|
-
if (bindingPackageVersion !== "2.15.
|
|
92
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
93
93
|
return binding;
|
|
94
94
|
} catch (e) {
|
|
95
95
|
loadErrors.push(e);
|
|
@@ -103,7 +103,7 @@ function requireNative() {
|
|
|
103
103
|
try {
|
|
104
104
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/core.win32-x64-msvc.node");
|
|
105
105
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-x64-msvc/package.json").version;
|
|
106
|
-
if (bindingPackageVersion !== "2.15.
|
|
106
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
107
107
|
return binding;
|
|
108
108
|
} catch (e) {
|
|
109
109
|
loadErrors.push(e);
|
|
@@ -118,7 +118,7 @@ function requireNative() {
|
|
|
118
118
|
try {
|
|
119
119
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/core.win32-ia32-msvc.node");
|
|
120
120
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-ia32-msvc/package.json").version;
|
|
121
|
-
if (bindingPackageVersion !== "2.15.
|
|
121
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
122
122
|
return binding;
|
|
123
123
|
} catch (e) {
|
|
124
124
|
loadErrors.push(e);
|
|
@@ -132,7 +132,7 @@ function requireNative() {
|
|
|
132
132
|
try {
|
|
133
133
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/core.win32-arm64-msvc.node");
|
|
134
134
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-win32-arm64-msvc/package.json").version;
|
|
135
|
-
if (bindingPackageVersion !== "2.15.
|
|
135
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
136
136
|
return binding;
|
|
137
137
|
} catch (e) {
|
|
138
138
|
loadErrors.push(e);
|
|
@@ -147,7 +147,7 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/core.darwin-universal.node");
|
|
149
149
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-universal/package.json").version;
|
|
150
|
-
if (bindingPackageVersion !== "2.15.
|
|
150
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
151
151
|
return binding;
|
|
152
152
|
} catch (e) {
|
|
153
153
|
loadErrors.push(e);
|
|
@@ -161,7 +161,7 @@ function requireNative() {
|
|
|
161
161
|
try {
|
|
162
162
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/core.darwin-x64.node");
|
|
163
163
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-x64/package.json").version;
|
|
164
|
-
if (bindingPackageVersion !== "2.15.
|
|
164
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
165
165
|
return binding;
|
|
166
166
|
} catch (e) {
|
|
167
167
|
loadErrors.push(e);
|
|
@@ -175,7 +175,7 @@ function requireNative() {
|
|
|
175
175
|
try {
|
|
176
176
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/core.darwin-arm64.node");
|
|
177
177
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-darwin-arm64/package.json").version;
|
|
178
|
-
if (bindingPackageVersion !== "2.15.
|
|
178
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
179
179
|
return binding;
|
|
180
180
|
} catch (e) {
|
|
181
181
|
loadErrors.push(e);
|
|
@@ -191,7 +191,7 @@ function requireNative() {
|
|
|
191
191
|
try {
|
|
192
192
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/core.freebsd-x64.node");
|
|
193
193
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-x64/package.json").version;
|
|
194
|
-
if (bindingPackageVersion !== "2.15.
|
|
194
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
195
195
|
return binding;
|
|
196
196
|
} catch (e) {
|
|
197
197
|
loadErrors.push(e);
|
|
@@ -205,7 +205,7 @@ function requireNative() {
|
|
|
205
205
|
try {
|
|
206
206
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/core.freebsd-arm64.node");
|
|
207
207
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-freebsd-arm64/package.json").version;
|
|
208
|
-
if (bindingPackageVersion !== "2.15.
|
|
208
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
209
209
|
return binding;
|
|
210
210
|
} catch (e) {
|
|
211
211
|
loadErrors.push(e);
|
|
@@ -222,7 +222,7 @@ function requireNative() {
|
|
|
222
222
|
try {
|
|
223
223
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/core.linux-x64-musl.node");
|
|
224
224
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-musl/package.json").version;
|
|
225
|
-
if (bindingPackageVersion !== "2.15.
|
|
225
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
226
226
|
return binding;
|
|
227
227
|
} catch (e) {
|
|
228
228
|
loadErrors.push(e);
|
|
@@ -236,7 +236,7 @@ function requireNative() {
|
|
|
236
236
|
try {
|
|
237
237
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/core.linux-x64-gnu.node");
|
|
238
238
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-x64-gnu/package.json").version;
|
|
239
|
-
if (bindingPackageVersion !== "2.15.
|
|
239
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
240
240
|
return binding;
|
|
241
241
|
} catch (e) {
|
|
242
242
|
loadErrors.push(e);
|
|
@@ -252,7 +252,7 @@ function requireNative() {
|
|
|
252
252
|
try {
|
|
253
253
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/core.linux-arm64-musl.node");
|
|
254
254
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-musl/package.json").version;
|
|
255
|
-
if (bindingPackageVersion !== "2.15.
|
|
255
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
256
256
|
return binding;
|
|
257
257
|
} catch (e) {
|
|
258
258
|
loadErrors.push(e);
|
|
@@ -266,7 +266,7 @@ function requireNative() {
|
|
|
266
266
|
try {
|
|
267
267
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/core.linux-arm64-gnu.node");
|
|
268
268
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm64-gnu/package.json").version;
|
|
269
|
-
if (bindingPackageVersion !== "2.15.
|
|
269
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
270
270
|
return binding;
|
|
271
271
|
} catch (e) {
|
|
272
272
|
loadErrors.push(e);
|
|
@@ -282,7 +282,7 @@ function requireNative() {
|
|
|
282
282
|
try {
|
|
283
283
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/core.linux-arm-musleabihf.node");
|
|
284
284
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-musleabihf/package.json").version;
|
|
285
|
-
if (bindingPackageVersion !== "2.15.
|
|
285
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
286
286
|
return binding;
|
|
287
287
|
} catch (e) {
|
|
288
288
|
loadErrors.push(e);
|
|
@@ -296,7 +296,7 @@ function requireNative() {
|
|
|
296
296
|
try {
|
|
297
297
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/core.linux-arm-gnueabihf.node");
|
|
298
298
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-arm-gnueabihf/package.json").version;
|
|
299
|
-
if (bindingPackageVersion !== "2.15.
|
|
299
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
300
300
|
return binding;
|
|
301
301
|
} catch (e) {
|
|
302
302
|
loadErrors.push(e);
|
|
@@ -312,7 +312,7 @@ function requireNative() {
|
|
|
312
312
|
try {
|
|
313
313
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/core.linux-loong64-musl.node");
|
|
314
314
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-musl/package.json").version;
|
|
315
|
-
if (bindingPackageVersion !== "2.15.
|
|
315
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
316
316
|
return binding;
|
|
317
317
|
} catch (e) {
|
|
318
318
|
loadErrors.push(e);
|
|
@@ -326,7 +326,7 @@ function requireNative() {
|
|
|
326
326
|
try {
|
|
327
327
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/core.linux-loong64-gnu.node");
|
|
328
328
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-loong64-gnu/package.json").version;
|
|
329
|
-
if (bindingPackageVersion !== "2.15.
|
|
329
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
330
330
|
return binding;
|
|
331
331
|
} catch (e) {
|
|
332
332
|
loadErrors.push(e);
|
|
@@ -342,7 +342,7 @@ function requireNative() {
|
|
|
342
342
|
try {
|
|
343
343
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/core.linux-riscv64-musl.node");
|
|
344
344
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-musl/package.json").version;
|
|
345
|
-
if (bindingPackageVersion !== "2.15.
|
|
345
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
346
346
|
return binding;
|
|
347
347
|
} catch (e) {
|
|
348
348
|
loadErrors.push(e);
|
|
@@ -356,7 +356,7 @@ function requireNative() {
|
|
|
356
356
|
try {
|
|
357
357
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/core.linux-riscv64-gnu.node");
|
|
358
358
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-riscv64-gnu/package.json").version;
|
|
359
|
-
if (bindingPackageVersion !== "2.15.
|
|
359
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
360
360
|
return binding;
|
|
361
361
|
} catch (e) {
|
|
362
362
|
loadErrors.push(e);
|
|
@@ -371,7 +371,7 @@ function requireNative() {
|
|
|
371
371
|
try {
|
|
372
372
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/core.linux-ppc64-gnu.node");
|
|
373
373
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-ppc64-gnu/package.json").version;
|
|
374
|
-
if (bindingPackageVersion !== "2.15.
|
|
374
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
375
375
|
return binding;
|
|
376
376
|
} catch (e) {
|
|
377
377
|
loadErrors.push(e);
|
|
@@ -385,7 +385,7 @@ function requireNative() {
|
|
|
385
385
|
try {
|
|
386
386
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/core.linux-s390x-gnu.node");
|
|
387
387
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-linux-s390x-gnu/package.json").version;
|
|
388
|
-
if (bindingPackageVersion !== "2.15.
|
|
388
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
389
389
|
return binding;
|
|
390
390
|
} catch (e) {
|
|
391
391
|
loadErrors.push(e);
|
|
@@ -401,7 +401,7 @@ function requireNative() {
|
|
|
401
401
|
try {
|
|
402
402
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/core.openharmony-arm64.node");
|
|
403
403
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm64/package.json").version;
|
|
404
|
-
if (bindingPackageVersion !== "2.15.
|
|
404
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
405
405
|
return binding;
|
|
406
406
|
} catch (e) {
|
|
407
407
|
loadErrors.push(e);
|
|
@@ -415,7 +415,7 @@ function requireNative() {
|
|
|
415
415
|
try {
|
|
416
416
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/core.openharmony-x64.node");
|
|
417
417
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-x64/package.json").version;
|
|
418
|
-
if (bindingPackageVersion !== "2.15.
|
|
418
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
419
419
|
return binding;
|
|
420
420
|
} catch (e) {
|
|
421
421
|
loadErrors.push(e);
|
|
@@ -429,7 +429,7 @@ function requireNative() {
|
|
|
429
429
|
try {
|
|
430
430
|
const binding = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/core.openharmony-arm.node");
|
|
431
431
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-openharmony-arm/package.json").version;
|
|
432
|
-
if (bindingPackageVersion !== "2.15.
|
|
432
|
+
if (bindingPackageVersion !== "2.15.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
433
433
|
return binding;
|
|
434
434
|
} catch (e) {
|
|
435
435
|
loadErrors.push(e);
|
|
@@ -519,7 +519,7 @@ if (!nativeBinding || forceWasi) {
|
|
|
519
519
|
if (!candidateFailed) {
|
|
520
520
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
521
521
|
const bindingPackageVersion = require(/* turbopackOptional: true */ "@takumi-rs/core-wasm32-wasi/package.json").version;
|
|
522
|
-
if (bindingPackageVersion !== "2.15.
|
|
522
|
+
if (bindingPackageVersion !== "2.15.2") throw new Error(`WASI binding package version mismatch, expected 2.15.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
523
523
|
}
|
|
524
524
|
wasiBinding = require(/* turbopackOptional: true */ "@takumi-rs/core-wasm32-wasi/core.wasm32-wasi.node");
|
|
525
525
|
nativeBinding = wasiBinding;
|
|
@@ -551,6 +551,42 @@ if (!nativeBinding) {
|
|
|
551
551
|
}
|
|
552
552
|
const { Renderer: Renderer$1, AnimationOutputFormat, DitheringAlgorithm, ImageCacheMode, OutputFormat, setGlyphCacheMaxBytes } = nativeBinding;
|
|
553
553
|
//#endregion
|
|
554
|
+
//#region src/node-source.ts
|
|
555
|
+
const LONE_SURROGATE = /\p{Cs}/u;
|
|
556
|
+
/** The most arrays and objects `serde_json` reads nested inside each other. */
|
|
557
|
+
const MAX_DEPTH = 127;
|
|
558
|
+
/**
|
|
559
|
+
* `node` as JSON, which the native side parses off the main thread, when JSON keeps every value
|
|
560
|
+
* in it within {@link MAX_DEPTH}; `node` itself otherwise.
|
|
561
|
+
*/
|
|
562
|
+
function toNativeSource(node) {
|
|
563
|
+
const depths = /* @__PURE__ */ new WeakMap();
|
|
564
|
+
try {
|
|
565
|
+
return JSON.stringify(node, function(key, value) {
|
|
566
|
+
if (this[key] !== value || LONE_SURROGATE.test(key) || !isJsonValue(value)) throw node;
|
|
567
|
+
if (typeof value === "object" && value !== null) {
|
|
568
|
+
const depth = (depths.get(this) ?? 0) + 1;
|
|
569
|
+
if (depth > MAX_DEPTH) throw node;
|
|
570
|
+
depths.set(value, depth);
|
|
571
|
+
}
|
|
572
|
+
return value ?? null;
|
|
573
|
+
});
|
|
574
|
+
} catch {
|
|
575
|
+
return node;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
/** Whether JSON keeps `value` as the native side reads it from an object. */
|
|
579
|
+
function isJsonValue(value) {
|
|
580
|
+
switch (typeof value) {
|
|
581
|
+
case "string": return !LONE_SURROGATE.test(value);
|
|
582
|
+
case "number": return Number.isFinite(value);
|
|
583
|
+
case "boolean":
|
|
584
|
+
case "undefined": return true;
|
|
585
|
+
case "object": return value === null || Array.isArray(value) || [Object.prototype, null].includes(Object.getPrototypeOf(value));
|
|
586
|
+
default: return false;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
554
590
|
//#region src/export.ts
|
|
555
591
|
var Renderer = class {
|
|
556
592
|
inner;
|
|
@@ -561,15 +597,15 @@ var Renderer = class {
|
|
|
561
597
|
}
|
|
562
598
|
async render(node, options) {
|
|
563
599
|
const { options: opts, signal } = await prepareRenderInput(this.fonts, options ?? {}, node);
|
|
564
|
-
return this.inner.render(node, opts, signal);
|
|
600
|
+
return this.inner.render(toNativeSource(node), opts, signal);
|
|
565
601
|
}
|
|
566
602
|
async renderSvg(node, options) {
|
|
567
603
|
const { options: opts, signal } = await prepareRenderInput(this.fonts, options ?? {}, node);
|
|
568
|
-
return this.inner.renderSvg(node, opts, signal);
|
|
604
|
+
return this.inner.renderSvg(toNativeSource(node), opts, signal);
|
|
569
605
|
}
|
|
570
606
|
async measure(node, options) {
|
|
571
607
|
const { options: opts, signal } = await prepareRenderInput(this.fonts, options ?? {}, node);
|
|
572
|
-
return this.inner.measure(node, opts, signal);
|
|
608
|
+
return this.inner.measure(toNativeSource(node), opts, signal);
|
|
573
609
|
}
|
|
574
610
|
async renderAnimation(options) {
|
|
575
611
|
const nodes = options.scenes.map((scene) => scene.node);
|
package/index.d.ts
CHANGED
|
@@ -83,11 +83,11 @@ export declare class Renderer {
|
|
|
83
83
|
/** Register font into the renderer, returning the families produced. */
|
|
84
84
|
registerFont(fonts: Font, signal?: AbortSignal): Promise<RegisteredFamily[]>
|
|
85
85
|
/** Renders a node tree into an image buffer asynchronously. */
|
|
86
|
-
render(source: Node, options?: RenderOptions, signal?: AbortSignal): Promise<Buffer<ArrayBuffer>>
|
|
86
|
+
render(source: Node | string, options?: RenderOptions, signal?: AbortSignal): Promise<Buffer<ArrayBuffer>>
|
|
87
87
|
/** Renders a node tree into an SVG document string asynchronously. */
|
|
88
|
-
renderSvg(source: Node, options?: SvgRenderOptions, signal?: AbortSignal): Promise<string>
|
|
88
|
+
renderSvg(source: Node | string, options?: SvgRenderOptions, signal?: AbortSignal): Promise<string>
|
|
89
89
|
/** Measures a node tree and returns layout information asynchronously. */
|
|
90
|
-
measure(source: Node, options?: RenderOptions, signal?: AbortSignal): Promise<MeasuredNode>
|
|
90
|
+
measure(source: Node | string, options?: RenderOptions, signal?: AbortSignal): Promise<MeasuredNode>
|
|
91
91
|
/** Renders a sequential scene animation into a buffer asynchronously. */
|
|
92
92
|
renderAnimation(options: RenderAnimationOptions, signal?: AbortSignal): Promise<Buffer<ArrayBuffer>>
|
|
93
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/core",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.2",
|
|
4
4
|
"description": "Render OG images from Takumi node trees with native Node.js bindings. No headless browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"publish-lint": "attw --pack . && publint --strict ."
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@takumi-rs/helpers": "2.15.
|
|
72
|
+
"@takumi-rs/helpers": "2.15.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@napi-rs/cli": "3.9.0",
|
|
@@ -108,13 +108,13 @@
|
|
|
108
108
|
"node": ">=18"
|
|
109
109
|
},
|
|
110
110
|
"optionalDependencies": {
|
|
111
|
-
"@takumi-rs/core-darwin-x64": "2.15.
|
|
112
|
-
"@takumi-rs/core-darwin-arm64": "2.15.
|
|
113
|
-
"@takumi-rs/core-linux-arm64-gnu": "2.15.
|
|
114
|
-
"@takumi-rs/core-linux-arm64-musl": "2.15.
|
|
115
|
-
"@takumi-rs/core-win32-arm64-msvc": "2.15.
|
|
116
|
-
"@takumi-rs/core-linux-x64-gnu": "2.15.
|
|
117
|
-
"@takumi-rs/core-linux-x64-musl": "2.15.
|
|
118
|
-
"@takumi-rs/core-win32-x64-msvc": "2.15.
|
|
111
|
+
"@takumi-rs/core-darwin-x64": "2.15.2",
|
|
112
|
+
"@takumi-rs/core-darwin-arm64": "2.15.2",
|
|
113
|
+
"@takumi-rs/core-linux-arm64-gnu": "2.15.2",
|
|
114
|
+
"@takumi-rs/core-linux-arm64-musl": "2.15.2",
|
|
115
|
+
"@takumi-rs/core-win32-arm64-msvc": "2.15.2",
|
|
116
|
+
"@takumi-rs/core-linux-x64-gnu": "2.15.2",
|
|
117
|
+
"@takumi-rs/core-linux-x64-musl": "2.15.2",
|
|
118
|
+
"@takumi-rs/core-win32-x64-msvc": "2.15.2"
|
|
119
119
|
}
|
|
120
120
|
}
|