parse-tmx 2.36.0 → 2.37.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/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/index.d.ts +66 -67
- package/dist/index.js +127 -117
- package/package.json +6 -6
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/README.md
CHANGED
|
@@ -24,7 +24,7 @@ pnpm i parse-tmx
|
|
|
24
24
|
|
|
25
25
|
## <a name="documentation">📖 Documentation</a>
|
|
26
26
|
|
|
27
|
-
We highly recommend you take a look at the [documentation](https://esposter.com/docs/modules/parse-tmx.html) to level up.
|
|
27
|
+
We highly recommend you take a look at the [documentation](https://esposter.com/docs/api/modules/parse-tmx.html) to level up.
|
|
28
28
|
|
|
29
29
|
### Usage
|
|
30
30
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
interface TMXEditorSettingsParsed extends Record<string, unknown> {}
|
|
2
|
-
interface TMXFlipsParsed {
|
|
1
|
+
export interface TMXEditorSettingsParsed extends Record<string, unknown> {}
|
|
2
|
+
export interface TMXFlipsParsed {
|
|
3
3
|
Diagonal: boolean;
|
|
4
4
|
Horizontal: boolean;
|
|
5
5
|
Vertical: boolean;
|
|
6
6
|
}
|
|
7
|
-
interface TMXImageShared {
|
|
7
|
+
export interface TMXImageShared {
|
|
8
8
|
height: number;
|
|
9
9
|
source: string;
|
|
10
10
|
width: number;
|
|
11
11
|
}
|
|
12
|
-
interface TMXImageParsed extends TMXImageShared {}
|
|
13
|
-
declare enum Shape {
|
|
12
|
+
export interface TMXImageParsed extends TMXImageShared {}
|
|
13
|
+
export declare enum Shape {
|
|
14
14
|
Ellipse = "ellipse",
|
|
15
15
|
Point = "point",
|
|
16
16
|
Polygon = "polygon",
|
|
17
17
|
Rectangle = "rectangle"
|
|
18
18
|
}
|
|
19
|
-
type TMXPropertiesParsed = Record<string, unknown>[];
|
|
20
|
-
interface TMXObjectShared {
|
|
19
|
+
export type TMXPropertiesParsed = Record<string, unknown>[];
|
|
20
|
+
export interface TMXObjectShared {
|
|
21
21
|
gid: number;
|
|
22
22
|
height: number;
|
|
23
23
|
id: number;
|
|
@@ -26,7 +26,7 @@ interface TMXObjectShared {
|
|
|
26
26
|
x: number;
|
|
27
27
|
y: number;
|
|
28
28
|
}
|
|
29
|
-
interface TMXObjectParsed extends TMXObjectShared {
|
|
29
|
+
export interface TMXObjectParsed extends TMXObjectShared {
|
|
30
30
|
flips?: TMXFlipsParsed;
|
|
31
31
|
name: string;
|
|
32
32
|
points?: [number, number][];
|
|
@@ -35,7 +35,7 @@ interface TMXObjectParsed extends TMXObjectShared {
|
|
|
35
35
|
text?: string;
|
|
36
36
|
value: string;
|
|
37
37
|
}
|
|
38
|
-
interface TMXLayerShared {
|
|
38
|
+
export interface TMXLayerShared {
|
|
39
39
|
height: number;
|
|
40
40
|
id: number;
|
|
41
41
|
locked?: number;
|
|
@@ -52,28 +52,28 @@ interface TMXLayerShared {
|
|
|
52
52
|
x?: number;
|
|
53
53
|
y?: number;
|
|
54
54
|
}
|
|
55
|
-
interface TMXLayerParsed extends TMXLayerShared {
|
|
55
|
+
export interface TMXLayerParsed extends TMXLayerShared {
|
|
56
56
|
data?: number[];
|
|
57
57
|
flips?: TMXFlipsParsed[];
|
|
58
58
|
image?: TMXImageParsed;
|
|
59
59
|
objects?: TMXObjectParsed[];
|
|
60
60
|
properties?: TMXPropertiesParsed;
|
|
61
61
|
}
|
|
62
|
-
interface TMXGroupLayerShared {
|
|
62
|
+
export interface TMXGroupLayerShared {
|
|
63
63
|
id: number;
|
|
64
64
|
name: string;
|
|
65
65
|
type: string;
|
|
66
66
|
}
|
|
67
|
-
interface TMXGroupLayerParsed extends TMXGroupLayerShared {
|
|
67
|
+
export interface TMXGroupLayerParsed extends TMXGroupLayerShared {
|
|
68
68
|
layers: TMXLayerParsed[];
|
|
69
69
|
properties?: TMXPropertiesParsed;
|
|
70
70
|
}
|
|
71
|
-
interface TMXTileShared {
|
|
71
|
+
export interface TMXTileShared {
|
|
72
72
|
gid?: number;
|
|
73
73
|
id: number;
|
|
74
74
|
probability?: number;
|
|
75
75
|
}
|
|
76
|
-
interface TMXTileParsed extends TMXTileShared {
|
|
76
|
+
export interface TMXTileParsed extends TMXTileShared {
|
|
77
77
|
animation?: {
|
|
78
78
|
frames: number[];
|
|
79
79
|
};
|
|
@@ -82,10 +82,10 @@ interface TMXTileParsed extends TMXTileShared {
|
|
|
82
82
|
properties?: TMXPropertiesParsed;
|
|
83
83
|
type: string;
|
|
84
84
|
}
|
|
85
|
-
interface TMXBaseTilesetShared {
|
|
85
|
+
export interface TMXBaseTilesetShared {
|
|
86
86
|
firstgid: number;
|
|
87
87
|
}
|
|
88
|
-
interface TMXEmbeddedTilesetShared extends TMXBaseTilesetShared {
|
|
88
|
+
export interface TMXEmbeddedTilesetShared extends TMXBaseTilesetShared {
|
|
89
89
|
columns: number;
|
|
90
90
|
imageheight: number;
|
|
91
91
|
imagewidth: number;
|
|
@@ -96,16 +96,16 @@ interface TMXEmbeddedTilesetShared extends TMXBaseTilesetShared {
|
|
|
96
96
|
tileheight: number;
|
|
97
97
|
tilewidth: number;
|
|
98
98
|
}
|
|
99
|
-
interface TMXEmbeddedTilesetParsed extends TMXEmbeddedTilesetShared {
|
|
99
|
+
export interface TMXEmbeddedTilesetParsed extends TMXEmbeddedTilesetShared {
|
|
100
100
|
image: TMXImageParsed;
|
|
101
101
|
tiles: TMXTileParsed[];
|
|
102
102
|
}
|
|
103
|
-
interface TMXExternalTilesetShared extends TMXBaseTilesetShared {
|
|
103
|
+
export interface TMXExternalTilesetShared extends TMXBaseTilesetShared {
|
|
104
104
|
source: string;
|
|
105
105
|
}
|
|
106
|
-
interface TMXExternalTilesetParsed extends TMXExternalTilesetShared {}
|
|
107
|
-
type TMXTilesetParsed = TMXEmbeddedTilesetParsed | TMXExternalTilesetParsed;
|
|
108
|
-
declare class TMXMapShared {
|
|
106
|
+
export interface TMXExternalTilesetParsed extends TMXExternalTilesetShared {}
|
|
107
|
+
export type TMXTilesetParsed = TMXEmbeddedTilesetParsed | TMXExternalTilesetParsed;
|
|
108
|
+
export declare class TMXMapShared {
|
|
109
109
|
height: number;
|
|
110
110
|
infinite: number;
|
|
111
111
|
nextlayerid: number;
|
|
@@ -118,33 +118,33 @@ declare class TMXMapShared {
|
|
|
118
118
|
version: number;
|
|
119
119
|
width: number;
|
|
120
120
|
}
|
|
121
|
-
declare class TMXMapParsed extends TMXMapShared {
|
|
121
|
+
export declare class TMXMapParsed extends TMXMapShared {
|
|
122
122
|
editorsettings: TMXEditorSettingsParsed;
|
|
123
123
|
layers: (TMXGroupLayerParsed | TMXLayerParsed)[];
|
|
124
124
|
properties: TMXPropertiesParsed;
|
|
125
125
|
tilesets: TMXTilesetParsed[];
|
|
126
126
|
constructor(init?: Partial<TMXMapParsed>);
|
|
127
127
|
}
|
|
128
|
-
declare class TMXParsed {
|
|
128
|
+
export declare class TMXParsed {
|
|
129
129
|
map: TMXMapParsed;
|
|
130
130
|
constructor(map?: TMXMapParsed);
|
|
131
131
|
}
|
|
132
|
-
declare const parseTmx: (xmlString: string, translateFlips?: boolean) => Promise<TMXParsed>;
|
|
133
|
-
declare enum Compression {
|
|
132
|
+
export declare const parseTmx: (xmlString: string, translateFlips?: boolean) => Promise<TMXParsed>;
|
|
133
|
+
export declare enum Compression {
|
|
134
134
|
Gzip = "gzip",
|
|
135
135
|
Zlib = "zlib"
|
|
136
136
|
}
|
|
137
|
-
declare enum Encoding {
|
|
137
|
+
export declare enum Encoding {
|
|
138
138
|
Base64 = "base64",
|
|
139
139
|
Csv = "csv"
|
|
140
140
|
}
|
|
141
|
-
declare enum Flipped {
|
|
141
|
+
export declare enum Flipped {
|
|
142
142
|
Diagonally = 536870912,
|
|
143
143
|
Vertically = 1073741824,
|
|
144
144
|
Horizontally = 2147483648
|
|
145
145
|
}
|
|
146
|
-
declare const Flippeds: readonly Flipped[];
|
|
147
|
-
declare enum TMXNodeType {
|
|
146
|
+
export declare const Flippeds: readonly Flipped[];
|
|
147
|
+
export declare enum TMXNodeType {
|
|
148
148
|
Data = "data",
|
|
149
149
|
EditorSettings = "editorsettings",
|
|
150
150
|
Export = "export",
|
|
@@ -158,32 +158,32 @@ declare enum TMXNodeType {
|
|
|
158
158
|
Property = "property",
|
|
159
159
|
Tileset = "tileset"
|
|
160
160
|
}
|
|
161
|
-
declare class BaseTMXNode<T> {
|
|
161
|
+
export declare class BaseTMXNode<T> {
|
|
162
162
|
[key: string]: unknown;
|
|
163
163
|
readonly "#name": TMXNodeType;
|
|
164
164
|
$: T;
|
|
165
165
|
}
|
|
166
|
-
declare const cloneNodeWithType: <TParsed>(node: BaseTMXNode<unknown>) => TParsed;
|
|
167
|
-
declare const getDecompressedBytes: (bytes: Uint8Array, compression: Compression.Gzip | Compression.Zlib) => Promise<Uint8Array>;
|
|
168
|
-
declare const isExternalTileset: (tileset: TMXEmbeddedTilesetShared | TMXExternalTilesetShared) => tileset is TMXExternalTilesetShared;
|
|
169
|
-
type TMXNode<T, TChildNode extends BaseTMXNode<unknown> | undefined = undefined> = BaseTMXNode<T> & {
|
|
166
|
+
export declare const cloneNodeWithType: <TParsed>(node: BaseTMXNode<unknown>) => TParsed;
|
|
167
|
+
export declare const getDecompressedBytes: (bytes: Uint8Array, compression: Compression.Gzip | Compression.Zlib) => Promise<Uint8Array>;
|
|
168
|
+
export declare const isExternalTileset: (tileset: TMXEmbeddedTilesetShared | TMXExternalTilesetShared) => tileset is TMXExternalTilesetShared;
|
|
169
|
+
export type TMXNode<T, TChildNode extends BaseTMXNode<unknown> | undefined = undefined> = BaseTMXNode<T> & {
|
|
170
170
|
$$: TChildNode extends undefined ? undefined : TChildNode[];
|
|
171
171
|
};
|
|
172
|
-
interface TMXDataNode extends TMXNode<{
|
|
172
|
+
export interface TMXDataNode extends TMXNode<{
|
|
173
173
|
compression?: Compression;
|
|
174
174
|
encoding: Encoding;
|
|
175
175
|
}> {
|
|
176
176
|
_: string;
|
|
177
177
|
}
|
|
178
|
-
interface TMXImageNode extends TMXNode<TMXImageShared> {}
|
|
179
|
-
interface TMXPropertyNode extends TMXNode<{
|
|
178
|
+
export interface TMXImageNode extends TMXNode<TMXImageShared> {}
|
|
179
|
+
export interface TMXPropertyNode extends TMXNode<{
|
|
180
180
|
name: string;
|
|
181
181
|
value?: string;
|
|
182
182
|
}> {
|
|
183
183
|
_: string;
|
|
184
184
|
}
|
|
185
|
-
interface TMXPropertiesNode extends TMXNode<Record<string, never>, TMXPropertyNode> {}
|
|
186
|
-
interface TMXObjectNode extends TMXNode<TMXObjectShared, TMXDataNode | TMXPropertiesNode> {
|
|
185
|
+
export interface TMXPropertiesNode extends TMXNode<Record<string, never>, TMXPropertyNode> {}
|
|
186
|
+
export interface TMXObjectNode extends TMXNode<TMXObjectShared, TMXDataNode | TMXPropertiesNode> {
|
|
187
187
|
polygon?: TMXNode<{
|
|
188
188
|
points: string;
|
|
189
189
|
}>[];
|
|
@@ -192,19 +192,19 @@ interface TMXObjectNode extends TMXNode<TMXObjectShared, TMXDataNode | TMXProper
|
|
|
192
192
|
}[];
|
|
193
193
|
text?: TMXDataNode[];
|
|
194
194
|
}
|
|
195
|
-
interface TMXTileNode extends TMXNode<TMXTileShared, TMXPropertiesNode> {
|
|
195
|
+
export interface TMXTileNode extends TMXNode<TMXTileShared, TMXPropertiesNode> {
|
|
196
196
|
animation?: Record<string, TMXNode<number>[]>[];
|
|
197
197
|
objectgroup?: Record<string, TMXObjectNode[]>[];
|
|
198
198
|
properties?: {
|
|
199
199
|
property: TMXPropertyNode[];
|
|
200
200
|
}[];
|
|
201
201
|
}
|
|
202
|
-
interface TMXEmbeddedTilesetNode extends TMXNode<TMXEmbeddedTilesetShared, TMXImageNode | TMXTileNode> {
|
|
202
|
+
export interface TMXEmbeddedTilesetNode extends TMXNode<TMXEmbeddedTilesetShared, TMXImageNode | TMXTileNode> {
|
|
203
203
|
tile?: TMXTileNode[];
|
|
204
204
|
}
|
|
205
|
-
declare const isTMXEmbeddedTilesetNode: (node: TMXDataNode | TMXEmbeddedTilesetNode) => node is TMXEmbeddedTilesetNode;
|
|
206
|
-
declare const parseFlips: (gid: number) => TMXFlipsParsed;
|
|
207
|
-
interface TMXLayerNode extends TMXNode<TMXLayerShared, TMXDataNode | TMXEmbeddedTilesetNode | TMXPropertiesNode> {
|
|
205
|
+
export declare const isTMXEmbeddedTilesetNode: (node: TMXDataNode | TMXEmbeddedTilesetNode) => node is TMXEmbeddedTilesetNode;
|
|
206
|
+
export declare const parseFlips: (gid: number) => TMXFlipsParsed;
|
|
207
|
+
export interface TMXLayerNode extends TMXNode<TMXLayerShared, TMXDataNode | TMXEmbeddedTilesetNode | TMXPropertiesNode> {
|
|
208
208
|
data?: TMXDataNode[] | TMXEmbeddedTilesetNode[];
|
|
209
209
|
image?: TMXImageNode[];
|
|
210
210
|
object?: TMXObjectNode[];
|
|
@@ -212,37 +212,36 @@ interface TMXLayerNode extends TMXNode<TMXLayerShared, TMXDataNode | TMXEmbedded
|
|
|
212
212
|
property: TMXPropertyNode[];
|
|
213
213
|
}[];
|
|
214
214
|
}
|
|
215
|
-
interface TMXGroupLayerNode extends TMXNode<TMXGroupLayerShared, TMXLayerNode> {
|
|
215
|
+
export interface TMXGroupLayerNode extends TMXNode<TMXGroupLayerShared, TMXLayerNode> {
|
|
216
216
|
properties?: {
|
|
217
217
|
property: TMXPropertyNode[];
|
|
218
218
|
}[];
|
|
219
219
|
}
|
|
220
|
-
declare const parseGroup: (node: TMXGroupLayerNode, expectedCount: number, translateFlips: boolean) => Promise<TMXGroupLayerParsed>;
|
|
221
|
-
declare const parseLayer: (node: TMXLayerNode) => TMXLayerParsed;
|
|
222
|
-
declare const parseNode: <TNode extends TMXGroupLayerNode | TMXLayerNode, TParsedNode = TNode extends TMXLayerNode ? TMXLayerParsed : TMXGroupLayerParsed>(node: TNode, expectedCount: number, translateFlips: boolean) => Promise<TParsedNode>;
|
|
223
|
-
declare const parseObject: (node: TMXObjectNode) => TMXObjectParsed;
|
|
224
|
-
declare const parseObjectShape: (node: TMXObjectNode) => Shape;
|
|
225
|
-
declare const parseProperties: (properties: {
|
|
220
|
+
export declare const parseGroup: (node: TMXGroupLayerNode, expectedCount: number, translateFlips: boolean) => Promise<TMXGroupLayerParsed>;
|
|
221
|
+
export declare const parseLayer: (node: TMXLayerNode) => TMXLayerParsed;
|
|
222
|
+
export declare const parseNode: <TNode extends TMXGroupLayerNode | TMXLayerNode, TParsedNode = TNode extends TMXLayerNode ? TMXLayerParsed : TMXGroupLayerParsed>(node: TNode, expectedCount: number, translateFlips: boolean) => Promise<TParsedNode>;
|
|
223
|
+
export declare const parseObject: (node: TMXObjectNode) => TMXObjectParsed;
|
|
224
|
+
export declare const parseObjectShape: (node: TMXObjectNode) => Shape;
|
|
225
|
+
export declare const parseProperties: (properties: {
|
|
226
226
|
property: TMXPropertyNode[];
|
|
227
227
|
}[]) => TMXPropertiesParsed;
|
|
228
|
-
declare const parseTile: (node: TMXTileNode) => TMXTileParsed;
|
|
229
|
-
declare const parseTileId: (gid: number) => number;
|
|
230
|
-
declare const parseTileLayer: (node: TMXLayerNode, expectedCount: number, translateFlips: boolean) => Promise<TMXLayerParsed>;
|
|
231
|
-
interface TMXExternalTilesetNode extends TMXNode<TMXExternalTilesetShared> {}
|
|
232
|
-
type TMXTilesetNode = TMXEmbeddedTilesetNode | TMXExternalTilesetNode;
|
|
233
|
-
declare const parseTileset: (node: TMXTilesetNode) => TMXTilesetParsed;
|
|
234
|
-
declare const parseXmlString: <T extends object>(xmlString: string) => Promise<T>;
|
|
235
|
-
declare const parseXmlValue: (value: string) => boolean | number | string;
|
|
236
|
-
declare const unpackTileBytes: (bytes: Uint8Array, expectedCount: number) => number[];
|
|
237
|
-
interface TMXExportShared {
|
|
228
|
+
export declare const parseTile: (node: TMXTileNode) => TMXTileParsed;
|
|
229
|
+
export declare const parseTileId: (gid: number) => number;
|
|
230
|
+
export declare const parseTileLayer: (node: TMXLayerNode, expectedCount: number, translateFlips: boolean) => Promise<TMXLayerParsed>;
|
|
231
|
+
export interface TMXExternalTilesetNode extends TMXNode<TMXExternalTilesetShared> {}
|
|
232
|
+
export type TMXTilesetNode = TMXEmbeddedTilesetNode | TMXExternalTilesetNode;
|
|
233
|
+
export declare const parseTileset: (node: TMXTilesetNode) => TMXTilesetParsed;
|
|
234
|
+
export declare const parseXmlString: <T extends object>(xmlString: string) => Promise<T>;
|
|
235
|
+
export declare const parseXmlValue: (value: string) => boolean | number | string;
|
|
236
|
+
export declare const unpackTileBytes: (bytes: Uint8Array, expectedCount: number) => number[];
|
|
237
|
+
export interface TMXExportShared {
|
|
238
238
|
format: string;
|
|
239
239
|
target: string;
|
|
240
240
|
}
|
|
241
|
-
interface TMXExportNode extends TMXNode<TMXExportShared> {}
|
|
242
|
-
interface TMXEditorSettingsNode extends TMXNode<Record<string, never>, TMXExportNode> {}
|
|
243
|
-
interface TMXMapNode extends TMXNode<TMXMapShared, TMXEditorSettingsNode | TMXGroupLayerNode | TMXPropertiesNode | TMXTilesetNode> {}
|
|
244
|
-
interface TMX {
|
|
241
|
+
export interface TMXExportNode extends TMXNode<TMXExportShared> {}
|
|
242
|
+
export interface TMXEditorSettingsNode extends TMXNode<Record<string, never>, TMXExportNode> {}
|
|
243
|
+
export interface TMXMapNode extends TMXNode<TMXMapShared, TMXEditorSettingsNode | TMXGroupLayerNode | TMXPropertiesNode | TMXTilesetNode> {}
|
|
244
|
+
export interface TMX {
|
|
245
245
|
map: TMXMapNode;
|
|
246
246
|
}
|
|
247
|
-
interface TMXExportParsed extends TMXExportShared {}
|
|
248
|
-
export { BaseTMXNode, Compression, Encoding, Flipped, Flippeds, Shape, TMX, TMXBaseTilesetShared, TMXDataNode, TMXEditorSettingsNode, TMXEditorSettingsParsed, TMXEmbeddedTilesetNode, TMXEmbeddedTilesetParsed, TMXEmbeddedTilesetShared, TMXExportNode, TMXExportParsed, TMXExportShared, TMXExternalTilesetNode, TMXExternalTilesetParsed, TMXExternalTilesetShared, TMXFlipsParsed, TMXGroupLayerNode, TMXGroupLayerParsed, TMXGroupLayerShared, TMXImageNode, TMXImageParsed, TMXImageShared, TMXLayerNode, TMXLayerParsed, TMXLayerShared, TMXMapNode, TMXMapParsed, TMXMapShared, TMXNode, TMXNodeType, TMXObjectNode, TMXObjectParsed, TMXObjectShared, TMXParsed, TMXPropertiesNode, TMXPropertiesParsed, TMXPropertyNode, TMXTileNode, TMXTileParsed, TMXTileShared, TMXTilesetNode, TMXTilesetParsed, cloneNodeWithType, getDecompressedBytes, isExternalTileset, isTMXEmbeddedTilesetNode, parseFlips, parseGroup, parseLayer, parseNode, parseObject, parseObjectShape, parseProperties, parseTile, parseTileId, parseTileLayer, parseTileset, parseTmx, parseXmlString, parseXmlValue, unpackTileBytes };
|
|
247
|
+
export interface TMXExportParsed extends TMXExportShared {}
|
package/dist/index.js
CHANGED
|
@@ -212,7 +212,7 @@ const parseTileLayer = async (node, expectedCount, translateFlips) => {
|
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
214
|
case "csv":
|
|
215
|
-
layer.data = layerData.split(",").map(
|
|
215
|
+
layer.data = layerData.split(",").map(Number);
|
|
216
216
|
break;
|
|
217
217
|
default: exhaustiveGuard(encoding);
|
|
218
218
|
}
|
|
@@ -262,10 +262,8 @@ const NUMBER_REGEX = /^[+-]?\d+(?<decimal>\.\d+)?$/u;
|
|
|
262
262
|
const parseXmlValue = (value) => {
|
|
263
263
|
if (value === "true") return true;
|
|
264
264
|
else if (value === "false") return false;
|
|
265
|
-
else if (NUMBER_REGEX.test(value))
|
|
266
|
-
|
|
267
|
-
return Number.isNaN(parsedValue) ? value : parsedValue;
|
|
268
|
-
} else return value;
|
|
265
|
+
else if (NUMBER_REGEX.test(value)) return Number(value);
|
|
266
|
+
else return value;
|
|
269
267
|
};
|
|
270
268
|
var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
271
269
|
exports.removeLeadingAndTrailingHTTPWhitespace = (string) => {
|
|
@@ -23147,19 +23145,20 @@ function unwrap(res, t, pos) {
|
|
|
23147
23145
|
let code = 0;
|
|
23148
23146
|
for (let i = 0; i < t.length; i++) {
|
|
23149
23147
|
let x = t[i];
|
|
23150
|
-
if (typeof x === "number")
|
|
23151
|
-
|
|
23152
|
-
if (x < 0) {
|
|
23153
|
-
code -= x;
|
|
23154
|
-
x = 1;
|
|
23155
|
-
} else code += t[++i];
|
|
23156
|
-
for (let k = 0; k < x; k++, pos++, code++) if (code <= 65535) res[pos] = code;
|
|
23148
|
+
if (typeof x === "number") {
|
|
23149
|
+
if (x === 0) pos += t[++i];
|
|
23157
23150
|
else {
|
|
23158
|
-
|
|
23159
|
-
|
|
23151
|
+
if (x < 0) {
|
|
23152
|
+
code -= x;
|
|
23153
|
+
x = 1;
|
|
23154
|
+
} else code += t[++i];
|
|
23155
|
+
for (let k = 0; k < x; k++, pos++, code++) if (code <= 65535) res[pos] = code;
|
|
23156
|
+
else {
|
|
23157
|
+
const c = String.fromCodePoint(code);
|
|
23158
|
+
res[pos] = c.charCodeAt(0) << 16 | c.charCodeAt(1);
|
|
23159
|
+
}
|
|
23160
23160
|
}
|
|
23161
|
-
}
|
|
23162
|
-
else if (x[0] === "$" && Object.hasOwn(indices, x)) pos = unwrap(res, indices[x], pos);
|
|
23161
|
+
} else if (x[0] === "$" && Object.hasOwn(indices, x)) pos = unwrap(res, indices[x], pos);
|
|
23163
23162
|
else {
|
|
23164
23163
|
let last;
|
|
23165
23164
|
for (const c of utf16toString(loadBase64(x), "uint8-le")) {
|
|
@@ -23382,16 +23381,17 @@ function multibyteEncoder$1(enc, onError) {
|
|
|
23382
23381
|
};
|
|
23383
23382
|
for (let j = i; j < length; j++) {
|
|
23384
23383
|
const x = str.charCodeAt(j);
|
|
23385
|
-
if (x >= 55296 && x < 57344)
|
|
23386
|
-
|
|
23387
|
-
const x1 = str.charCodeAt(j + 1);
|
|
23388
|
-
if (x1 < 56320 || x1 >= 57344) i += err(x);
|
|
23384
|
+
if (x >= 55296 && x < 57344) {
|
|
23385
|
+
if (x >= 56320 || j + 1 === length) i += err(x);
|
|
23389
23386
|
else {
|
|
23390
|
-
j
|
|
23391
|
-
|
|
23387
|
+
const x1 = str.charCodeAt(j + 1);
|
|
23388
|
+
if (x1 < 56320 || x1 >= 57344) i += err(x);
|
|
23389
|
+
else {
|
|
23390
|
+
j++;
|
|
23391
|
+
encode(65536 + (x1 & 1023 | (x & 1023) << 10));
|
|
23392
|
+
}
|
|
23392
23393
|
}
|
|
23393
|
-
}
|
|
23394
|
-
else {
|
|
23394
|
+
} else {
|
|
23395
23395
|
const e = map[x];
|
|
23396
23396
|
if (e & 65280) {
|
|
23397
23397
|
u8[i++] = e >> 8;
|
|
@@ -23414,16 +23414,17 @@ function multibyteEncoder$1(enc, onError) {
|
|
|
23414
23414
|
};
|
|
23415
23415
|
for (let j = i; j < length; j++) {
|
|
23416
23416
|
const x = str.charCodeAt(j);
|
|
23417
|
-
if (x >= 55296 && x < 57344)
|
|
23418
|
-
|
|
23419
|
-
const x1 = str.charCodeAt(j + 1);
|
|
23420
|
-
if (x1 < 56320 || x1 >= 57344) i += err(x);
|
|
23417
|
+
if (x >= 55296 && x < 57344) {
|
|
23418
|
+
if (x >= 56320 || j + 1 === length) i += err(x);
|
|
23421
23419
|
else {
|
|
23422
|
-
j
|
|
23423
|
-
|
|
23420
|
+
const x1 = str.charCodeAt(j + 1);
|
|
23421
|
+
if (x1 < 56320 || x1 >= 57344) i += err(x);
|
|
23422
|
+
else {
|
|
23423
|
+
j++;
|
|
23424
|
+
long(65536 + (x1 & 1023 | (x & 1023) << 10));
|
|
23425
|
+
}
|
|
23424
23426
|
}
|
|
23425
|
-
}
|
|
23426
|
-
else {
|
|
23427
|
+
} else {
|
|
23427
23428
|
const e = map[x];
|
|
23428
23429
|
if (e & 65280) {
|
|
23429
23430
|
u8[i++] = e >> 8;
|
|
@@ -23824,39 +23825,42 @@ var init_multi_byte$1 = __esmMin((() => {
|
|
|
23824
23825
|
}
|
|
23825
23826
|
while (i < end || pushback.length > 0) {
|
|
23826
23827
|
const b = pushback.length > 0 ? pushback.pop() : arr[i++];
|
|
23827
|
-
if (g1)
|
|
23828
|
-
|
|
23829
|
-
|
|
23830
|
-
|
|
23831
|
-
|
|
23832
|
-
|
|
23833
|
-
|
|
23834
|
-
|
|
23835
|
-
|
|
23836
|
-
|
|
23837
|
-
|
|
23838
|
-
|
|
23839
|
-
|
|
23840
|
-
|
|
23841
|
-
|
|
23842
|
-
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
if (b
|
|
23852
|
-
g1 = 0;
|
|
23853
|
-
if (cp) o16[oi++] = cp;
|
|
23828
|
+
if (g1) {
|
|
23829
|
+
if (g2) {
|
|
23830
|
+
if (g3) {
|
|
23831
|
+
if (b <= 57 && b >= 48) {
|
|
23832
|
+
const p = index((g1 - 129) * 12600 + (g2 - 48) * 1260 + (g3 - 129) * 10 + b - 48);
|
|
23833
|
+
g1 = g2 = g3 = 0;
|
|
23834
|
+
if (p === void 0) o16[oi++] = err();
|
|
23835
|
+
else if (p <= 65535) o16[oi++] = p;
|
|
23836
|
+
else {
|
|
23837
|
+
const d = p - 65536;
|
|
23838
|
+
o16[oi++] = 55296 | d >> 10;
|
|
23839
|
+
o16[oi++] = 56320 | d & 1023;
|
|
23840
|
+
}
|
|
23841
|
+
} else {
|
|
23842
|
+
pushback.push(b, g3, g2);
|
|
23843
|
+
g1 = g2 = g3 = 0;
|
|
23844
|
+
o16[oi++] = err();
|
|
23845
|
+
}
|
|
23846
|
+
} else if (b >= 129 && b <= 254) g3 = b;
|
|
23847
|
+
else {
|
|
23848
|
+
pushback.push(b, g2);
|
|
23849
|
+
g1 = g2 = 0;
|
|
23850
|
+
o16[oi++] = err();
|
|
23851
|
+
}
|
|
23852
|
+
} else if (b <= 57 && b >= 48) g2 = b;
|
|
23854
23853
|
else {
|
|
23855
|
-
|
|
23856
|
-
if (b
|
|
23854
|
+
let cp;
|
|
23855
|
+
if (b >= 64 && b <= 254 && b !== 127) cp = gb18030[(g1 - 129) * 190 + b - (b < 127 ? 64 : 65)];
|
|
23856
|
+
g1 = 0;
|
|
23857
|
+
if (cp) o16[oi++] = cp;
|
|
23858
|
+
else {
|
|
23859
|
+
o16[oi++] = err();
|
|
23860
|
+
if (b < 128) o16[oi++] = b;
|
|
23861
|
+
}
|
|
23857
23862
|
}
|
|
23858
|
-
}
|
|
23859
|
-
else if (b < 128) o16[oi++] = b;
|
|
23863
|
+
} else if (b < 128) o16[oi++] = b;
|
|
23860
23864
|
else if (b === 128) o16[oi++] = 8364;
|
|
23861
23865
|
else if (b === 255) o16[oi++] = err();
|
|
23862
23866
|
else g1 = b;
|
|
@@ -60321,8 +60325,10 @@ var require_url_state_machine = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
60321
60325
|
let numbersSeen = 0;
|
|
60322
60326
|
while (input[pointer] !== void 0) {
|
|
60323
60327
|
let ipv4Piece = null;
|
|
60324
|
-
if (numbersSeen > 0)
|
|
60325
|
-
|
|
60328
|
+
if (numbersSeen > 0) {
|
|
60329
|
+
if (input[pointer] === p(".") && numbersSeen < 4) ++pointer;
|
|
60330
|
+
else return failure;
|
|
60331
|
+
}
|
|
60326
60332
|
if (!infra.isASCIIDigit(input[pointer])) return failure;
|
|
60327
60333
|
while (infra.isASCIIDigit(input[pointer])) {
|
|
60328
60334
|
const number = parseInt(at(input, pointer));
|
|
@@ -61139,13 +61145,14 @@ var require_URLSearchParams_impl = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
61139
61145
|
set(name, value) {
|
|
61140
61146
|
let found = false;
|
|
61141
61147
|
let i = 0;
|
|
61142
|
-
while (i < this._list.length) if (this._list[i][0] === name)
|
|
61143
|
-
|
|
61144
|
-
|
|
61145
|
-
|
|
61146
|
-
|
|
61147
|
-
|
|
61148
|
-
|
|
61148
|
+
while (i < this._list.length) if (this._list[i][0] === name) {
|
|
61149
|
+
if (found) this._list.splice(i, 1);
|
|
61150
|
+
else {
|
|
61151
|
+
found = true;
|
|
61152
|
+
this._list[i][1] = value;
|
|
61153
|
+
i++;
|
|
61154
|
+
}
|
|
61155
|
+
} else i++;
|
|
61149
61156
|
if (!found) this._list.push([name, value]);
|
|
61150
61157
|
this._updateSteps();
|
|
61151
61158
|
}
|
|
@@ -61242,54 +61249,57 @@ var require_URLSearchParams = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
61242
61249
|
const args = [];
|
|
61243
61250
|
{
|
|
61244
61251
|
let curArg = arguments[0];
|
|
61245
|
-
if (curArg !== void 0)
|
|
61246
|
-
|
|
61247
|
-
|
|
61248
|
-
|
|
61249
|
-
|
|
61250
|
-
|
|
61252
|
+
if (curArg !== void 0) {
|
|
61253
|
+
if (utils.isObject(curArg)) {
|
|
61254
|
+
if (curArg[Symbol.iterator] !== void 0) {
|
|
61255
|
+
if (!utils.isObject(curArg)) throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");
|
|
61256
|
+
else {
|
|
61257
|
+
const V = [];
|
|
61258
|
+
const tmp = curArg;
|
|
61259
|
+
for (let nextItem of tmp) {
|
|
61260
|
+
if (!utils.isObject(nextItem)) throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");
|
|
61261
|
+
else {
|
|
61262
|
+
const V = [];
|
|
61263
|
+
const tmp = nextItem;
|
|
61264
|
+
for (let nextItem of tmp) {
|
|
61265
|
+
nextItem = conversions["USVString"](nextItem, {
|
|
61266
|
+
context: "Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",
|
|
61267
|
+
globals: globalObject
|
|
61268
|
+
});
|
|
61269
|
+
V.push(nextItem);
|
|
61270
|
+
}
|
|
61271
|
+
nextItem = V;
|
|
61272
|
+
}
|
|
61273
|
+
V.push(nextItem);
|
|
61274
|
+
}
|
|
61275
|
+
curArg = V;
|
|
61276
|
+
}
|
|
61277
|
+
} else if (!utils.isObject(curArg)) throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");
|
|
61251
61278
|
else {
|
|
61252
|
-
const
|
|
61253
|
-
const
|
|
61254
|
-
|
|
61255
|
-
|
|
61256
|
-
|
|
61257
|
-
|
|
61258
|
-
|
|
61259
|
-
|
|
61279
|
+
const result = Object.create(null);
|
|
61280
|
+
for (const key of Reflect.ownKeys(curArg)) {
|
|
61281
|
+
const desc = Object.getOwnPropertyDescriptor(curArg, key);
|
|
61282
|
+
if (desc && desc.enumerable) {
|
|
61283
|
+
let typedKey = key;
|
|
61284
|
+
typedKey = conversions["USVString"](typedKey, {
|
|
61285
|
+
context: "Failed to construct 'URLSearchParams': parameter 1 record's key",
|
|
61286
|
+
globals: globalObject
|
|
61287
|
+
});
|
|
61288
|
+
let typedValue = curArg[key];
|
|
61289
|
+
typedValue = conversions["USVString"](typedValue, {
|
|
61290
|
+
context: "Failed to construct 'URLSearchParams': parameter 1 record's value",
|
|
61291
|
+
globals: globalObject
|
|
61292
|
+
});
|
|
61293
|
+
result[typedKey] = typedValue;
|
|
61294
|
+
}
|
|
61260
61295
|
}
|
|
61261
|
-
|
|
61262
|
-
}
|
|
61263
|
-
V.push(nextItem);
|
|
61264
|
-
}
|
|
61265
|
-
curArg = V;
|
|
61266
|
-
}
|
|
61267
|
-
else if (!utils.isObject(curArg)) throw new globalObject.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");
|
|
61268
|
-
else {
|
|
61269
|
-
const result = Object.create(null);
|
|
61270
|
-
for (const key of Reflect.ownKeys(curArg)) {
|
|
61271
|
-
const desc = Object.getOwnPropertyDescriptor(curArg, key);
|
|
61272
|
-
if (desc && desc.enumerable) {
|
|
61273
|
-
let typedKey = key;
|
|
61274
|
-
typedKey = conversions["USVString"](typedKey, {
|
|
61275
|
-
context: "Failed to construct 'URLSearchParams': parameter 1 record's key",
|
|
61276
|
-
globals: globalObject
|
|
61277
|
-
});
|
|
61278
|
-
let typedValue = curArg[key];
|
|
61279
|
-
typedValue = conversions["USVString"](typedValue, {
|
|
61280
|
-
context: "Failed to construct 'URLSearchParams': parameter 1 record's value",
|
|
61281
|
-
globals: globalObject
|
|
61282
|
-
});
|
|
61283
|
-
result[typedKey] = typedValue;
|
|
61296
|
+
curArg = result;
|
|
61284
61297
|
}
|
|
61285
|
-
}
|
|
61286
|
-
|
|
61287
|
-
|
|
61288
|
-
|
|
61289
|
-
|
|
61290
|
-
globals: globalObject
|
|
61291
|
-
});
|
|
61292
|
-
else curArg = "";
|
|
61298
|
+
} else curArg = conversions["USVString"](curArg, {
|
|
61299
|
+
context: "Failed to construct 'URLSearchParams': parameter 1",
|
|
61300
|
+
globals: globalObject
|
|
61301
|
+
});
|
|
61302
|
+
} else curArg = "";
|
|
61293
61303
|
args.push(curArg);
|
|
61294
61304
|
}
|
|
61295
61305
|
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse-tmx",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.2",
|
|
4
4
|
"description": "A parser for tmx.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"game-development",
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
"typecheck": "tsgo"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@esposter/shared": "2.
|
|
49
|
-
"@esposter/xml2js": "2.
|
|
48
|
+
"@esposter/shared": "2.37.2",
|
|
49
|
+
"@esposter/xml2js": "2.37.2",
|
|
50
50
|
"data-urls": "^7.0.0",
|
|
51
51
|
"dayjs": "^1.11.21"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@esposter/configuration": "2.
|
|
54
|
+
"@esposter/configuration": "2.37.2",
|
|
55
55
|
"@types/data-urls": "^3.0.5",
|
|
56
56
|
"@types/xml2js": "^0.4.14",
|
|
57
57
|
"ctix": "^2.8.2",
|
|
58
|
-
"rolldown": "^1.2.
|
|
58
|
+
"rolldown": "^1.2.4",
|
|
59
59
|
"type-fest": "^5.8.0",
|
|
60
60
|
"vitest": "^4.1.10"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "4d775dbd8289e6caaee48f08038b65fddb4babbc"
|
|
63
63
|
}
|