@ygracs/xobj-lib-js 0.2.9-b.1 → 0.3.0-beta.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 +5 -1
- package/README.md +6 -6
- package/doc/xObj.md +60 -2
- package/index.d.ts +92 -63
- package/index.js +52 -2
- package/lib/xObj-defs.d.ts +7 -2
- package/lib/xObj-defs.js +10 -1
- package/lib/xObj-errors.d.ts +3 -2
- package/lib/xObj-errors.js +2 -1
- package/lib/xObj-lib.d.ts +69 -56
- package/lib/xObj-lib.js +139 -82
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
#### *v0.
|
|
1
|
+
#### *v0.3.x*
|
|
2
2
|
|
|
3
3
|
Release version.
|
|
4
4
|
|
|
5
5
|
> - update `xObj.md`;
|
|
6
6
|
> - updated dependency on `@ygracs/bsfoc-lib-js` module to v0.3.3;
|
|
7
|
+
> - change behavior for function: `addXObjElement` on handling exceptions;
|
|
7
8
|
> - change behavior for function: `evalKeyName` on handling `opt` parameter;
|
|
8
9
|
> - change behavior for function: `writeXObjParamRaw`, `writeXObjAttrRaw`;
|
|
10
|
+
> - improve behavior for function: `writeXObjParam`, `writeXObjParamEx`, `writeXObjAttr`, `writeXObjAttrEx`;
|
|
11
|
+
> - add a new function: `addXObjElementEx`, `clearXObjNode`;
|
|
9
12
|
> - add a new `EvalKeyNameError` class;
|
|
13
|
+
> - add new `compact`-property for `TXmlContentParseOptions`;
|
|
10
14
|
> - some fixes.
|
|
11
15
|
|
|
12
16
|
#### *v0.2.4*
|
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|***rev.*:**|0.1.
|
|
1
|
+
|***rev.*:**|0.1.3|
|
|
2
2
|
|:---|---:|
|
|
3
|
-
|***date***:|
|
|
3
|
+
|***date***:|2026-02-28|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
7
|
-
This module provide a helper functions for object manipulation. It was primarily written to work with a XML-
|
|
7
|
+
This module provide a helper functions for object manipulation. It was primarily written to work with a XML-parser provided by a [`xml-js`](https://www.npmjs.com/package/xml-js) module for 'Node.js' running in "compact" mode.
|
|
8
8
|
|
|
9
|
-
> Note: for more see `xObj.md` in the
|
|
9
|
+
> Note: for more see `xObj.md` in the package `doc` directory or in a package [*repo*](https://gitlab.com/ygracs/xobj-lib-js).
|
|
10
10
|
|
|
11
|
-
> Notes on upgrade to `v0.
|
|
12
|
-
> > The `v0.
|
|
11
|
+
> Notes on upgrade to `v0.3.0`
|
|
12
|
+
> > The `v0.3.0` is not fully compatible with a previous one due to some breaking changes. For more details read the docs for a functions used in your project.
|
|
13
13
|
|
|
14
14
|
## Use cases
|
|
15
15
|
|
package/doc/xObj.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
>|***rev.*:**|0.1.
|
|
1
|
+
>|***rev.*:**|0.1.51|
|
|
2
2
|
>|:---|---:|
|
|
3
|
-
>|date:|2026-02-
|
|
3
|
+
>|date:|2026-02-28|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
@@ -19,6 +19,10 @@ This paper describes a functions provided by `xObj.js` module.
|
|
|
19
19
|
- <a href="#EvalKeyNameError">EvalKeyNameError</a>
|
|
20
20
|
|
|
21
21
|
- Functions
|
|
22
|
+
- <a href="#func+attribute+read">read element attributes</a>
|
|
23
|
+
- <a href="#func+attribute+write">write element attributes</a>
|
|
24
|
+
- <a href="#func+param+read">read element parameter</a>
|
|
25
|
+
- <a href="#func+param+write">write element parameter</a>
|
|
22
26
|
|
|
23
27
|
### Base type definitions
|
|
24
28
|
|
|
@@ -135,6 +139,7 @@ The settings listed in the table below:
|
|
|
135
139
|
| `trim` | `boolean` | `true` ||
|
|
136
140
|
| `spaces` | `number` | `2` ||
|
|
137
141
|
|
|
142
|
+
<a name="func+param+read"></a>
|
|
138
143
|
### Base functions for read an object parameter value
|
|
139
144
|
|
|
140
145
|
> Note:
|
|
@@ -259,6 +264,7 @@ The function throws a `TypeError` exception in case:
|
|
|
259
264
|
- code: `ERR_XOBJ_NPOBJ`
|
|
260
265
|
+ if `object` parameter is not an `Object` instance.
|
|
261
266
|
|
|
267
|
+
<a name="func+param+write"></a>
|
|
262
268
|
### Base functions for write an object parameter value
|
|
263
269
|
|
|
264
270
|
> Note:
|
|
@@ -384,6 +390,7 @@ The function throws a `TypeError` exception in case:
|
|
|
384
390
|
- code: `ERR_XOBJ_NPOBJ`
|
|
385
391
|
+ if `object` parameter is not an `Object` instance.
|
|
386
392
|
|
|
393
|
+
<a name="func+attribute+read"></a>
|
|
387
394
|
### Base functions for read an object attributes value
|
|
388
395
|
|
|
389
396
|
> Note:
|
|
@@ -513,6 +520,7 @@ The function throws a `TypeError` exception in case:
|
|
|
513
520
|
- code: `ERR_XOBJ_NPOBJ`
|
|
514
521
|
+ if `object` parameter is not an `Object` instance.
|
|
515
522
|
|
|
523
|
+
<a name="func+attribute+write"></a>
|
|
516
524
|
### Base functions for write an object attributes value
|
|
517
525
|
|
|
518
526
|
> Note:
|
|
@@ -878,6 +886,27 @@ The function throws a `TypeError` exception in case:
|
|
|
878
886
|
<a name="addXObjElement"></a>
|
|
879
887
|
#### **addXObjElement(object, name)** => `object`
|
|
880
888
|
|
|
889
|
+
This function adds an element given by `name` parameter to a members of the given object. If succeed the element will be returned or `null` in opposite.
|
|
890
|
+
|
|
891
|
+
##### ***parameters***
|
|
892
|
+
|
|
893
|
+
| parameter name | value type | default value | description |
|
|
894
|
+
|:---|---|---:|:---|
|
|
895
|
+
| `object` | `object` | --- | some object |
|
|
896
|
+
| `name` | `string` | --- | some child element ID |
|
|
897
|
+
|
|
898
|
+
##### ***exceptions***
|
|
899
|
+
|
|
900
|
+
The function throws a `TypeError` exception in case:
|
|
901
|
+
|
|
902
|
+
- code: `ERR_XOBJ_NPOBJ`
|
|
903
|
+
+ if `object` parameter is not an `Object` instance;
|
|
904
|
+
|
|
905
|
+
<a name="addXObjElementEx"></a>
|
|
906
|
+
#### **addXObjElementEx(object, name)** => `object`
|
|
907
|
+
|
|
908
|
+
> since: \[v0.2.0]
|
|
909
|
+
|
|
881
910
|
This function adds an element given by `name` parameter to a members of the given object and returns an `object` that represents a status of the operation.
|
|
882
911
|
|
|
883
912
|
##### ***parameters***
|
|
@@ -1048,6 +1077,26 @@ The function throws a `TypeError` exception in case:
|
|
|
1048
1077
|
+ if `name` parameter given and is not a type of a `string`;
|
|
1049
1078
|
+ id `value` parameter given and is not a type of a `string`.
|
|
1050
1079
|
|
|
1080
|
+
<a name="clearXObjNode"></a>
|
|
1081
|
+
#### **clearXObjNode(node)** => `boolean`
|
|
1082
|
+
|
|
1083
|
+
> since: \[v0.2.x]
|
|
1084
|
+
|
|
1085
|
+
This function tries to clean a given node.
|
|
1086
|
+
|
|
1087
|
+
##### ***parameters***
|
|
1088
|
+
|
|
1089
|
+
| parameter name | value type | default value | description |
|
|
1090
|
+
|:---|---|---:|:---|
|
|
1091
|
+
| `node` | `object` or `object[]` | --- | some node |
|
|
1092
|
+
|
|
1093
|
+
##### ***exceptions***
|
|
1094
|
+
|
|
1095
|
+
The function throws a `TypeError` exception in case:
|
|
1096
|
+
|
|
1097
|
+
- code: `ERR_XOBJ_NPOBJ`
|
|
1098
|
+
+ if `node` parameter is not an `Object` or `Array` instance;
|
|
1099
|
+
|
|
1051
1100
|
### Other special functions
|
|
1052
1101
|
|
|
1053
1102
|
<a name="evalXObjEName"></a>
|
|
@@ -1233,6 +1282,15 @@ The class constructor receives an arguments listed below:
|
|
|
1233
1282
|
|---|---|:---|
|
|
1234
1283
|
| `object` | yes | contains a current options |
|
|
1235
1284
|
|
|
1285
|
+
<a name="TXmlContentParseOptions+compact"></a>
|
|
1286
|
+
###### **compact**
|
|
1287
|
+
|
|
1288
|
+
> since: \[v0.2.x]
|
|
1289
|
+
|
|
1290
|
+
| property type | read only | description |
|
|
1291
|
+
|---|---|:---|
|
|
1292
|
+
| `boolean` | yes | returns a current value for a `compact`-options |
|
|
1293
|
+
|
|
1236
1294
|
<a name="TXmlContentParseOptions+xml2js"></a>
|
|
1237
1295
|
###### **xml2js**
|
|
1238
1296
|
|
package/index.d.ts
CHANGED
|
@@ -1,78 +1,107 @@
|
|
|
1
|
-
declare const _exports: {
|
|
2
|
-
readXObjParamRaw: typeof import("./lib/xObj-lib").readXObjParamRaw;
|
|
3
|
-
readXObjParam: typeof import("./lib/xObj-lib").readXObjParam;
|
|
4
|
-
readXObjParamAsBool: typeof import("./lib/xObj-lib").readXObjParamAsBool;
|
|
5
|
-
readXObjParamAsNum: typeof import("./lib/xObj-lib").readXObjParamAsNum;
|
|
6
|
-
readXObjParamEx: typeof import("./lib/xObj-lib").readXObjParamEx;
|
|
7
|
-
readXObjParamAsIndex: typeof import("./lib/xObj-lib").readXObjParamAsIndex;
|
|
8
|
-
writeXObjParamRaw: typeof import("./lib/xObj-lib").writeXObjParamRaw;
|
|
9
|
-
writeXObjParam: typeof import("./lib/xObj-lib").writeXObjParam;
|
|
10
|
-
writeXObjParamAsBool: typeof import("./lib/xObj-lib").writeXObjParamAsBool;
|
|
11
|
-
writeXObjParamAsNum: typeof import("./lib/xObj-lib").writeXObjParamAsNum;
|
|
12
|
-
writeXObjParamAsIndex: typeof import("./lib/xObj-lib").writeXObjParamAsIndex;
|
|
13
|
-
writeXObjParamEx: typeof import("./lib/xObj-lib").writeXObjParamEx;
|
|
14
|
-
readXObjAttrRaw: typeof import("./lib/xObj-lib").readXObjAttrRaw;
|
|
15
|
-
readXObjAttr: typeof import("./lib/xObj-lib").readXObjAttr;
|
|
16
|
-
readXObjAttrAsBool: typeof import("./lib/xObj-lib").readXObjAttrAsBool;
|
|
17
|
-
readXObjAttrAsNum: typeof import("./lib/xObj-lib").readXObjAttrAsNum;
|
|
18
|
-
readXObjAttrEx: typeof import("./lib/xObj-lib").readXObjAttrEx;
|
|
19
|
-
readXObjAttrAsIndex: typeof import("./lib/xObj-lib").readXObjAttrAsIndex;
|
|
20
|
-
writeXObjAttrRaw: typeof import("./lib/xObj-lib").writeXObjAttrRaw;
|
|
21
|
-
writeXObjAttr: typeof import("./lib/xObj-lib").writeXObjAttr;
|
|
22
|
-
writeXObjAttrAsBool: typeof import("./lib/xObj-lib").writeXObjAttrAsBool;
|
|
23
|
-
writeXObjAttrAsNum: typeof import("./lib/xObj-lib").writeXObjAttrAsNum;
|
|
24
|
-
writeXObjAttrAsIndex: typeof import("./lib/xObj-lib").writeXObjAttrAsIndex;
|
|
25
|
-
writeXObjAttrEx: typeof import("./lib/xObj-lib").writeXObjAttrEx;
|
|
26
|
-
getXObjAttributes: typeof import("./lib/xObj-lib").getXObjAttributes;
|
|
27
|
-
checkXObjAttribute: typeof import("./lib/xObj-lib").checkXObjAttribute;
|
|
28
|
-
deleteXObjAttribute: typeof import("./lib/xObj-lib").deleteXObjAttribute;
|
|
29
|
-
renameXObjAttribute: typeof import("./lib/xObj-lib").renameXObjAttribute;
|
|
30
|
-
getXObjElement: typeof import("./lib/xObj-lib").getXObjElement;
|
|
31
|
-
addXObjElement: typeof import("./lib/xObj-lib").addXObjElement;
|
|
32
|
-
insertXObjElement: typeof import("./lib/xObj-lib").insertXObjElement;
|
|
33
|
-
insertXObjElementEx: typeof import("./lib/xObj-lib").insertXObjElementEx;
|
|
34
|
-
deleteXObjElement: typeof import("./lib/xObj-lib").deleteXObjElement;
|
|
35
|
-
deleteXObjElementEx: typeof import("./lib/xObj-lib").deleteXObjElementEx;
|
|
36
|
-
renameXObjElement: typeof import("./lib/xObj-lib").renameXObjElement;
|
|
37
|
-
evalXObjEName: typeof import("./lib/xObj-lib").evalXObjEName;
|
|
38
|
-
insertXObjEList: typeof import("./lib/xObj-lib").insertXObjEList;
|
|
39
|
-
insertXObjEListEx: typeof import("./lib/xObj-lib").insertXObjEListEx;
|
|
40
|
-
evalKeyName: typeof import("./lib/xObj-lib").evalKeyName;
|
|
41
|
-
genXObjENameDescr: typeof import("./lib/xObj-lib").genXObjENameDescr;
|
|
42
|
-
insertXObjElements: typeof import("./lib/xObj-lib").insertXObjElements;
|
|
43
|
-
insertXObjEChain: typeof import("./lib/xObj-lib").insertXObjEChain;
|
|
44
|
-
|
|
45
|
-
TXmlContentParseOptions: typeof TXmlContentParseOptions; // [?] class declaration
|
|
46
|
-
DEF_XML_PARSE_OPTIONS: typeof DEF_XML_PARSE_OPTIONS;
|
|
47
|
-
XOBJ_DEF_TNAMES: typeof XOBJ_DEF_TNAMES;
|
|
48
|
-
|
|
49
|
-
EvalKeyNameError: typeof EvalKeyNameError; // [?] class declaration
|
|
50
|
-
|
|
51
|
-
xml2jsParseOptions: xml2jsParseOptions;
|
|
52
|
-
js2xmlParseOptions: js2xmlParseOptions;
|
|
53
|
-
OPT_parserOptions: OPT_parserOptions;
|
|
54
|
-
|
|
55
|
-
XObjENameDescr: XObjENameDescr;
|
|
56
|
-
OPT_inselops_L: OPT_inselops_L;
|
|
57
|
-
OPT_inselops_S: OPT_inselops_S;
|
|
58
|
-
RVAL_reason: RVAL_reason;
|
|
59
|
-
RVAL_emodif: RVAL_emodif;
|
|
60
|
-
VCOR_evalkname: VCOR_evalkname;
|
|
61
|
-
};
|
|
62
|
-
export = _exports;
|
|
63
1
|
import { TXmlContentParseOptions } from "./lib/xObj-defs";
|
|
64
2
|
import { DEF_XML_PARSE_OPTIONS } from "./lib/xObj-defs";
|
|
65
3
|
import { XOBJ_DEF_TNAMES } from "./lib/xObj-defs";
|
|
66
|
-
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
TXmlContentParseOptions,
|
|
7
|
+
DEF_XML_PARSE_OPTIONS,
|
|
8
|
+
XOBJ_DEF_TNAMES,
|
|
9
|
+
};
|
|
67
10
|
|
|
68
11
|
import type {
|
|
69
12
|
xml2jsParseOptions, js2xmlParseOptions,
|
|
70
13
|
OPT_parserOptions,
|
|
71
14
|
} from "./lib/xObj-defs";
|
|
72
15
|
|
|
16
|
+
export type {
|
|
17
|
+
xml2jsParseOptions, js2xmlParseOptions,
|
|
18
|
+
OPT_parserOptions,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
import { EvalKeyNameError } from "./lib/xObj-errors";
|
|
22
|
+
|
|
23
|
+
export { EvalKeyNameError };
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
readXObjParamRaw,
|
|
27
|
+
readXObjParam,
|
|
28
|
+
readXObjParamEx,
|
|
29
|
+
readXObjParamAsBool, readXObjParamAsNum, readXObjParamAsIndex,
|
|
30
|
+
writeXObjParamRaw,
|
|
31
|
+
writeXObjParam,
|
|
32
|
+
writeXObjParamEx,
|
|
33
|
+
writeXObjParamAsBool, writeXObjParamAsNum, writeXObjParamAsIndex,
|
|
34
|
+
readXObjAttrRaw,
|
|
35
|
+
readXObjAttr,
|
|
36
|
+
readXObjAttrEx,
|
|
37
|
+
readXObjAttrAsBool, readXObjAttrAsNum, readXObjAttrAsIndex,
|
|
38
|
+
writeXObjAttrRaw,
|
|
39
|
+
writeXObjAttr,
|
|
40
|
+
writeXObjAttrEx,
|
|
41
|
+
writeXObjAttrAsBool, writeXObjAttrAsNum, writeXObjAttrAsIndex,
|
|
42
|
+
getXObjAttributes,
|
|
43
|
+
checkXObjAttribute,
|
|
44
|
+
deleteXObjAttribute,
|
|
45
|
+
renameXObjAttribute,
|
|
46
|
+
getXObjElement,
|
|
47
|
+
addXObjElement, addXObjElementEx,
|
|
48
|
+
insertXObjElement, insertXObjElementEx,
|
|
49
|
+
deleteXObjElement, deleteXObjElementEx,
|
|
50
|
+
renameXObjElement,
|
|
51
|
+
insertXObjEList, insertXObjEListEx,
|
|
52
|
+
evalXObjEName,
|
|
53
|
+
evalKeyName,
|
|
54
|
+
genXObjENameDescr,
|
|
55
|
+
insertXObjElements,
|
|
56
|
+
insertXObjEChain,
|
|
57
|
+
clearXObjNode,
|
|
58
|
+
} from "./lib/xObj-lib";
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
readXObjParamRaw,
|
|
62
|
+
readXObjParam,
|
|
63
|
+
readXObjParamEx,
|
|
64
|
+
readXObjParamAsBool, readXObjParamAsNum, readXObjParamAsIndex,
|
|
65
|
+
writeXObjParamRaw,
|
|
66
|
+
writeXObjParam,
|
|
67
|
+
writeXObjParamEx,
|
|
68
|
+
writeXObjParamAsBool, writeXObjParamAsNum, writeXObjParamAsIndex,
|
|
69
|
+
readXObjAttrRaw,
|
|
70
|
+
readXObjAttr,
|
|
71
|
+
readXObjAttrEx,
|
|
72
|
+
readXObjAttrAsBool, readXObjAttrAsNum, readXObjAttrAsIndex,
|
|
73
|
+
writeXObjAttrRaw,
|
|
74
|
+
writeXObjAttr,
|
|
75
|
+
writeXObjAttrEx,
|
|
76
|
+
writeXObjAttrAsBool, writeXObjAttrAsNum, writeXObjAttrAsIndex,
|
|
77
|
+
getXObjAttributes,
|
|
78
|
+
checkXObjAttribute,
|
|
79
|
+
deleteXObjAttribute,
|
|
80
|
+
renameXObjAttribute,
|
|
81
|
+
getXObjElement,
|
|
82
|
+
addXObjElement, addXObjElementEx,
|
|
83
|
+
insertXObjElement, insertXObjElementEx,
|
|
84
|
+
deleteXObjElement, deleteXObjElementEx,
|
|
85
|
+
renameXObjElement,
|
|
86
|
+
insertXObjEList, insertXObjEListEx,
|
|
87
|
+
evalXObjEName,
|
|
88
|
+
evalKeyName,
|
|
89
|
+
genXObjENameDescr,
|
|
90
|
+
insertXObjElements,
|
|
91
|
+
insertXObjEChain,
|
|
92
|
+
clearXObjNode,
|
|
93
|
+
};
|
|
94
|
+
|
|
73
95
|
import type {
|
|
74
96
|
XObjENameDescr,
|
|
75
97
|
OPT_inselops_L, OPT_inselops_S,
|
|
76
98
|
RVAL_reason, RVAL_emodif,
|
|
77
99
|
VCOR_evalkname,
|
|
78
100
|
} from "./lib/xObj-lib";
|
|
101
|
+
|
|
102
|
+
export type {
|
|
103
|
+
XObjENameDescr,
|
|
104
|
+
OPT_inselops_L, OPT_inselops_S,
|
|
105
|
+
RVAL_reason, RVAL_emodif,
|
|
106
|
+
VCOR_evalkname,
|
|
107
|
+
};
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.015-20260227]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -12,16 +12,66 @@ const {
|
|
|
12
12
|
EvalKeyNameError,
|
|
13
13
|
} = require('./lib/xObj-errors');
|
|
14
14
|
|
|
15
|
+
const xObj = require('./lib/xObj-lib');
|
|
16
|
+
|
|
15
17
|
// === module inner block ===
|
|
16
18
|
|
|
17
19
|
// === module main block ===
|
|
18
20
|
|
|
19
21
|
// === module exports block ===
|
|
20
22
|
|
|
21
|
-
module.exports = require('./lib/xObj-lib');
|
|
23
|
+
//module.exports = require('./lib/xObj-lib');
|
|
22
24
|
|
|
23
25
|
module.exports.TXmlContentParseOptions = TXmlContentParseOptions;
|
|
24
26
|
module.exports.DEF_XML_PARSE_OPTIONS = DEF_XML_PARSE_OPTIONS;
|
|
25
27
|
module.exports.XOBJ_DEF_TNAMES = XOBJ_DEF_TNAMES;
|
|
26
28
|
|
|
27
29
|
module.exports.EvalKeyNameError = EvalKeyNameError;
|
|
30
|
+
|
|
31
|
+
module.exports.readXObjParamRaw = xObj.readXObjParamRaw;
|
|
32
|
+
module.exports.readXObjParam = xObj.readXObjParam;
|
|
33
|
+
module.exports.readXObjParamAsBool = xObj.readXObjParamAsBool;
|
|
34
|
+
module.exports.readXObjParamAsNum = xObj.readXObjParamAsNum;
|
|
35
|
+
module.exports.readXObjParamEx = xObj.readXObjParamEx;
|
|
36
|
+
module.exports.readXObjParamAsIndex = xObj.readXObjParamAsIndex;
|
|
37
|
+
module.exports.writeXObjParamRaw = xObj.writeXObjParamRaw;
|
|
38
|
+
module.exports.writeXObjParam = xObj.writeXObjParam;
|
|
39
|
+
module.exports.writeXObjParamAsBool = xObj.writeXObjParamAsBool;
|
|
40
|
+
module.exports.writeXObjParamAsNum = xObj.writeXObjParamAsNum;
|
|
41
|
+
module.exports.writeXObjParamAsIndex = xObj.writeXObjParamAsIndex;
|
|
42
|
+
module.exports.writeXObjParamEx = xObj.writeXObjParamEx;
|
|
43
|
+
|
|
44
|
+
module.exports.readXObjAttrRaw = xObj.readXObjAttrRaw;
|
|
45
|
+
module.exports.readXObjAttr = xObj.readXObjAttr;
|
|
46
|
+
module.exports.readXObjAttrAsBool = xObj.readXObjAttrAsBool;
|
|
47
|
+
module.exports.readXObjAttrAsNum = xObj.readXObjAttrAsNum;
|
|
48
|
+
module.exports.readXObjAttrEx = xObj.readXObjAttrEx;
|
|
49
|
+
module.exports.readXObjAttrAsIndex = xObj.readXObjAttrAsIndex;
|
|
50
|
+
module.exports.writeXObjAttrRaw = xObj.writeXObjAttrRaw;
|
|
51
|
+
module.exports.writeXObjAttr = xObj.writeXObjAttr;
|
|
52
|
+
module.exports.writeXObjAttrAsBool = xObj.writeXObjAttrAsBool;
|
|
53
|
+
module.exports.writeXObjAttrAsNum = xObj.writeXObjAttrAsNum;
|
|
54
|
+
module.exports.writeXObjAttrAsIndex = xObj.writeXObjAttrAsIndex;
|
|
55
|
+
module.exports.writeXObjAttrEx = xObj.writeXObjAttrEx;
|
|
56
|
+
|
|
57
|
+
module.exports.getXObjAttributes = xObj.getXObjAttributes;
|
|
58
|
+
module.exports.checkXObjAttribute = xObj.checkXObjAttribute;
|
|
59
|
+
module.exports.deleteXObjAttribute = xObj.deleteXObjAttribute;
|
|
60
|
+
module.exports.renameXObjAttribute = xObj.renameXObjAttribute;
|
|
61
|
+
|
|
62
|
+
module.exports.getXObjElement = xObj.getXObjElement;
|
|
63
|
+
module.exports.addXObjElement = xObj.addXObjElement;
|
|
64
|
+
module.exports.addXObjElementEx = xObj.addXObjElementEx;
|
|
65
|
+
module.exports.insertXObjElement = xObj.insertXObjElement;
|
|
66
|
+
module.exports.insertXObjElementEx = xObj.insertXObjElementEx;
|
|
67
|
+
module.exports.deleteXObjElement = xObj.deleteXObjElement;
|
|
68
|
+
module.exports.deleteXObjElementEx = xObj.deleteXObjElementEx;
|
|
69
|
+
module.exports.renameXObjElement = xObj.renameXObjElement;
|
|
70
|
+
|
|
71
|
+
module.exports.evalXObjEName = xObj.evalXObjEName;
|
|
72
|
+
module.exports.insertXObjEList = xObj.insertXObjEList;
|
|
73
|
+
module.exports.insertXObjEListEx = xObj.insertXObjEListEx;
|
|
74
|
+
|
|
75
|
+
module.exports.genXObjENameDescr = xObj.genXObjENameDescr;
|
|
76
|
+
module.exports.insertXObjElements = xObj.insertXObjElements;
|
|
77
|
+
module.exports.insertXObjEChain = xObj.insertXObjEChain;
|
package/lib/xObj-defs.d.ts
CHANGED
|
@@ -80,8 +80,8 @@ export namespace XOBJ_DEF_TNAMES {
|
|
|
80
80
|
export const DEF_XML_PARSE_OPTIONS: OPT_parserOptions;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
83
|
+
* Implements a container that provide a functionality to work
|
|
84
|
+
* with options for an XML-parser
|
|
85
85
|
*/
|
|
86
86
|
export class TXmlContentParseOptions {
|
|
87
87
|
/**
|
|
@@ -96,6 +96,11 @@ export class TXmlContentParseOptions {
|
|
|
96
96
|
* Contains a set of a current settings
|
|
97
97
|
*/
|
|
98
98
|
get settings(): OPT_parserOptions;
|
|
99
|
+
/**
|
|
100
|
+
* Returns a value of `compact` option
|
|
101
|
+
* @since 0.3.0
|
|
102
|
+
*/
|
|
103
|
+
get compact(): boolean;
|
|
99
104
|
/**
|
|
100
105
|
* Contains a set of a settings for converting an 'XML' to 'JS'-object
|
|
101
106
|
*/
|
package/lib/xObj-defs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.070-20260227]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -143,6 +143,15 @@ class TXmlContentParseOptions {
|
|
|
143
143
|
return this.#_options;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Returns a value of `compact` option
|
|
148
|
+
* @since 0.3.0
|
|
149
|
+
* @type {boolean}
|
|
150
|
+
*/
|
|
151
|
+
get compact() {
|
|
152
|
+
return this.#_options.compact ? true : false;
|
|
153
|
+
}
|
|
154
|
+
|
|
146
155
|
/**
|
|
147
156
|
* Contains a set of a settings for converting an 'XML' to 'JS'-object
|
|
148
157
|
* @type {xml2jsParseOptions}
|
package/lib/xObj-errors.d.ts
CHANGED
|
@@ -13,8 +13,9 @@ export namespace XOBJ_ECODE_TABLE {
|
|
|
13
13
|
export { XOBJ_TE_KNES_ECODE };
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Extends a base `TypeError` object to provide some information
|
|
17
|
+
* on the errors thrown when a key name evaluation failed
|
|
18
|
+
* @since 0.3.0
|
|
18
19
|
*/
|
|
19
20
|
export class EvalKeyNameError extends TypeError {
|
|
20
21
|
/**
|
package/lib/xObj-errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.004-20260227]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -41,6 +41,7 @@ const XOBJ_ECODE_TABLE = {
|
|
|
41
41
|
module.exports.XOBJ_ECODE_TABLE = XOBJ_ECODE_TABLE;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
+
* @since 0.3.0
|
|
44
45
|
* @augments TypeError
|
|
45
46
|
* @classdesc Extends a base `TypeError` object to provide some information
|
|
46
47
|
* on the errors thrown when a key name evaluation failed
|