parse-tmx 2.24.0 → 2.25.0
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/README.md +1 -1
- package/dist/index.js +32 -37
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Inspired by [tmx-map-parser](https://github.com/praghus/tmx-map-parser).
|
|
9
9
|
A parser for [Tiled Map Editor](http://www.mapeditor.org/) \*.tmx files.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Table of Contents
|
|
12
12
|
|
|
13
13
|
- 🚀 [Getting Started](#getting-started)
|
|
14
14
|
- 📖 [Documentation](#documentation)
|
package/dist/index.js
CHANGED
|
@@ -33009,7 +33009,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
33009
33009
|
};
|
|
33010
33010
|
}));
|
|
33011
33011
|
//#endregion
|
|
33012
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33012
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/platform.native.js
|
|
33013
33013
|
function decodePartAddition(a, start, end, m) {
|
|
33014
33014
|
let o = "";
|
|
33015
33015
|
let i = start;
|
|
@@ -33035,16 +33035,12 @@ var Buffer$3, haveNativeBuffer$1, isLE, isNative;
|
|
|
33035
33035
|
var init_platform_native = __esmMin$1((() => {
|
|
33036
33036
|
({Buffer: Buffer$3} = globalThis);
|
|
33037
33037
|
haveNativeBuffer$1 = Buffer$3 && !Buffer$3.TYPED_ARRAY_SUPPORT;
|
|
33038
|
-
|
|
33039
|
-
globalThis.Deno;
|
|
33040
|
-
isLE = new Uint8Array(Uint16Array.of(258).buffer)[0] === 2;
|
|
33038
|
+
isLE = /* @__PURE__ */ (() => new Uint8Array(Uint16Array.of(258).buffer)[0] === 2)();
|
|
33041
33039
|
isNative = (x) => x && (haveNativeBuffer$1 || `${x}`.includes("[native code]"));
|
|
33042
33040
|
if (!haveNativeBuffer$1 && isNative(() => {})) isNative = () => false;
|
|
33043
|
-
isNative(globalThis.TextEncoder) && new TextEncoder();
|
|
33044
|
-
isNative(globalThis.TextDecoder) && new TextDecoder("utf-8", { ignoreBOM: true });
|
|
33045
33041
|
}));
|
|
33046
33042
|
//#endregion
|
|
33047
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33043
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/platform.browser.js
|
|
33048
33044
|
function decode2string(arr, start, end, m) {
|
|
33049
33045
|
if (end - start > 3e4) {
|
|
33050
33046
|
const concat = [];
|
|
@@ -33063,14 +33059,15 @@ function decode2string(arr, start, end, m) {
|
|
|
33063
33059
|
var nativeEncoder, nativeDecoder, nativeDecoderLatin1;
|
|
33064
33060
|
var init_platform_browser = __esmMin$1((() => {
|
|
33065
33061
|
init_platform_native();
|
|
33066
|
-
nativeEncoder = new TextEncoder();
|
|
33067
|
-
nativeDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
33068
|
-
nativeDecoderLatin1 = new TextDecoder("latin1", { ignoreBOM: true });
|
|
33062
|
+
nativeEncoder = /* @__PURE__ */ (() => new TextEncoder())();
|
|
33063
|
+
nativeDecoder = /* @__PURE__ */ (() => new TextDecoder("utf-8", { ignoreBOM: true }))();
|
|
33064
|
+
nativeDecoderLatin1 = /* @__PURE__ */ (() => new TextDecoder("latin1", { ignoreBOM: true }))();
|
|
33069
33065
|
}));
|
|
33070
33066
|
//#endregion
|
|
33071
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33067
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/_utils.js
|
|
33072
33068
|
function assertU8(arg) {
|
|
33073
|
-
if (
|
|
33069
|
+
if (arg && arg instanceof Uint8Array) return;
|
|
33070
|
+
throw new TypeError("Expected an Uint8Array");
|
|
33074
33071
|
}
|
|
33075
33072
|
function fromUint8(arr, format) {
|
|
33076
33073
|
switch (format) {
|
|
@@ -33091,7 +33088,7 @@ function fromBuffer(arr, format) {
|
|
|
33091
33088
|
case "uint8":
|
|
33092
33089
|
if (arr.length <= 64 || arr.byteOffset !== 0 || arr.byteLength !== arr.buffer.byteLength) return new Uint8Array(arr);
|
|
33093
33090
|
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
33094
|
-
case "arraybuffer": return
|
|
33091
|
+
case "arraybuffer": return arr.buffer.byteLength === arr.byteLength ? arr.buffer : arr.buffer.slice(arr.byteOffset, arr.byteOffset + arr.byteLength);
|
|
33095
33092
|
case "buffer":
|
|
33096
33093
|
if (arr.constructor !== Buffer$2) throw new Error("Unexpected");
|
|
33097
33094
|
return arr;
|
|
@@ -33101,12 +33098,12 @@ function fromBuffer(arr, format) {
|
|
|
33101
33098
|
var Buffer$2, E_STRING, E_STRICT_UNICODE;
|
|
33102
33099
|
var init__utils = __esmMin$1((() => {
|
|
33103
33100
|
init_platform_browser();
|
|
33104
|
-
Buffer$2 = globalThis.Buffer;
|
|
33101
|
+
Buffer$2 = /* @__PURE__ */ (() => globalThis.Buffer)();
|
|
33105
33102
|
E_STRING = "Input is not a string";
|
|
33106
33103
|
E_STRICT_UNICODE = "Input is not well-formed Unicode";
|
|
33107
33104
|
}));
|
|
33108
33105
|
//#endregion
|
|
33109
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33106
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/latin1.js
|
|
33110
33107
|
function asciiPrefix(arr) {
|
|
33111
33108
|
let p = 0;
|
|
33112
33109
|
const length = arr.length;
|
|
@@ -33162,8 +33159,8 @@ function encodeAsciiPrefix(x, s) {
|
|
|
33162
33159
|
var atob$2, web64$1, maxFunctionArgs, useLatin1atob, decodeUCS2, decodeAscii, encodeLatin1, useEncodeInto, encodeAscii;
|
|
33163
33160
|
var init_latin1 = __esmMin$1((() => {
|
|
33164
33161
|
init_platform_browser();
|
|
33165
|
-
atob$2 = globalThis.atob;
|
|
33166
|
-
web64$1 = Uint8Array.prototype.toBase64;
|
|
33162
|
+
atob$2 = /* @__PURE__ */ (() => globalThis.atob)();
|
|
33163
|
+
web64$1 = /* @__PURE__ */ (() => Uint8Array.prototype.toBase64)();
|
|
33167
33164
|
maxFunctionArgs = 8192;
|
|
33168
33165
|
useLatin1atob = web64$1 && atob$2;
|
|
33169
33166
|
decodeUCS2 = (u16, stop = u16.length) => decodeLatin1(u16, 0, stop);
|
|
@@ -33182,13 +33179,13 @@ var init_latin1 = __esmMin$1((() => {
|
|
|
33182
33179
|
};
|
|
33183
33180
|
}));
|
|
33184
33181
|
//#endregion
|
|
33185
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33182
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/assert.js
|
|
33186
33183
|
function assertEmptyRest(rest) {
|
|
33187
33184
|
if (Object.keys(rest).length > 0) throw new TypeError("Unexpected extra options");
|
|
33188
33185
|
}
|
|
33189
33186
|
var init_assert = __esmMin$1((() => {}));
|
|
33190
33187
|
//#endregion
|
|
33191
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33188
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/base64.js
|
|
33192
33189
|
var base64_exports = /* @__PURE__ */ __exportAll$1({
|
|
33193
33190
|
E_CHAR: () => E_CHAR$1,
|
|
33194
33191
|
E_LAST: () => E_LAST$1,
|
|
@@ -33354,7 +33351,7 @@ var init_base64$1 = __esmMin$1((() => {
|
|
|
33354
33351
|
mapSize = nativeEncoder ? 128 : 65536;
|
|
33355
33352
|
}));
|
|
33356
33353
|
//#endregion
|
|
33357
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33354
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/base64.js
|
|
33358
33355
|
function maybeUnpad(res, padding) {
|
|
33359
33356
|
if (padding) return res;
|
|
33360
33357
|
const at = res.indexOf("=", res.length - 3);
|
|
@@ -33459,7 +33456,7 @@ var init_base64 = __esmMin$1((() => {
|
|
|
33459
33456
|
else fromBase64impl = (str, isBase64url, padding, format) => fromUint8(fromBase64(str, isBase64url), format);
|
|
33460
33457
|
}));
|
|
33461
33458
|
//#endregion
|
|
33462
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33459
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/utf16.js
|
|
33463
33460
|
function decodeApiDecoders(input, loose, format) {
|
|
33464
33461
|
if (format === "uint16") {
|
|
33465
33462
|
if (!(input instanceof Uint16Array)) throw new TypeError("Expected an Uint16Array");
|
|
@@ -33473,8 +33470,6 @@ var fatalLE, looseLE, fatalBE, looseBE;
|
|
|
33473
33470
|
var init_utf16 = __esmMin$1((() => {
|
|
33474
33471
|
init__utils();
|
|
33475
33472
|
init_platform_browser();
|
|
33476
|
-
String.prototype.isWellFormed;
|
|
33477
|
-
String.prototype.toWellFormed;
|
|
33478
33473
|
fatalLE = nativeDecoder ? new TextDecoder("utf-16le", {
|
|
33479
33474
|
ignoreBOM: true,
|
|
33480
33475
|
fatal: true
|
|
@@ -33491,7 +33486,7 @@ var init_utf16_browser = __esmMin$1((() => {
|
|
|
33491
33486
|
utf16toString = (arr, format = "uint16") => decodeApiDecoders(arr, false, format);
|
|
33492
33487
|
}));
|
|
33493
33488
|
//#endregion
|
|
33494
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
33489
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.encodings.json
|
|
33495
33490
|
var require_multi_byte_encodings$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
33496
33491
|
module.exports = {
|
|
33497
33492
|
"$C": [
|
|
@@ -54132,12 +54127,12 @@ var require_multi_byte_encodings$1 = /* @__PURE__ */ __commonJSMin$1(((exports,
|
|
|
54132
54127
|
};
|
|
54133
54128
|
}));
|
|
54134
54129
|
//#endregion
|
|
54135
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
54130
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.encodings.cjs
|
|
54136
54131
|
var require_multi_byte_encodings = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
54137
54132
|
module.exports = () => require_multi_byte_encodings$1();
|
|
54138
54133
|
}));
|
|
54139
54134
|
//#endregion
|
|
54140
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
54135
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.table.js
|
|
54141
54136
|
function loadBase64(str) {
|
|
54142
54137
|
const x = fromBase64url(str);
|
|
54143
54138
|
const len = x.length;
|
|
@@ -54226,7 +54221,7 @@ var init_multi_byte_table = __esmMin$1((() => {
|
|
|
54226
54221
|
tables = /* @__PURE__ */ new Map();
|
|
54227
54222
|
}));
|
|
54228
54223
|
//#endregion
|
|
54229
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
54224
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.js
|
|
54230
54225
|
function multibyteDecoder(enc, loose = false) {
|
|
54231
54226
|
if (typeof loose !== "boolean") throw new TypeError("loose option should be boolean");
|
|
54232
54227
|
if (!Object.hasOwn(mappers, enc)) throw new RangeError("Unsupported encoding");
|
|
@@ -54988,7 +54983,7 @@ var init_multi_byte$1 = __esmMin$1((() => {
|
|
|
54988
54983
|
NON_LATIN$1 = /[^\x00-\xFF]/;
|
|
54989
54984
|
}));
|
|
54990
54985
|
//#endregion
|
|
54991
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
54986
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/multi-byte.js
|
|
54992
54987
|
function createMultibyteDecoder$1(encoding, loose = false) {
|
|
54993
54988
|
const jsDecoder = multibyteDecoder(encoding, loose);
|
|
54994
54989
|
let streaming = false;
|
|
@@ -55005,7 +55000,7 @@ var init_multi_byte = __esmMin$1((() => {
|
|
|
55005
55000
|
}));
|
|
55006
55001
|
var init_utf8_auto_browser = __esmMin$1((() => {}));
|
|
55007
55002
|
//#endregion
|
|
55008
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
55003
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/utf8.js
|
|
55009
55004
|
function deLoose(str, loose, res) {
|
|
55010
55005
|
if (loose || str.length === res.length) return res;
|
|
55011
55006
|
if (isWellFormed) {
|
|
@@ -55049,7 +55044,7 @@ var init_utf8 = __esmMin$1((() => {
|
|
|
55049
55044
|
utf8fromStringLoose = (str, format = "uint8") => fromUint8(encode$2(str, true), format);
|
|
55050
55045
|
}));
|
|
55051
55046
|
//#endregion
|
|
55052
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
55047
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/single-byte.encodings.js
|
|
55053
55048
|
var r$1, i2, iB, i9, w1, w2, w7, w8, k8b, k8a, maps;
|
|
55054
55049
|
var init_single_byte_encodings = __esmMin$1((() => {
|
|
55055
55050
|
r$1 = 65533;
|
|
@@ -56412,7 +56407,7 @@ var init_single_byte_encodings = __esmMin$1((() => {
|
|
|
56412
56407
|
});
|
|
56413
56408
|
}));
|
|
56414
56409
|
//#endregion
|
|
56415
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
56410
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/single-byte.js
|
|
56416
56411
|
function getEncoding(encoding) {
|
|
56417
56412
|
assertEncoding(encoding);
|
|
56418
56413
|
if (encoding === xUserDefined) return Array.from({ length: 128 }, (_, i) => 63360 + i);
|
|
@@ -56515,7 +56510,7 @@ var init_single_byte = __esmMin$1((() => {
|
|
|
56515
56510
|
useLatin1btoa = Uint8Array.fromBase64 && btoa;
|
|
56516
56511
|
}));
|
|
56517
56512
|
//#endregion
|
|
56518
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
56513
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/encoding.labels.js
|
|
56519
56514
|
var labels;
|
|
56520
56515
|
var init_encoding_labels = __esmMin$1((() => {
|
|
56521
56516
|
labels = {
|
|
@@ -56674,7 +56669,7 @@ var init_encoding_labels = __esmMin$1((() => {
|
|
|
56674
56669
|
var init_encoding_api = __esmMin$1((() => {}));
|
|
56675
56670
|
var init_encoding_util = __esmMin$1((() => {}));
|
|
56676
56671
|
//#endregion
|
|
56677
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
56672
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/encoding.js
|
|
56678
56673
|
function normalizeEncoding(label) {
|
|
56679
56674
|
if (label === "utf-8" || label === "utf8" || label === "UTF-8" || label === "UTF8") return "utf-8";
|
|
56680
56675
|
if (label === "windows-1252" || label === "ascii" || label === "latin1") return "windows-1252";
|
|
@@ -56733,7 +56728,7 @@ var init_encoding = __esmMin$1((() => {
|
|
|
56733
56728
|
setMultibyte(createMultibyteDecoder$1, multibyteEncoder$1);
|
|
56734
56729
|
}));
|
|
56735
56730
|
//#endregion
|
|
56736
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
56731
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/percent.js
|
|
56737
56732
|
function percentEncoder(set, spaceAsPlus = false) {
|
|
56738
56733
|
if (typeof set !== "string" || /[^\x20-\x7E]/.test(set)) throw new TypeError(ERR);
|
|
56739
56734
|
if (typeof spaceAsPlus !== "boolean") throw new TypeError("spaceAsPlus must be boolean");
|
|
@@ -56761,7 +56756,7 @@ var init_percent = __esmMin$1((() => {
|
|
|
56761
56756
|
percentMap = /* @__PURE__ */ new Map();
|
|
56762
56757
|
}));
|
|
56763
56758
|
//#endregion
|
|
56764
|
-
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.
|
|
56759
|
+
//#region ../../node_modules/.pnpm/@exodus+bytes@1.15.1_@noble+hashes@2.2.0/node_modules/@exodus/bytes/whatwg.js
|
|
56765
56760
|
var whatwg_exports = /* @__PURE__ */ __exportAll$1({ percentEncodeAfterEncoding: () => percentEncodeAfterEncoding });
|
|
56766
56761
|
function percentEncodeAfterEncoding(encoding, input, percentEncodeSet, spaceAsPlus = false) {
|
|
56767
56762
|
const enc = normalizeEncoding(encoding);
|
|
@@ -56943,8 +56938,8 @@ var init_punycode_es6 = __esmMin$1((() => {
|
|
|
56943
56938
|
let k = 0;
|
|
56944
56939
|
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
56945
56940
|
delta += floor(delta / numPoints);
|
|
56946
|
-
for (; delta >
|
|
56947
|
-
return floor(k +
|
|
56941
|
+
for (; delta > 455; k += base) delta = floor(delta / baseMinusTMin);
|
|
56942
|
+
return floor(k + 36 * delta / (delta + skew));
|
|
56948
56943
|
};
|
|
56949
56944
|
decode = function(input) {
|
|
56950
56945
|
const output = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse-tmx",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "A parser for tmx.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parser",
|
|
@@ -37,15 +37,20 @@
|
|
|
37
37
|
"typecheck": "tsgo"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@esposter/shared": "2.
|
|
41
|
-
"@esposter/xml2js": "2.
|
|
40
|
+
"@esposter/shared": "2.25.0",
|
|
41
|
+
"@esposter/xml2js": "2.25.0",
|
|
42
42
|
"data-urls": "^7.0.0",
|
|
43
43
|
"dayjs": "^1.11.20"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@esposter/configuration": "2.
|
|
46
|
+
"@esposter/configuration": "2.25.0",
|
|
47
47
|
"@types/data-urls": "^3.0.5",
|
|
48
|
-
"@types/xml2js": "^0.4.14"
|
|
48
|
+
"@types/xml2js": "^0.4.14",
|
|
49
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
50
|
+
"ctix": "^2.8.0",
|
|
51
|
+
"rolldown": "^1.0.2",
|
|
52
|
+
"type-fest": "^5.6.0",
|
|
53
|
+
"vitest": "^4.1.7"
|
|
49
54
|
},
|
|
50
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "9e1918dda13a287698bee79a4507635cce57fcbf"
|
|
51
56
|
}
|