fast-xml-parser 5.2.4 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/fxp.cjs +1 -1
- package/lib/fxp.d.cts +1 -1
- package/lib/fxp.min.js +1 -1
- package/lib/fxp.min.js.map +1 -1
- package/lib/fxparser.min.js +1 -1
- package/lib/fxparser.min.js.map +1 -1
- package/package.json +1 -2
- package/src/cli/cli.js +4 -0
- package/src/fxp.d.ts +7 -7
- package/src/xmlparser/DocTypeReader.js +297 -287
- package/src/xmlparser/OrderedObjParser.js +3 -2
- package/src/xmlparser/XMLParser.js +4 -4
package/src/fxp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type X2jOptions = {
|
|
1
|
+
export type X2jOptions = {
|
|
2
2
|
/**
|
|
3
3
|
* Preserve the order of tags in resulting JS object
|
|
4
4
|
*
|
|
@@ -64,7 +64,7 @@ type X2jOptions = {
|
|
|
64
64
|
parseTagValue?: boolean;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
* Whether to parse
|
|
67
|
+
* Whether to parse attribute value with `strnum` package
|
|
68
68
|
*
|
|
69
69
|
* Defaults to `false`
|
|
70
70
|
*/
|
|
@@ -218,14 +218,14 @@ type X2jOptions = {
|
|
|
218
218
|
captureMetaData?: boolean;
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
type strnumOptions = {
|
|
221
|
+
export type strnumOptions = {
|
|
222
222
|
hex: boolean;
|
|
223
223
|
leadingZeros: boolean,
|
|
224
224
|
skipLike?: RegExp,
|
|
225
225
|
eNotation?: boolean
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
type validationOptions = {
|
|
228
|
+
export type validationOptions = {
|
|
229
229
|
/**
|
|
230
230
|
* Whether to allow attributes without value
|
|
231
231
|
*
|
|
@@ -241,7 +241,7 @@ type validationOptions = {
|
|
|
241
241
|
unpairedTags?: string[];
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
-
type XmlBuilderOptions = {
|
|
244
|
+
export type XmlBuilderOptions = {
|
|
245
245
|
/**
|
|
246
246
|
* Give a prefix to the attribute name in the resulting JS object
|
|
247
247
|
*
|
|
@@ -395,7 +395,7 @@ type XmlBuilderOptions = {
|
|
|
395
395
|
|
|
396
396
|
type ESchema = string | object | Array<string|object>;
|
|
397
397
|
|
|
398
|
-
type ValidationError = {
|
|
398
|
+
export type ValidationError = {
|
|
399
399
|
err: {
|
|
400
400
|
code: string;
|
|
401
401
|
msg: string,
|
|
@@ -406,7 +406,7 @@ type ValidationError = {
|
|
|
406
406
|
|
|
407
407
|
export class XMLParser {
|
|
408
408
|
constructor(options?: X2jOptions);
|
|
409
|
-
parse(xmlData: string |
|
|
409
|
+
parse(xmlData: string | Uint8Array, validationOptions?: validationOptions | boolean): any;
|
|
410
410
|
/**
|
|
411
411
|
* Add Entity which is not by default supported by this library
|
|
412
412
|
* @param entityIdentifier {string} Eg: 'ent' for &ent;
|