@ygracs/xobj-lib-js 0.2.6-b → 0.2.7-b
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 +1 -1
- package/lib/xObj-defs.d.ts +4 -28
- package/lib/xObj-defs.js +5 -9
- package/lib/xObj-lib.d.ts +28 -9
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2019-
|
|
3
|
+
Copyright (c) 2019-2026 Yuri Grachev
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/lib/xObj-defs.d.ts
CHANGED
|
@@ -70,40 +70,14 @@ export type js2xmlParseOptions = {
|
|
|
70
70
|
spaces?: any;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
export const XOBJ_DEF_PARAM_TNAME: "__text";
|
|
74
|
-
export const XOBJ_DEF_ATTR_TNAME: "__attr";
|
|
75
73
|
export namespace XOBJ_DEF_TNAMES {
|
|
76
74
|
export { XOBJ_DEF_PARAM_TNAME };
|
|
77
75
|
export { XOBJ_DEF_ATTR_TNAME };
|
|
78
76
|
export { XOBJ_DEF_DECL_TNAME };
|
|
79
77
|
export { XOBJ_DEF_CDATA_TNAME };
|
|
80
78
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export { XOBJ_DEF_DECL_TNAME as declarationKey };
|
|
84
|
-
export { XOBJ_DEF_ATTR_TNAME as attributesKey };
|
|
85
|
-
export { XOBJ_DEF_PARAM_TNAME as textKey };
|
|
86
|
-
export let commentKey: string;
|
|
87
|
-
export { XOBJ_DEF_CDATA_TNAME as cdataKey };
|
|
88
|
-
export let nameKey: string;
|
|
89
|
-
export let typeKey: string;
|
|
90
|
-
export let parentKey: string;
|
|
91
|
-
export let elementsKey: string;
|
|
92
|
-
export let ignoreDeclaration: boolean;
|
|
93
|
-
export let ignoreDocType: boolean;
|
|
94
|
-
/** @deprecated */
|
|
95
|
-
export let ignoreInstractions: boolean;
|
|
96
|
-
export let ignoreInstraction: boolean;
|
|
97
|
-
export let ignoreText: boolean;
|
|
98
|
-
/** @deprecated */
|
|
99
|
-
export let ignoreComments: boolean;
|
|
100
|
-
export let ignoreComment: boolean;
|
|
101
|
-
export let ignoreCData: boolean;
|
|
102
|
-
export let fullTagEmptyElement: boolean;
|
|
103
|
-
export let addParent: boolean;
|
|
104
|
-
export let trim: boolean;
|
|
105
|
-
export let spaces: number;
|
|
106
|
-
}
|
|
79
|
+
|
|
80
|
+
export const DEF_XML_PARSE_OPTIONS: OPT_parserOptions;
|
|
107
81
|
|
|
108
82
|
/**
|
|
109
83
|
* @classdesc Implements a container that provide a functionality to work
|
|
@@ -137,6 +111,8 @@ export class TXmlContentParseOptions {
|
|
|
137
111
|
#private;
|
|
138
112
|
}
|
|
139
113
|
|
|
114
|
+
declare const XOBJ_DEF_PARAM_TNAME: "__text";
|
|
115
|
+
declare const XOBJ_DEF_ATTR_TNAME: "__attr";
|
|
140
116
|
declare const XOBJ_DEF_DECL_TNAME: "__decl";
|
|
141
117
|
declare const XOBJ_DEF_CDATA_TNAME: "__cdata";
|
|
142
118
|
export {};
|
package/lib/xObj-defs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.067-20260101]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -25,6 +25,9 @@ const XOBJ_DEF_TNAMES = {
|
|
|
25
25
|
XOBJ_DEF_DECL_TNAME,
|
|
26
26
|
XOBJ_DEF_CDATA_TNAME,
|
|
27
27
|
};
|
|
28
|
+
//module.exports.XOBJ_DEF_PARAM_TNAME = XOBJ_DEF_PARAM_TNAME;
|
|
29
|
+
//module.exports.XOBJ_DEF_ATTR_TNAME = XOBJ_DEF_ATTR_TNAME;
|
|
30
|
+
module.exports.XOBJ_DEF_TNAMES = XOBJ_DEF_TNAMES;
|
|
28
31
|
|
|
29
32
|
/**
|
|
30
33
|
* A parser options settings
|
|
@@ -78,6 +81,7 @@ const DEF_XML_PARSE_OPTIONS = {
|
|
|
78
81
|
trim: true,
|
|
79
82
|
spaces: 2,
|
|
80
83
|
};
|
|
84
|
+
module.exports.DEF_XML_PARSE_OPTIONS = DEF_XML_PARSE_OPTIONS;
|
|
81
85
|
|
|
82
86
|
/***
|
|
83
87
|
* (* function definitions *)
|
|
@@ -281,12 +285,4 @@ class TXmlContentParseOptions {
|
|
|
281
285
|
}
|
|
282
286
|
|
|
283
287
|
}
|
|
284
|
-
|
|
285
|
-
// === module exports block ===
|
|
286
|
-
|
|
287
|
-
module.exports.XOBJ_DEF_PARAM_TNAME = XOBJ_DEF_PARAM_TNAME;
|
|
288
|
-
module.exports.XOBJ_DEF_ATTR_TNAME = XOBJ_DEF_ATTR_TNAME;
|
|
289
|
-
module.exports.XOBJ_DEF_TNAMES = XOBJ_DEF_TNAMES;
|
|
290
|
-
module.exports.DEF_XML_PARSE_OPTIONS = DEF_XML_PARSE_OPTIONS;
|
|
291
|
-
|
|
292
288
|
module.exports.TXmlContentParseOptions = TXmlContentParseOptions;
|
package/lib/xObj-lib.d.ts
CHANGED
|
@@ -2,38 +2,56 @@
|
|
|
2
2
|
* A result of a value check ops.
|
|
3
3
|
*/
|
|
4
4
|
export type RVAL_reason = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* - message ID
|
|
7
|
+
*/
|
|
6
8
|
code: string;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* - message text
|
|
11
|
+
*/
|
|
8
12
|
msg: string;
|
|
9
13
|
};
|
|
10
14
|
/**
|
|
11
15
|
* A result of a value check ops.
|
|
12
16
|
*/
|
|
13
17
|
export type VCOR_evalkname = {
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* - ops flag
|
|
20
|
+
*/
|
|
15
21
|
isSucceed: boolean;
|
|
16
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* - result value or reson if failed
|
|
24
|
+
*/
|
|
17
25
|
value: string | RVAL_reason;
|
|
18
26
|
};
|
|
19
27
|
/**
|
|
20
28
|
* A result of an element name pattern evaluation ops.
|
|
21
29
|
*/
|
|
22
30
|
export type XObjENameDescr = {
|
|
23
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* - ops flag
|
|
33
|
+
*/
|
|
24
34
|
isERR: boolean;
|
|
25
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* - element name
|
|
37
|
+
*/
|
|
26
38
|
name: null | number | string;
|
|
27
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* - some conditions applied to an element
|
|
41
|
+
*/
|
|
28
42
|
conditions: object | null;
|
|
29
43
|
};
|
|
30
44
|
/**
|
|
31
45
|
* A result of an xObj modification ops
|
|
32
46
|
*/
|
|
33
47
|
export type RVAL_emodif = {
|
|
34
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* - flag that indicates whether an ops is succeed or not
|
|
50
|
+
*/
|
|
35
51
|
isSucceed: boolean;
|
|
36
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* - some element as a result
|
|
54
|
+
*/
|
|
37
55
|
item: object | object[] | null;
|
|
38
56
|
};
|
|
39
57
|
/**
|
|
@@ -295,3 +313,4 @@ export function insertXObjElements(obj: object, ...args: any[]): number;
|
|
|
295
313
|
* @throws {TypeError} if first param is not an object
|
|
296
314
|
*/
|
|
297
315
|
export function insertXObjEChain(obj: object, ...args: any[]): any | null;
|
|
316
|
+
export {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ygracs/xobj-lib-js",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7-b",
|
|
4
4
|
"description": "A helper library to work with xml-js module",
|
|
5
5
|
"author": "ygracs <cs70th-om@rambler.ru>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"#test-dir/*": "./__test__/*"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ygracs/bsfoc-lib-js": "^0.3.
|
|
34
|
+
"@ygracs/bsfoc-lib-js": "^0.3.2-b"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@ygracs/test-helper": "~0.0.1-b",
|