@vercel/og 0.6.0 → 0.6.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/figma/index.d.ts +2 -2
- package/dist/index.edge.d.ts +1 -0
- package/dist/index.edge.js +73 -129
- package/dist/index.edge.js.map +1 -1
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.js +73 -129
- package/dist/index.node.js.map +1 -1
- package/dist/resvg.wasm +0 -0
- package/package.json +2 -2
- package/dist/index.edge.types.d.ts +0 -2
- package/dist/index.node.types.d.ts +0 -2
package/dist/index.node.d.ts
CHANGED
|
@@ -24,3 +24,4 @@ export declare class ImageResponse extends Response {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function unstable_createNodejsStream(element: ReactElement, options?: Omit<ImageResponseNodeOptions, 'status' | 'statusText' | 'headers'>): Promise<Readable>;
|
|
26
26
|
export declare const experimental_FigmaImageResponse: (props: FigmaImageResponseProps) => Promise<import("./index.edge").ImageResponse>;
|
|
27
|
+
export declare type NodeImageResponse = typeof ImageResponse;
|
package/dist/index.node.js
CHANGED
|
@@ -18135,7 +18135,7 @@ async function initYoga(t) {
|
|
|
18135
18135
|
return wrapAsm(r);
|
|
18136
18136
|
}
|
|
18137
18137
|
|
|
18138
|
-
// node_modules/.pnpm/@resvg+resvg-wasm@2.
|
|
18138
|
+
// node_modules/.pnpm/@resvg+resvg-wasm@2.4.0/node_modules/@resvg/resvg-wasm/index.mjs
|
|
18139
18139
|
var resvg_wasm_exports = {};
|
|
18140
18140
|
__export(resvg_wasm_exports, {
|
|
18141
18141
|
Resvg: () => Resvg2,
|
|
@@ -18175,9 +18175,7 @@ function getUint8Memory0() {
|
|
|
18175
18175
|
}
|
|
18176
18176
|
return cachedUint8Memory0;
|
|
18177
18177
|
}
|
|
18178
|
-
var cachedTextEncoder =
|
|
18179
|
-
throw Error("TextEncoder not available");
|
|
18180
|
-
} };
|
|
18178
|
+
var cachedTextEncoder = new TextEncoder("utf-8");
|
|
18181
18179
|
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
18182
18180
|
return cachedTextEncoder.encodeInto(arg, view);
|
|
18183
18181
|
} : function(arg, view) {
|
|
@@ -18191,13 +18189,13 @@ var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function
|
|
|
18191
18189
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
18192
18190
|
if (realloc === void 0) {
|
|
18193
18191
|
const buf = cachedTextEncoder.encode(arg);
|
|
18194
|
-
const ptr2 = malloc(buf.length
|
|
18192
|
+
const ptr2 = malloc(buf.length);
|
|
18195
18193
|
getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
18196
18194
|
WASM_VECTOR_LEN = buf.length;
|
|
18197
18195
|
return ptr2;
|
|
18198
18196
|
}
|
|
18199
18197
|
let len = arg.length;
|
|
18200
|
-
let ptr = malloc(len
|
|
18198
|
+
let ptr = malloc(len);
|
|
18201
18199
|
const mem = getUint8Memory0();
|
|
18202
18200
|
let offset = 0;
|
|
18203
18201
|
for (; offset < len; offset++) {
|
|
@@ -18210,7 +18208,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
18210
18208
|
if (offset !== 0) {
|
|
18211
18209
|
arg = arg.slice(offset);
|
|
18212
18210
|
}
|
|
18213
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3
|
|
18211
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
18214
18212
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
18215
18213
|
const ret = encodeString(arg, view);
|
|
18216
18214
|
offset += ret.written;
|
|
@@ -18228,14 +18226,9 @@ function getInt32Memory0() {
|
|
|
18228
18226
|
}
|
|
18229
18227
|
return cachedInt32Memory0;
|
|
18230
18228
|
}
|
|
18231
|
-
var cachedTextDecoder =
|
|
18232
|
-
|
|
18233
|
-
} };
|
|
18234
|
-
if (typeof TextDecoder !== "undefined") {
|
|
18235
|
-
cachedTextDecoder.decode();
|
|
18236
|
-
}
|
|
18229
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
18230
|
+
cachedTextDecoder.decode();
|
|
18237
18231
|
function getStringFromWasm0(ptr, len) {
|
|
18238
|
-
ptr = ptr >>> 0;
|
|
18239
18232
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
18240
18233
|
}
|
|
18241
18234
|
function _assertClass(instance, klass) {
|
|
@@ -18244,23 +18237,15 @@ function _assertClass(instance, klass) {
|
|
|
18244
18237
|
}
|
|
18245
18238
|
return instance.ptr;
|
|
18246
18239
|
}
|
|
18247
|
-
|
|
18248
|
-
try {
|
|
18249
|
-
return f.apply(this, args);
|
|
18250
|
-
} catch (e) {
|
|
18251
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
18252
|
-
}
|
|
18253
|
-
}
|
|
18254
|
-
var BBox = class _BBox {
|
|
18240
|
+
var BBox = class {
|
|
18255
18241
|
static __wrap(ptr) {
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
obj.__wbg_ptr = ptr;
|
|
18242
|
+
const obj = Object.create(BBox.prototype);
|
|
18243
|
+
obj.ptr = ptr;
|
|
18259
18244
|
return obj;
|
|
18260
18245
|
}
|
|
18261
18246
|
__destroy_into_raw() {
|
|
18262
|
-
const ptr = this.
|
|
18263
|
-
this.
|
|
18247
|
+
const ptr = this.ptr;
|
|
18248
|
+
this.ptr = 0;
|
|
18264
18249
|
return ptr;
|
|
18265
18250
|
}
|
|
18266
18251
|
free() {
|
|
@@ -18268,44 +18253,43 @@ var BBox = class _BBox {
|
|
|
18268
18253
|
wasm.__wbg_bbox_free(ptr);
|
|
18269
18254
|
}
|
|
18270
18255
|
get x() {
|
|
18271
|
-
const ret = wasm.__wbg_get_bbox_x(this.
|
|
18256
|
+
const ret = wasm.__wbg_get_bbox_x(this.ptr);
|
|
18272
18257
|
return ret;
|
|
18273
18258
|
}
|
|
18274
18259
|
set x(arg0) {
|
|
18275
|
-
wasm.__wbg_set_bbox_x(this.
|
|
18260
|
+
wasm.__wbg_set_bbox_x(this.ptr, arg0);
|
|
18276
18261
|
}
|
|
18277
18262
|
get y() {
|
|
18278
|
-
const ret = wasm.__wbg_get_bbox_y(this.
|
|
18263
|
+
const ret = wasm.__wbg_get_bbox_y(this.ptr);
|
|
18279
18264
|
return ret;
|
|
18280
18265
|
}
|
|
18281
18266
|
set y(arg0) {
|
|
18282
|
-
wasm.__wbg_set_bbox_y(this.
|
|
18267
|
+
wasm.__wbg_set_bbox_y(this.ptr, arg0);
|
|
18283
18268
|
}
|
|
18284
18269
|
get width() {
|
|
18285
|
-
const ret = wasm.__wbg_get_bbox_width(this.
|
|
18270
|
+
const ret = wasm.__wbg_get_bbox_width(this.ptr);
|
|
18286
18271
|
return ret;
|
|
18287
18272
|
}
|
|
18288
18273
|
set width(arg0) {
|
|
18289
|
-
wasm.__wbg_set_bbox_width(this.
|
|
18274
|
+
wasm.__wbg_set_bbox_width(this.ptr, arg0);
|
|
18290
18275
|
}
|
|
18291
18276
|
get height() {
|
|
18292
|
-
const ret = wasm.__wbg_get_bbox_height(this.
|
|
18277
|
+
const ret = wasm.__wbg_get_bbox_height(this.ptr);
|
|
18293
18278
|
return ret;
|
|
18294
18279
|
}
|
|
18295
18280
|
set height(arg0) {
|
|
18296
|
-
wasm.__wbg_set_bbox_height(this.
|
|
18281
|
+
wasm.__wbg_set_bbox_height(this.ptr, arg0);
|
|
18297
18282
|
}
|
|
18298
18283
|
};
|
|
18299
|
-
var RenderedImage = class
|
|
18284
|
+
var RenderedImage = class {
|
|
18300
18285
|
static __wrap(ptr) {
|
|
18301
|
-
|
|
18302
|
-
|
|
18303
|
-
obj.__wbg_ptr = ptr;
|
|
18286
|
+
const obj = Object.create(RenderedImage.prototype);
|
|
18287
|
+
obj.ptr = ptr;
|
|
18304
18288
|
return obj;
|
|
18305
18289
|
}
|
|
18306
18290
|
__destroy_into_raw() {
|
|
18307
|
-
const ptr = this.
|
|
18308
|
-
this.
|
|
18291
|
+
const ptr = this.ptr;
|
|
18292
|
+
this.ptr = 0;
|
|
18309
18293
|
return ptr;
|
|
18310
18294
|
}
|
|
18311
18295
|
free() {
|
|
@@ -18313,17 +18297,17 @@ var RenderedImage = class _RenderedImage {
|
|
|
18313
18297
|
wasm.__wbg_renderedimage_free(ptr);
|
|
18314
18298
|
}
|
|
18315
18299
|
get width() {
|
|
18316
|
-
const ret = wasm.renderedimage_width(this.
|
|
18300
|
+
const ret = wasm.renderedimage_width(this.ptr);
|
|
18317
18301
|
return ret >>> 0;
|
|
18318
18302
|
}
|
|
18319
18303
|
get height() {
|
|
18320
|
-
const ret = wasm.renderedimage_height(this.
|
|
18304
|
+
const ret = wasm.renderedimage_height(this.ptr);
|
|
18321
18305
|
return ret >>> 0;
|
|
18322
18306
|
}
|
|
18323
18307
|
asPng() {
|
|
18324
18308
|
try {
|
|
18325
18309
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18326
|
-
wasm.renderedimage_asPng(retptr, this.
|
|
18310
|
+
wasm.renderedimage_asPng(retptr, this.ptr);
|
|
18327
18311
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18328
18312
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18329
18313
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -18336,55 +18320,54 @@ var RenderedImage = class _RenderedImage {
|
|
|
18336
18320
|
}
|
|
18337
18321
|
}
|
|
18338
18322
|
get pixels() {
|
|
18339
|
-
const ret = wasm.renderedimage_pixels(this.
|
|
18323
|
+
const ret = wasm.renderedimage_pixels(this.ptr);
|
|
18340
18324
|
return takeObject(ret);
|
|
18341
18325
|
}
|
|
18342
18326
|
};
|
|
18343
|
-
var Resvg = class
|
|
18327
|
+
var Resvg = class {
|
|
18344
18328
|
static __wrap(ptr) {
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
obj.__wbg_ptr = ptr;
|
|
18329
|
+
const obj = Object.create(Resvg.prototype);
|
|
18330
|
+
obj.ptr = ptr;
|
|
18348
18331
|
return obj;
|
|
18349
18332
|
}
|
|
18350
18333
|
__destroy_into_raw() {
|
|
18351
|
-
const ptr = this.
|
|
18352
|
-
this.
|
|
18334
|
+
const ptr = this.ptr;
|
|
18335
|
+
this.ptr = 0;
|
|
18353
18336
|
return ptr;
|
|
18354
18337
|
}
|
|
18355
18338
|
free() {
|
|
18356
18339
|
const ptr = this.__destroy_into_raw();
|
|
18357
18340
|
wasm.__wbg_resvg_free(ptr);
|
|
18358
18341
|
}
|
|
18359
|
-
constructor(svg, options
|
|
18342
|
+
constructor(svg, options) {
|
|
18360
18343
|
try {
|
|
18361
18344
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18362
18345
|
var ptr0 = isLikeNone(options) ? 0 : passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18363
18346
|
var len0 = WASM_VECTOR_LEN;
|
|
18364
|
-
wasm.resvg_new(retptr, addHeapObject(svg), ptr0, len0
|
|
18347
|
+
wasm.resvg_new(retptr, addHeapObject(svg), ptr0, len0);
|
|
18365
18348
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18366
18349
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18367
18350
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
18368
18351
|
if (r2) {
|
|
18369
18352
|
throw takeObject(r1);
|
|
18370
18353
|
}
|
|
18371
|
-
return
|
|
18354
|
+
return Resvg.__wrap(r0);
|
|
18372
18355
|
} finally {
|
|
18373
18356
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
18374
18357
|
}
|
|
18375
18358
|
}
|
|
18376
18359
|
get width() {
|
|
18377
|
-
const ret = wasm.resvg_width(this.
|
|
18360
|
+
const ret = wasm.resvg_width(this.ptr);
|
|
18378
18361
|
return ret;
|
|
18379
18362
|
}
|
|
18380
18363
|
get height() {
|
|
18381
|
-
const ret = wasm.resvg_height(this.
|
|
18364
|
+
const ret = wasm.resvg_height(this.ptr);
|
|
18382
18365
|
return ret;
|
|
18383
18366
|
}
|
|
18384
18367
|
render() {
|
|
18385
18368
|
try {
|
|
18386
18369
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18387
|
-
wasm.resvg_render(retptr, this.
|
|
18370
|
+
wasm.resvg_render(retptr, this.ptr);
|
|
18388
18371
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18389
18372
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18390
18373
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -18397,37 +18380,33 @@ var Resvg = class _Resvg {
|
|
|
18397
18380
|
}
|
|
18398
18381
|
}
|
|
18399
18382
|
toString() {
|
|
18400
|
-
let deferred1_0;
|
|
18401
|
-
let deferred1_1;
|
|
18402
18383
|
try {
|
|
18403
18384
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18404
|
-
wasm.resvg_toString(retptr, this.
|
|
18385
|
+
wasm.resvg_toString(retptr, this.ptr);
|
|
18405
18386
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18406
18387
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18407
|
-
deferred1_0 = r0;
|
|
18408
|
-
deferred1_1 = r1;
|
|
18409
18388
|
return getStringFromWasm0(r0, r1);
|
|
18410
18389
|
} finally {
|
|
18411
18390
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
18412
|
-
wasm.__wbindgen_free(
|
|
18391
|
+
wasm.__wbindgen_free(r0, r1);
|
|
18413
18392
|
}
|
|
18414
18393
|
}
|
|
18415
18394
|
innerBBox() {
|
|
18416
|
-
const ret = wasm.resvg_innerBBox(this.
|
|
18395
|
+
const ret = wasm.resvg_innerBBox(this.ptr);
|
|
18417
18396
|
return ret === 0 ? void 0 : BBox.__wrap(ret);
|
|
18418
18397
|
}
|
|
18419
18398
|
getBBox() {
|
|
18420
|
-
const ret = wasm.resvg_getBBox(this.
|
|
18399
|
+
const ret = wasm.resvg_getBBox(this.ptr);
|
|
18421
18400
|
return ret === 0 ? void 0 : BBox.__wrap(ret);
|
|
18422
18401
|
}
|
|
18423
18402
|
cropByBBox(bbox) {
|
|
18424
18403
|
_assertClass(bbox, BBox);
|
|
18425
|
-
wasm.resvg_cropByBBox(this.
|
|
18404
|
+
wasm.resvg_cropByBBox(this.ptr, bbox.ptr);
|
|
18426
18405
|
}
|
|
18427
18406
|
imagesToResolve() {
|
|
18428
18407
|
try {
|
|
18429
18408
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18430
|
-
wasm.resvg_imagesToResolve(retptr, this.
|
|
18409
|
+
wasm.resvg_imagesToResolve(retptr, this.ptr);
|
|
18431
18410
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18432
18411
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18433
18412
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -18444,7 +18423,7 @@ var Resvg = class _Resvg {
|
|
|
18444
18423
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18445
18424
|
const ptr0 = passStringToWasm0(href, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18446
18425
|
const len0 = WASM_VECTOR_LEN;
|
|
18447
|
-
wasm.resvg_resolveImage(retptr, this.
|
|
18426
|
+
wasm.resvg_resolveImage(retptr, this.ptr, ptr0, len0, addHeapObject(buffer));
|
|
18448
18427
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18449
18428
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18450
18429
|
if (r1) {
|
|
@@ -18455,7 +18434,7 @@ var Resvg = class _Resvg {
|
|
|
18455
18434
|
}
|
|
18456
18435
|
}
|
|
18457
18436
|
};
|
|
18458
|
-
async function
|
|
18437
|
+
async function load2(module, imports) {
|
|
18459
18438
|
if (typeof Response === "function" && module instanceof Response) {
|
|
18460
18439
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
18461
18440
|
try {
|
|
@@ -18479,10 +18458,10 @@ async function __wbg_load(module, imports) {
|
|
|
18479
18458
|
}
|
|
18480
18459
|
}
|
|
18481
18460
|
}
|
|
18482
|
-
function
|
|
18461
|
+
function getImports() {
|
|
18483
18462
|
const imports = {};
|
|
18484
18463
|
imports.wbg = {};
|
|
18485
|
-
imports.wbg.
|
|
18464
|
+
imports.wbg.__wbg_new_15d3966e9981a196 = function(arg0, arg1) {
|
|
18486
18465
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
18487
18466
|
return addHeapObject(ret);
|
|
18488
18467
|
};
|
|
@@ -18490,44 +18469,26 @@ function __wbg_get_imports() {
|
|
|
18490
18469
|
const ret = wasm.memory;
|
|
18491
18470
|
return addHeapObject(ret);
|
|
18492
18471
|
};
|
|
18493
|
-
imports.wbg.
|
|
18472
|
+
imports.wbg.__wbg_buffer_cf65c07de34b9a08 = function(arg0) {
|
|
18494
18473
|
const ret = getObject(arg0).buffer;
|
|
18495
18474
|
return addHeapObject(ret);
|
|
18496
18475
|
};
|
|
18497
|
-
imports.wbg.
|
|
18476
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_9fb2f11355ecadf5 = function(arg0, arg1, arg2) {
|
|
18498
18477
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
18499
18478
|
return addHeapObject(ret);
|
|
18500
18479
|
};
|
|
18501
18480
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
18502
18481
|
takeObject(arg0);
|
|
18503
18482
|
};
|
|
18504
|
-
imports.wbg.
|
|
18483
|
+
imports.wbg.__wbg_new_537b7341ce90bb31 = function(arg0) {
|
|
18505
18484
|
const ret = new Uint8Array(getObject(arg0));
|
|
18506
18485
|
return addHeapObject(ret);
|
|
18507
18486
|
};
|
|
18508
|
-
imports.wbg.
|
|
18509
|
-
const ret = getObject(arg0).values();
|
|
18510
|
-
return addHeapObject(ret);
|
|
18511
|
-
};
|
|
18512
|
-
imports.wbg.__wbg_next_ddb3312ca1c4e32a = function() {
|
|
18513
|
-
return handleError(function(arg0) {
|
|
18514
|
-
const ret = getObject(arg0).next();
|
|
18515
|
-
return addHeapObject(ret);
|
|
18516
|
-
}, arguments);
|
|
18517
|
-
};
|
|
18518
|
-
imports.wbg.__wbg_done_5c1f01fb660d73b5 = function(arg0) {
|
|
18519
|
-
const ret = getObject(arg0).done;
|
|
18520
|
-
return ret;
|
|
18521
|
-
};
|
|
18522
|
-
imports.wbg.__wbg_value_1695675138684bd5 = function(arg0) {
|
|
18523
|
-
const ret = getObject(arg0).value;
|
|
18524
|
-
return addHeapObject(ret);
|
|
18525
|
-
};
|
|
18526
|
-
imports.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function(arg0) {
|
|
18487
|
+
imports.wbg.__wbg_instanceof_Uint8Array_01cebe79ca606cca = function(arg0) {
|
|
18527
18488
|
let result;
|
|
18528
18489
|
try {
|
|
18529
18490
|
result = getObject(arg0) instanceof Uint8Array;
|
|
18530
|
-
} catch {
|
|
18491
|
+
} catch (e) {
|
|
18531
18492
|
result = false;
|
|
18532
18493
|
}
|
|
18533
18494
|
const ret = result;
|
|
@@ -18536,12 +18497,12 @@ function __wbg_get_imports() {
|
|
|
18536
18497
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
18537
18498
|
const obj = getObject(arg1);
|
|
18538
18499
|
const ret = typeof obj === "string" ? obj : void 0;
|
|
18539
|
-
var
|
|
18540
|
-
var
|
|
18541
|
-
getInt32Memory0()[arg0 / 4 + 1] =
|
|
18542
|
-
getInt32Memory0()[arg0 / 4 + 0] =
|
|
18500
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18501
|
+
var len0 = WASM_VECTOR_LEN;
|
|
18502
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
18503
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
18543
18504
|
};
|
|
18544
|
-
imports.wbg.
|
|
18505
|
+
imports.wbg.__wbg_new_b525de17f44a8943 = function() {
|
|
18545
18506
|
const ret = new Array();
|
|
18546
18507
|
return addHeapObject(ret);
|
|
18547
18508
|
};
|
|
@@ -18549,15 +18510,15 @@ function __wbg_get_imports() {
|
|
|
18549
18510
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
18550
18511
|
return addHeapObject(ret);
|
|
18551
18512
|
};
|
|
18552
|
-
imports.wbg.
|
|
18513
|
+
imports.wbg.__wbg_push_49c286f04dd3bf59 = function(arg0, arg1) {
|
|
18553
18514
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
18554
18515
|
return ret;
|
|
18555
18516
|
};
|
|
18556
|
-
imports.wbg.
|
|
18517
|
+
imports.wbg.__wbg_length_27a2afe8ab42b09f = function(arg0) {
|
|
18557
18518
|
const ret = getObject(arg0).length;
|
|
18558
18519
|
return ret;
|
|
18559
18520
|
};
|
|
18560
|
-
imports.wbg.
|
|
18521
|
+
imports.wbg.__wbg_set_17499e8aa4003ebd = function(arg0, arg1, arg2) {
|
|
18561
18522
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
18562
18523
|
};
|
|
18563
18524
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
@@ -18565,30 +18526,28 @@ function __wbg_get_imports() {
|
|
|
18565
18526
|
};
|
|
18566
18527
|
return imports;
|
|
18567
18528
|
}
|
|
18568
|
-
function
|
|
18529
|
+
function initMemory(imports, maybe_memory) {
|
|
18569
18530
|
}
|
|
18570
|
-
function
|
|
18531
|
+
function finalizeInit(instance, module) {
|
|
18571
18532
|
wasm = instance.exports;
|
|
18572
|
-
|
|
18533
|
+
init.__wbindgen_wasm_module = module;
|
|
18573
18534
|
cachedInt32Memory0 = null;
|
|
18574
18535
|
cachedUint8Memory0 = null;
|
|
18575
18536
|
return wasm;
|
|
18576
18537
|
}
|
|
18577
|
-
async function
|
|
18578
|
-
if (wasm !== void 0)
|
|
18579
|
-
return wasm;
|
|
18538
|
+
async function init(input) {
|
|
18580
18539
|
if (typeof input === "undefined") {
|
|
18581
18540
|
input = new URL("index_bg.wasm", void 0);
|
|
18582
18541
|
}
|
|
18583
|
-
const imports =
|
|
18542
|
+
const imports = getImports();
|
|
18584
18543
|
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
18585
18544
|
input = fetch(input);
|
|
18586
18545
|
}
|
|
18587
|
-
|
|
18588
|
-
const { instance, module } = await
|
|
18589
|
-
return
|
|
18546
|
+
initMemory(imports);
|
|
18547
|
+
const { instance, module } = await load2(await input, imports);
|
|
18548
|
+
return finalizeInit(instance, module);
|
|
18590
18549
|
}
|
|
18591
|
-
var dist_default =
|
|
18550
|
+
var dist_default = init;
|
|
18592
18551
|
var initialized = false;
|
|
18593
18552
|
var initWasm = async (module_or_path) => {
|
|
18594
18553
|
if (initialized) {
|
|
@@ -18601,24 +18560,9 @@ var Resvg2 = class extends Resvg {
|
|
|
18601
18560
|
constructor(svg, options) {
|
|
18602
18561
|
if (!initialized)
|
|
18603
18562
|
throw new Error("Wasm has not been initialized. Call `initWasm()` function.");
|
|
18604
|
-
|
|
18605
|
-
if (!!font && isCustomFontsOptions(font)) {
|
|
18606
|
-
const serializableOptions = {
|
|
18607
|
-
...options,
|
|
18608
|
-
font: {
|
|
18609
|
-
...font,
|
|
18610
|
-
fontBuffers: void 0
|
|
18611
|
-
}
|
|
18612
|
-
};
|
|
18613
|
-
super(svg, JSON.stringify(serializableOptions), font.fontBuffers);
|
|
18614
|
-
} else {
|
|
18615
|
-
super(svg, JSON.stringify(options));
|
|
18616
|
-
}
|
|
18563
|
+
super(svg, JSON.stringify(options));
|
|
18617
18564
|
}
|
|
18618
18565
|
};
|
|
18619
|
-
function isCustomFontsOptions(value) {
|
|
18620
|
-
return Object.prototype.hasOwnProperty.call(value, "fontBuffers");
|
|
18621
|
-
}
|
|
18622
18566
|
|
|
18623
18567
|
// src/index.node.ts
|
|
18624
18568
|
import { Readable } from "stream";
|