parse-tmx 2.20.0 → 2.22.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.
Files changed (3) hide show
  1. package/LICENSE +201 -201
  2. package/dist/index.js +96 -80
  3. package/package.json +4 -4
package/LICENSE CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright 2020-present Jimmy Chen
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2020-present Jimmy Chen
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
10
10
  var __esmMin$1 = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
11
- var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
11
+ var __commonJSMin$1 = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
12
12
  var __exportAll$1 = (all, no_symbols) => {
13
13
  let target = {};
14
14
  for (var name in all) __defProp$1(target, name, {
@@ -106,9 +106,9 @@ const Flippeds = new Set(Object.values(Flipped).filter((value) => typeof value =
106
106
  //#endregion
107
107
  //#region src/util/parseFlips.ts
108
108
  const parseFlips = (gid) => ({
109
- Diagonal: Boolean(gid & Flipped.Diagonally),
110
- Horizontal: Boolean(gid & Flipped.Horizontally),
111
- Vertical: Boolean(gid & Flipped.Vertically)
109
+ Diagonal: Boolean(gid & 536870912),
110
+ Horizontal: Boolean(gid & 2147483648),
111
+ Vertical: Boolean(gid & 1073741824)
112
112
  });
113
113
  //#endregion
114
114
  //#region src/models/Shape.ts
@@ -122,10 +122,10 @@ let Shape = /* @__PURE__ */ function(Shape) {
122
122
  //#endregion
123
123
  //#region src/util/parseObjectShape.ts
124
124
  const parseObjectShape = (node) => {
125
- if ("point" in node) return Shape.Point;
126
- else if ("ellipse" in node) return Shape.Ellipse;
127
- else if ("polygon" in node) return Shape.Polygon;
128
- else return Shape.Rectangle;
125
+ if ("point" in node) return "point";
126
+ else if ("ellipse" in node) return "ellipse";
127
+ else if ("polygon" in node) return "polygon";
128
+ else return "rectangle";
129
129
  };
130
130
  //#endregion
131
131
  //#region src/util/parseProperties.ts
@@ -217,24 +217,23 @@ const parseTileLayer = async (node, expectedCount, translateFlips) => {
217
217
  const { compression, encoding } = $;
218
218
  const layerData = _.trim();
219
219
  switch (encoding) {
220
- case Encoding.Base64: {
220
+ case "base64": {
221
221
  const buffer = Buffer.from(layerData, encoding);
222
222
  switch (compression) {
223
- case Compression.Gzip:
224
- case Compression.Zlib:
225
- {
226
- const decompress = compression === Compression.Gzip ? gunzip : inflate;
227
- layer.data = await new Promise((resolve, reject) => {
228
- decompress(buffer, (err, buf) => {
229
- if (err) {
230
- reject(err);
231
- return;
232
- }
233
- resolve(unpackTileBytes(buf, expectedCount));
234
- });
223
+ case "gzip":
224
+ case "zlib": {
225
+ const decompress = compression === "gzip" ? gunzip : inflate;
226
+ layer.data = await new Promise((resolve, reject) => {
227
+ decompress(buffer, (err, buf) => {
228
+ if (err) {
229
+ reject(err);
230
+ return;
231
+ }
232
+ resolve(unpackTileBytes(buf, expectedCount));
235
233
  });
236
- }
234
+ });
237
235
  break;
236
+ }
238
237
  case void 0:
239
238
  layer.data = unpackTileBytes(buffer, expectedCount);
240
239
  break;
@@ -242,7 +241,7 @@ const parseTileLayer = async (node, expectedCount, translateFlips) => {
242
241
  }
243
242
  break;
244
243
  }
245
- case Encoding.Csv:
244
+ case "csv":
246
245
  layer.data = layerData.split(",").map((d) => parseInt(d));
247
246
  break;
248
247
  default: exhaustiveGuard(encoding);
@@ -263,10 +262,10 @@ const parseTileLayer = async (node, expectedCount, translateFlips) => {
263
262
  const parseNode = (node, expectedCount, translateFlips) => {
264
263
  const tmxNodeType = node["#name"];
265
264
  switch (tmxNodeType) {
266
- case TMXNodeType.Group: return parseGroup(node, expectedCount, translateFlips);
267
- case TMXNodeType.ImageLayer:
268
- case TMXNodeType.Objectgroup: return Promise.resolve(parseLayer(node));
269
- case TMXNodeType.Layer: return parseTileLayer(node, expectedCount, translateFlips);
265
+ case "group": return parseGroup(node, expectedCount, translateFlips);
266
+ case "imagelayer":
267
+ case "objectgroup": return Promise.resolve(parseLayer(node));
268
+ case "layer": return parseTileLayer(node, expectedCount, translateFlips);
270
269
  default: throw new InvalidOperationError(Operation.Read, parseNode.name, tmxNodeType);
271
270
  }
272
271
  };
@@ -289,7 +288,7 @@ const parseTileset = (node) => {
289
288
  if (isExternalTileset(node.$)) return structuredClone(node.$);
290
289
  const { $, $$, tile } = node;
291
290
  for (const childNode of $$) {
292
- if (childNode["#name"] !== TMXNodeType.Image) continue;
291
+ if (childNode["#name"] !== "image") continue;
293
292
  const image = structuredClone(childNode.$);
294
293
  const tiles = tile?.map((t) => parseTile(t)) ?? [];
295
294
  return {
@@ -318,7 +317,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
318
317
  var __getOwnPropNames = Object.getOwnPropertyNames;
319
318
  var __hasOwnProp = Object.prototype.hasOwnProperty;
320
319
  var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
321
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
320
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
322
321
  var __exportAll = (all, no_symbols) => {
323
322
  let target = {};
324
323
  for (var name in all) __defProp(target, name, {
@@ -11527,6 +11526,7 @@ var require_RangeImpl = /* @__PURE__ */ __commonJSMin(((exports) => {
11527
11526
  thisPoint = this._start;
11528
11527
  otherPoint = sourceRange._end;
11529
11528
  break;
11529
+ /* istanbul ignore next */
11530
11530
  default: throw new DOMException_1.NotSupportedError();
11531
11531
  }
11532
11532
  /**
@@ -20741,6 +20741,7 @@ var require_ObjectWriter = /* @__PURE__ */ __commonJSMin(((exports) => {
20741
20741
  case interfaces_1.NodeType.Text: return this._builderOptions.convert.text;
20742
20742
  case interfaces_1.NodeType.ProcessingInstruction: return this._builderOptions.convert.ins;
20743
20743
  case interfaces_1.NodeType.CData: return this._builderOptions.convert.cdata;
20744
+ /* istanbul ignore next */
20744
20745
  default: throw new Error("Invalid node type.");
20745
20746
  }
20746
20747
  }
@@ -29280,7 +29281,8 @@ function WritableState(options, stream) {
29280
29281
  this.ending = false;
29281
29282
  this.ended = false;
29282
29283
  this.finished = false;
29283
- this.decodeStrings = !(options.decodeStrings === false);
29284
+ var noDecode = options.decodeStrings === false;
29285
+ this.decodeStrings = !noDecode;
29284
29286
  this.defaultEncoding = options.defaultEncoding || "utf8";
29285
29287
  this.length = 0;
29286
29288
  this.writing = false;
@@ -31167,7 +31169,7 @@ var Parser = class {
31167
31169
  };
31168
31170
  const ontext = (text) => {
31169
31171
  const object = this.stack.at(-1);
31170
- if (!object) return;
31172
+ if (!object) return void 0;
31171
31173
  object[this.options.charkey] += text;
31172
31174
  if (this.options.explicitChildren && this.options.preserveChildrenOrder && this.options.charsAsChildren && (this.options.includeWhiteChars || text.replaceAll(String.raw`\\n`, "").trim() !== "")) {
31173
31175
  object[this.options.childkey] ??= [];
@@ -31180,9 +31182,11 @@ var Parser = class {
31180
31182
  }
31181
31183
  return object;
31182
31184
  };
31183
- this.saxParser.ontext = ontext;
31184
- this.saxParser.oncdata = (text) => {
31185
- const object = ontext(text);
31185
+ this.saxParser.ontext = (text) => {
31186
+ ontext(text);
31187
+ };
31188
+ this.saxParser.oncdata = (cdata) => {
31189
+ const object = ontext(cdata);
31186
31190
  if (!object) return;
31187
31191
  object.cdata = true;
31188
31192
  };
@@ -32826,7 +32830,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
32826
32830
  exports.DOMTimeStamp = exports["unsigned long long"];
32827
32831
  }));
32828
32832
  //#endregion
32829
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/utils.js
32833
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/utils.js
32830
32834
  var require_utils$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
32831
32835
  function isObject(value) {
32832
32836
  return typeof value === "object" && value !== null || typeof value === "function";
@@ -32999,7 +33003,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
32999
33003
  };
33000
33004
  }));
33001
33005
  //#endregion
33002
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/platform.native.js
33006
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/platform.native.js
33003
33007
  function decodePartAddition(a, start, end, m) {
33004
33008
  let o = "";
33005
33009
  let i = start;
@@ -33034,7 +33038,7 @@ var init_platform_native = __esmMin$1((() => {
33034
33038
  isNative(globalThis.TextDecoder) && new TextDecoder("utf-8", { ignoreBOM: true });
33035
33039
  }));
33036
33040
  //#endregion
33037
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/platform.browser.js
33041
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/platform.browser.js
33038
33042
  function decode2string(arr, start, end, m) {
33039
33043
  if (end - start > 3e4) {
33040
33044
  const concat = [];
@@ -33058,7 +33062,7 @@ var init_platform_browser = __esmMin$1((() => {
33058
33062
  nativeDecoderLatin1 = new TextDecoder("latin1", { ignoreBOM: true });
33059
33063
  }));
33060
33064
  //#endregion
33061
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/_utils.js
33065
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/_utils.js
33062
33066
  function assertU8(arg) {
33063
33067
  if (!(arg instanceof Uint8Array)) throw new TypeError("Expected an Uint8Array");
33064
33068
  }
@@ -33096,7 +33100,7 @@ var init__utils = __esmMin$1((() => {
33096
33100
  E_STRICT_UNICODE = "Input is not well-formed Unicode";
33097
33101
  }));
33098
33102
  //#endregion
33099
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/latin1.js
33103
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/latin1.js
33100
33104
  function asciiPrefix(arr) {
33101
33105
  let p = 0;
33102
33106
  const length = arr.length;
@@ -33172,13 +33176,13 @@ var init_latin1 = __esmMin$1((() => {
33172
33176
  };
33173
33177
  }));
33174
33178
  //#endregion
33175
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/assert.js
33179
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/assert.js
33176
33180
  function assertEmptyRest(rest) {
33177
33181
  if (Object.keys(rest).length > 0) throw new TypeError("Unexpected extra options");
33178
33182
  }
33179
33183
  var init_assert = __esmMin$1((() => {}));
33180
33184
  //#endregion
33181
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/base64.js
33185
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/base64.js
33182
33186
  var base64_exports = /* @__PURE__ */ __exportAll$1({
33183
33187
  E_CHAR: () => E_CHAR$1,
33184
33188
  E_LAST: () => E_LAST$1,
@@ -33344,7 +33348,7 @@ var init_base64$1 = __esmMin$1((() => {
33344
33348
  mapSize = nativeEncoder ? 128 : 65536;
33345
33349
  }));
33346
33350
  //#endregion
33347
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/base64.js
33351
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/base64.js
33348
33352
  function maybeUnpad(res, padding) {
33349
33353
  if (padding) return res;
33350
33354
  const at = res.indexOf("=", res.length - 3);
@@ -33449,7 +33453,7 @@ var init_base64 = __esmMin$1((() => {
33449
33453
  else fromBase64impl = (str, isBase64url, padding, format) => fromUint8(fromBase64(str, isBase64url), format);
33450
33454
  }));
33451
33455
  //#endregion
33452
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/utf16.js
33456
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/utf16.js
33453
33457
  function decodeApiDecoders(input, loose, format) {
33454
33458
  if (format === "uint16") {
33455
33459
  if (!(input instanceof Uint16Array)) throw new TypeError("Expected an Uint16Array");
@@ -33481,7 +33485,7 @@ var init_utf16_browser = __esmMin$1((() => {
33481
33485
  utf16toString = (arr, format = "uint16") => decodeApiDecoders(arr, false, format);
33482
33486
  }));
33483
33487
  //#endregion
33484
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/multi-byte.encodings.json
33488
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.encodings.json
33485
33489
  var require_multi_byte_encodings$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
33486
33490
  module.exports = {
33487
33491
  "$C": [
@@ -54122,12 +54126,12 @@ var require_multi_byte_encodings$1 = /* @__PURE__ */ __commonJSMin$1(((exports,
54122
54126
  };
54123
54127
  }));
54124
54128
  //#endregion
54125
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/multi-byte.encodings.cjs
54129
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.encodings.cjs
54126
54130
  var require_multi_byte_encodings = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
54127
54131
  module.exports = () => require_multi_byte_encodings$1();
54128
54132
  }));
54129
54133
  //#endregion
54130
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/multi-byte.table.js
54134
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.table.js
54131
54135
  function loadBase64(str) {
54132
54136
  const x = fromBase64url(str);
54133
54137
  const len = x.length;
@@ -54216,7 +54220,7 @@ var init_multi_byte_table = __esmMin$1((() => {
54216
54220
  tables = /* @__PURE__ */ new Map();
54217
54221
  }));
54218
54222
  //#endregion
54219
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/multi-byte.js
54223
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/multi-byte.js
54220
54224
  function multibyteDecoder(enc, loose = false) {
54221
54225
  if (typeof loose !== "boolean") throw new TypeError("loose option should be boolean");
54222
54226
  if (!Object.hasOwn(mappers, enc)) throw new RangeError("Unsupported encoding");
@@ -54978,7 +54982,7 @@ var init_multi_byte$1 = __esmMin$1((() => {
54978
54982
  NON_LATIN$1 = /[^\x00-\xFF]/;
54979
54983
  }));
54980
54984
  //#endregion
54981
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/multi-byte.js
54985
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/multi-byte.js
54982
54986
  function createMultibyteDecoder$1(encoding, loose = false) {
54983
54987
  const jsDecoder = multibyteDecoder(encoding, loose);
54984
54988
  let streaming = false;
@@ -54995,7 +54999,7 @@ var init_multi_byte = __esmMin$1((() => {
54995
54999
  }));
54996
55000
  var init_utf8_auto_browser = __esmMin$1((() => {}));
54997
55001
  //#endregion
54998
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/utf8.js
55002
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/utf8.js
54999
55003
  function deLoose(str, loose, res) {
55000
55004
  if (loose || str.length === res.length) return res;
55001
55005
  if (isWellFormed) {
@@ -55039,7 +55043,7 @@ var init_utf8 = __esmMin$1((() => {
55039
55043
  utf8fromStringLoose = (str, format = "uint8") => fromUint8(encode$2(str, true), format);
55040
55044
  }));
55041
55045
  //#endregion
55042
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/single-byte.encodings.js
55046
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/single-byte.encodings.js
55043
55047
  var r$1, i2, iB, i9, w1, w2, w7, w8, k8b, k8a, maps;
55044
55048
  var init_single_byte_encodings = __esmMin$1((() => {
55045
55049
  r$1 = 65533;
@@ -56402,7 +56406,7 @@ var init_single_byte_encodings = __esmMin$1((() => {
56402
56406
  });
56403
56407
  }));
56404
56408
  //#endregion
56405
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/single-byte.js
56409
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/single-byte.js
56406
56410
  function getEncoding(encoding) {
56407
56411
  assertEncoding(encoding);
56408
56412
  if (encoding === xUserDefined) return Array.from({ length: 128 }, (_, i) => 63360 + i);
@@ -56505,7 +56509,7 @@ var init_single_byte = __esmMin$1((() => {
56505
56509
  useLatin1btoa = Uint8Array.fromBase64 && btoa;
56506
56510
  }));
56507
56511
  //#endregion
56508
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/encoding.labels.js
56512
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/encoding.labels.js
56509
56513
  var labels;
56510
56514
  var init_encoding_labels = __esmMin$1((() => {
56511
56515
  labels = {
@@ -56664,7 +56668,7 @@ var init_encoding_labels = __esmMin$1((() => {
56664
56668
  var init_encoding_api = __esmMin$1((() => {}));
56665
56669
  var init_encoding_util = __esmMin$1((() => {}));
56666
56670
  //#endregion
56667
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/encoding.js
56671
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/encoding.js
56668
56672
  function normalizeEncoding(label) {
56669
56673
  if (label === "utf-8" || label === "utf8" || label === "UTF-8" || label === "UTF8") return "utf-8";
56670
56674
  if (label === "windows-1252" || label === "ascii" || label === "latin1") return "windows-1252";
@@ -56723,7 +56727,7 @@ var init_encoding = __esmMin$1((() => {
56723
56727
  setMultibyte(createMultibyteDecoder$1, multibyteEncoder$1);
56724
56728
  }));
56725
56729
  //#endregion
56726
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/fallback/percent.js
56730
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/fallback/percent.js
56727
56731
  function percentEncoder(set, spaceAsPlus = false) {
56728
56732
  if (typeof set !== "string" || /[^\x20-\x7E]/.test(set)) throw new TypeError(ERR);
56729
56733
  if (typeof spaceAsPlus !== "boolean") throw new TypeError("spaceAsPlus must be boolean");
@@ -56751,7 +56755,7 @@ var init_percent = __esmMin$1((() => {
56751
56755
  percentMap = /* @__PURE__ */ new Map();
56752
56756
  }));
56753
56757
  //#endregion
56754
- //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.0.1/node_modules/@exodus/bytes/whatwg.js
56758
+ //#region ../../node_modules/.pnpm/@exodus+bytes@1.15.0_@noble+hashes@2.2.0/node_modules/@exodus/bytes/whatwg.js
56755
56759
  var whatwg_exports = /* @__PURE__ */ __exportAll$1({ percentEncodeAfterEncoding: () => percentEncodeAfterEncoding });
56756
56760
  function percentEncodeAfterEncoding(encoding, input, percentEncodeSet, spaceAsPlus = false) {
56757
56761
  const enc = normalizeEncoding(encoding);
@@ -57023,7 +57027,19 @@ var init_punycode_es6 = __esmMin$1((() => {
57023
57027
  });
57024
57028
  };
57025
57029
  punycode = {
57030
+ /**
57031
+ * A string representing the current Punycode.js version number.
57032
+ * @memberOf punycode
57033
+ * @type String
57034
+ */
57026
57035
  "version": "2.3.1",
57036
+ /**
57037
+ * An object of methods to convert from JavaScript's internal character
57038
+ * representation (UCS-2) to Unicode code points, and back.
57039
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
57040
+ * @memberOf punycode
57041
+ * @type Object
57042
+ */
57027
57043
  "ucs2": {
57028
57044
  "decode": ucs2decode,
57029
57045
  "encode": ucs2encode
@@ -91035,7 +91051,7 @@ var require_tr46 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91035
91051
  };
91036
91052
  }));
91037
91053
  //#endregion
91038
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/infra.js
91054
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/infra.js
91039
91055
  var require_infra = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91040
91056
  function isASCIIDigit(c) {
91041
91057
  return c >= 48 && c <= 57;
@@ -91057,7 +91073,7 @@ var require_infra = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91057
91073
  };
91058
91074
  }));
91059
91075
  //#endregion
91060
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/encoding.js
91076
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/encoding.js
91061
91077
  var require_encoding = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91062
91078
  const utf8Encoder = new TextEncoder();
91063
91079
  const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
@@ -91073,7 +91089,7 @@ var require_encoding = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91073
91089
  };
91074
91090
  }));
91075
91091
  //#endregion
91076
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/percent-encoding.js
91092
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/percent-encoding.js
91077
91093
  var require_percent_encoding = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91078
91094
  const { isASCIIHex } = require_infra();
91079
91095
  const { utf8Encode } = require_encoding();
@@ -91209,7 +91225,7 @@ var require_percent_encoding = /* @__PURE__ */ __commonJSMin$1(((exports, module
91209
91225
  };
91210
91226
  }));
91211
91227
  //#endregion
91212
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/url-state-machine.js
91228
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/url-state-machine.js
91213
91229
  var require_url_state_machine = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
91214
91230
  init_encoding();
91215
91231
  const { percentEncodeAfterEncoding } = (init_whatwg(), __toCommonJS$1(whatwg_exports));
@@ -92032,7 +92048,7 @@ var require_url_state_machine = /* @__PURE__ */ __commonJSMin$1(((exports, modul
92032
92048
  };
92033
92049
  }));
92034
92050
  //#endregion
92035
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/urlencoded.js
92051
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/urlencoded.js
92036
92052
  var require_urlencoded = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
92037
92053
  const { utf8Encode, utf8DecodeWithoutBOM } = require_encoding();
92038
92054
  const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = require_percent_encoding();
@@ -92100,7 +92116,7 @@ var require_urlencoded = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
92100
92116
  };
92101
92117
  }));
92102
92118
  //#endregion
92103
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/Function.js
92119
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/Function.js
92104
92120
  var require_Function = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92105
92121
  const conversions = require_lib();
92106
92122
  const utils = require_utils$1();
@@ -92132,7 +92148,7 @@ var require_Function = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92132
92148
  };
92133
92149
  }));
92134
92150
  //#endregion
92135
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/URLSearchParams-impl.js
92151
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.js
92136
92152
  var require_URLSearchParams_impl = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92137
92153
  const urlencoded = require_urlencoded();
92138
92154
  exports.implementation = class URLSearchParamsImpl {
@@ -92214,7 +92230,7 @@ var require_URLSearchParams_impl = /* @__PURE__ */ __commonJSMin$1(((exports) =>
92214
92230
  };
92215
92231
  }));
92216
92232
  //#endregion
92217
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/URLSearchParams.js
92233
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/URLSearchParams.js
92218
92234
  var require_URLSearchParams = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92219
92235
  const conversions = require_lib();
92220
92236
  const utils = require_utils$1();
@@ -92559,7 +92575,7 @@ var require_URLSearchParams = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92559
92575
  const Impl = require_URLSearchParams_impl();
92560
92576
  }));
92561
92577
  //#endregion
92562
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/URL-impl.js
92578
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/URL-impl.js
92563
92579
  var require_URL_impl = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92564
92580
  const usm = require_url_state_machine();
92565
92581
  const urlencoded = require_urlencoded();
@@ -92723,7 +92739,7 @@ var require_URL_impl = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92723
92739
  };
92724
92740
  }));
92725
92741
  //#endregion
92726
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/lib/URL.js
92742
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/lib/URL.js
92727
92743
  var require_URL = /* @__PURE__ */ __commonJSMin$1(((exports) => {
92728
92744
  const conversions = require_lib();
92729
92745
  const utils = require_utils$1();
@@ -93047,7 +93063,7 @@ var require_URL = /* @__PURE__ */ __commonJSMin$1(((exports) => {
93047
93063
  const Impl = require_URL_impl();
93048
93064
  }));
93049
93065
  //#endregion
93050
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/webidl2js-wrapper.js
93066
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/webidl2js-wrapper.js
93051
93067
  var require_webidl2js_wrapper = /* @__PURE__ */ __commonJSMin$1(((exports) => {
93052
93068
  const URL = require_URL();
93053
93069
  const URLSearchParams = require_URLSearchParams();
@@ -93055,7 +93071,7 @@ var require_webidl2js_wrapper = /* @__PURE__ */ __commonJSMin$1(((exports) => {
93055
93071
  exports.URLSearchParams = URLSearchParams;
93056
93072
  }));
93057
93073
  //#endregion
93058
- //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.0.1/node_modules/whatwg-url/index.js
93074
+ //#region ../../node_modules/.pnpm/whatwg-url@16.0.1_@noble+hashes@2.2.0/node_modules/whatwg-url/index.js
93059
93075
  var require_whatwg_url = /* @__PURE__ */ __commonJSMin$1(((exports) => {
93060
93076
  const { URL, URLSearchParams } = require_webidl2js_wrapper();
93061
93077
  const urlStateMachine = require_url_state_machine();
@@ -93086,7 +93102,7 @@ var require_whatwg_url = /* @__PURE__ */ __commonJSMin$1(((exports) => {
93086
93102
  exports.percentDecodeBytes = percentEncoding.percentDecodeBytes;
93087
93103
  }));
93088
93104
  //#endregion
93089
- //#region ../../node_modules/.pnpm/data-urls@7.0.0_@noble+hashes@2.0.1/node_modules/data-urls/lib/utils.js
93105
+ //#region ../../node_modules/.pnpm/data-urls@7.0.0_@noble+hashes@2.2.0/node_modules/data-urls/lib/utils.js
93090
93106
  var require_utils = /* @__PURE__ */ __commonJSMin$1(((exports) => {
93091
93107
  exports.stripLeadingAndTrailingASCIIWhitespace = (string) => {
93092
93108
  return string.replace(/^[ \t\n\f\r]+/u, "").replace(/[ \t\n\f\r]+$/u, "");
@@ -93163,28 +93179,28 @@ const parseTmx = async (xmlString, translateFlips = false) => {
93163
93179
  for (const node of $$) {
93164
93180
  const tmxNodeType = node["#name"];
93165
93181
  switch (tmxNodeType) {
93166
- case TMXNodeType.Data: break;
93167
- case TMXNodeType.EditorSettings:
93182
+ case "data": break;
93183
+ case "editorsettings":
93168
93184
  if (!node.$$) break;
93169
93185
  map.editorsettings = Object.assign({}, ...node.$$.map((n) => ({ [n["#name"]]: n.$ })));
93170
93186
  break;
93171
- case TMXNodeType.Export:
93172
- case TMXNodeType.Image:
93173
- case TMXNodeType.Object:
93174
- case TMXNodeType.Property: break;
93175
- case TMXNodeType.Group:
93176
- case TMXNodeType.ImageLayer:
93177
- case TMXNodeType.Layer:
93178
- case TMXNodeType.Objectgroup: {
93187
+ case "export":
93188
+ case "image":
93189
+ case "object":
93190
+ case "property": break;
93191
+ case "group":
93192
+ case "imagelayer":
93193
+ case "layer":
93194
+ case "objectgroup": {
93179
93195
  const layer = await parseNode(node, expectedCount, translateFlips);
93180
93196
  map.layers.push(layer);
93181
93197
  break;
93182
93198
  }
93183
- case TMXNodeType.Properties:
93199
+ case "properties":
93184
93200
  if (!node.$$) break;
93185
93201
  map.properties = Object.assign({}, ...node.$$.map(({ $: { name, value } }) => ({ [name]: value })));
93186
93202
  break;
93187
- case TMXNodeType.Tileset:
93203
+ case "tileset":
93188
93204
  map.tilesets.push(parseTileset(node));
93189
93205
  break;
93190
93206
  default: exhaustiveGuard(tmxNodeType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse-tmx",
3
- "version": "2.20.0",
3
+ "version": "2.22.0",
4
4
  "description": "A parser for tmx.",
5
5
  "keywords": [
6
6
  "parser",
@@ -37,8 +37,8 @@
37
37
  "typecheck": "tsgo"
38
38
  },
39
39
  "dependencies": {
40
- "@esposter/shared": "2.20.0",
41
- "@esposter/xml2js": "2.20.0",
40
+ "@esposter/shared": "2.22.0",
41
+ "@esposter/xml2js": "2.22.0",
42
42
  "data-urls": "^7.0.0",
43
43
  "dayjs": "^1.11.20"
44
44
  },
@@ -46,5 +46,5 @@
46
46
  "@types/data-urls": "^3.0.5",
47
47
  "@types/xml2js": "^0.4.14"
48
48
  },
49
- "gitHead": "dd9cd98982a30612471aa8cc7e25db87d9e1d449"
49
+ "gitHead": "405a6743bb0fdae18c07faff17037b9e7a345939"
50
50
  }