@rainbowatcher/toml-edit-js
Advanced tools
+46
-30
| let wasm; | ||
| const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
| if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
| let cachedUint8ArrayMemory0 = null; | ||
@@ -16,5 +12,21 @@ | ||
| let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
| if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
| const MAX_SAFARI_DECODE_BYTES = 2146435072; | ||
| let numBytesDecoded = 0; | ||
| function decodeText(ptr, len) { | ||
| numBytesDecoded += len; | ||
| if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { | ||
| cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
| cachedTextDecoder.decode(); | ||
| numBytesDecoded = len; | ||
| } | ||
| return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); | ||
| } | ||
| function getStringFromWasm0(ptr, len) { | ||
| ptr = ptr >>> 0; | ||
| return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); | ||
| return decodeText(ptr, len); | ||
| } | ||
@@ -248,2 +260,4 @@ | ||
| const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']); | ||
| async function __wbg_load(module, imports) { | ||
@@ -256,3 +270,5 @@ if (typeof Response === 'function' && module instanceof Response) { | ||
| } catch (e) { | ||
| if (module.headers.get('Content-Type') != 'application/wasm') { | ||
| const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type); | ||
| if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') { | ||
| console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); | ||
@@ -284,3 +300,3 @@ | ||
| imports.wbg = {}; | ||
| imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) { | ||
| imports.wbg.__wbg_entries_41651c850143b957 = function(arg0) { | ||
| const ret = Object.entries(arg0); | ||
@@ -300,39 +316,39 @@ return ret; | ||
| }; | ||
| imports.wbg.__wbg_fromEntries_524679eecb0bdc2e = function() { return handleError(function (arg0) { | ||
| imports.wbg.__wbg_fromEntries_91e19ec7b6783aeb = function() { return handleError(function (arg0) { | ||
| const ret = Object.fromEntries(arg0); | ||
| return ret; | ||
| }, arguments) }; | ||
| imports.wbg.__wbg_getUTCDate_81a922644bdea1c8 = function(arg0) { | ||
| imports.wbg.__wbg_getUTCDate_7814ba395218ecb9 = function(arg0) { | ||
| const ret = arg0.getUTCDate(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_getUTCFullYear_a6f9c66b6c8698dd = function(arg0) { | ||
| imports.wbg.__wbg_getUTCFullYear_816afc0f8fd63c1b = function(arg0) { | ||
| const ret = arg0.getUTCFullYear(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_getUTCHours_0500625a80f72d27 = function(arg0) { | ||
| imports.wbg.__wbg_getUTCHours_5612de470304ed1e = function(arg0) { | ||
| const ret = arg0.getUTCHours(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_getUTCMilliseconds_2c3722e9edc6032b = function(arg0) { | ||
| imports.wbg.__wbg_getUTCMilliseconds_b56c2522042f9634 = function(arg0) { | ||
| const ret = arg0.getUTCMilliseconds(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_getUTCMinutes_1d5b5b8a363e98f8 = function(arg0) { | ||
| imports.wbg.__wbg_getUTCMinutes_a512b2fb570b1162 = function(arg0) { | ||
| const ret = arg0.getUTCMinutes(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_getUTCMonth_1628c88863ef1084 = function(arg0) { | ||
| imports.wbg.__wbg_getUTCMonth_043a13059419628b = function(arg0) { | ||
| const ret = arg0.getUTCMonth(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_getUTCSeconds_0eed426529881daa = function(arg0) { | ||
| imports.wbg.__wbg_getUTCSeconds_4f4d8099b01a484c = function(arg0) { | ||
| const ret = arg0.getUTCSeconds(); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) { | ||
| imports.wbg.__wbg_get_a131a44bd1eb6979 = function(arg0, arg1) { | ||
| const ret = arg0[arg1 >>> 0]; | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_instanceof_Date_e9a9be8b9cea7890 = function(arg0) { | ||
| imports.wbg.__wbg_instanceof_Date_ef7e3d6f544a9d16 = function(arg0) { | ||
| let result; | ||
@@ -347,3 +363,3 @@ try { | ||
| }; | ||
| imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) { | ||
| imports.wbg.__wbg_instanceof_Object_9a05796038b7a8f6 = function(arg0) { | ||
| let result; | ||
@@ -358,14 +374,18 @@ try { | ||
| }; | ||
| imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) { | ||
| imports.wbg.__wbg_isArray_2a07fd175d45c496 = function(arg0) { | ||
| const ret = Array.isArray(arg0); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) { | ||
| imports.wbg.__wbg_isArray_5f090bed72bd4f89 = function(arg0) { | ||
| const ret = Array.isArray(arg0); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_length_f00ec12454a5d9fd = function(arg0) { | ||
| const ret = arg0.length; | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) { | ||
| imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) { | ||
| console.log(arg0); | ||
| }; | ||
| imports.wbg.__wbg_new_78feb108b6472713 = function() { | ||
| imports.wbg.__wbg_new_58353953ad2097cc = function() { | ||
| const ret = new Array(); | ||
@@ -378,11 +398,11 @@ return ret; | ||
| }; | ||
| imports.wbg.__wbg_newwithlength_c4c419ef0bc8a1f8 = function(arg0) { | ||
| imports.wbg.__wbg_newwithlength_6ee231411efd06b6 = function(arg0) { | ||
| const ret = new Array(arg0 >>> 0); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) { | ||
| imports.wbg.__wbg_push_73fd7b5550ebf707 = function(arg0, arg1) { | ||
| const ret = arg0.push(arg1); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) { | ||
| imports.wbg.__wbg_set_7422acbe992d64ab = function(arg0, arg1, arg2) { | ||
| arg0[arg1 >>> 0] = arg2; | ||
@@ -397,3 +417,3 @@ }; | ||
| }; | ||
| imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) { | ||
| imports.wbg.__wbg_warn_d89f6637da554c8d = function(arg0) { | ||
| console.warn(arg0); | ||
@@ -423,6 +443,2 @@ }; | ||
| }; | ||
| imports.wbg.__wbindgen_is_array = function(arg0) { | ||
| const ret = Array.isArray(arg0); | ||
| return ret; | ||
| }; | ||
| imports.wbg.__wbindgen_is_bigint = function(arg0) { | ||
@@ -429,0 +445,0 @@ const ret = typeof(arg0) === 'bigint'; |
+1
-1
| { | ||
| "name": "@rainbowatcher/toml-edit-js", | ||
| "type": "module", | ||
| "version": "0.6.1", | ||
| "version": "0.6.2", | ||
| "description": "Edit TOML files in JavaScript", | ||
@@ -6,0 +6,0 @@ "author": "rainbowatcher <rainobw-w@qq.com>", |
Sorry, the diff of this file is not supported yet
334470
1.61%641
2.07%