@ygracs/xobj-lib-js 0.2.9-b.2 → 0.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 +3 -2
- package/README.md +8 -6
- package/doc/xObj.md +65 -5
- package/index.d.ts +100 -70
- package/index.js +52 -2
- package/lib/xObj-defs.d.ts +3 -2
- package/lib/xObj-defs.js +2 -2
- package/lib/xObj-errors.d.ts +3 -2
- package/lib/xObj-errors.js +2 -2
- package/lib/xObj-lib.d.ts +151 -112
- package/lib/xObj-lib.js +165 -114
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
#### *v0.
|
|
1
|
+
#### *v0.3.0*
|
|
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`;
|
|
9
10
|
> - improve behavior for function: `writeXObjParam`, `writeXObjParamEx`, `writeXObjAttr`, `writeXObjAttrEx`;
|
|
10
|
-
> - add a new function: `clearXObjNode`;
|
|
11
|
+
> - add a new function: `addXObjElementEx`, `clearXObjNode`;
|
|
11
12
|
> - add a new `EvalKeyNameError` class;
|
|
12
13
|
> - add new `compact`-property for `TXmlContentParseOptions`;
|
|
13
14
|
> - some fixes.
|
package/README.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|***rev.*:**|0.1.
|
|
1
|
+
|***rev.*:**|0.1.4|
|
|
2
2
|
|:---|---:|
|
|
3
|
-
|***date***:|
|
|
3
|
+
|***date***:|2026-03-03|
|
|
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
|
|
|
16
16
|
### Installation
|
|
17
17
|
|
|
18
18
|
`npm install @ygracs/xobj-lib-js`
|
|
19
|
+
|
|
20
|
+
> Note: It's recommended to "pin" a package versions range to its minor releases after installation. To do so use `~` range specifier (*e.g. `~0.3.0`*) in `package.json`.
|
package/doc/xObj.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
>|***rev.*:**|0.1.
|
|
1
|
+
>|***rev.*:**|0.1.52|
|
|
2
2
|
>|:---|---:|
|
|
3
|
-
>|date:|2026-
|
|
3
|
+
>|date:|2026-03-03|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
@@ -676,6 +676,9 @@ The function throws a `TypeError` exception in case:
|
|
|
676
676
|
|
|
677
677
|
- code: `ERR_XOBJ_NPOBJ`
|
|
678
678
|
+ if `object` parameter is not an `Object` instance;
|
|
679
|
+
|
|
680
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
681
|
+
|
|
679
682
|
- code: `ERR_XOBJ_NSTR`
|
|
680
683
|
+ if `key` parameter given and is not a type of a `string`.
|
|
681
684
|
|
|
@@ -702,6 +705,9 @@ The function throws a `TypeError` exception in case:
|
|
|
702
705
|
|
|
703
706
|
- code: `ERR_XOBJ_NPOBJ`
|
|
704
707
|
+ if `object` parameter is not an `Object` instance;
|
|
708
|
+
|
|
709
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
710
|
+
|
|
705
711
|
- code: `ERR_XOBJ_NSTR`
|
|
706
712
|
+ if `key` parameter given and is not a type of a `string`.
|
|
707
713
|
|
|
@@ -729,6 +735,9 @@ The function throws a `TypeError` exception in case:
|
|
|
729
735
|
|
|
730
736
|
- code: `ERR_XOBJ_NPOBJ`
|
|
731
737
|
+ if `object` parameter is not an `Object` instance;
|
|
738
|
+
|
|
739
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
740
|
+
|
|
732
741
|
- code: `ERR_XOBJ_NSTR`
|
|
733
742
|
+ if `attr` parameter given and is not a type of a `string`;
|
|
734
743
|
+ if `key` parameter given and is not a type of a `string`.
|
|
@@ -757,6 +766,9 @@ The function throws a `TypeError` exception in case:
|
|
|
757
766
|
|
|
758
767
|
- code: `ERR_XOBJ_NPOBJ`
|
|
759
768
|
+ if `object` parameter is not an `Object` instance;
|
|
769
|
+
|
|
770
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
771
|
+
|
|
760
772
|
- code: `ERR_XOBJ_NSTR`
|
|
761
773
|
+ if `attr` parameter given and is not a type of a `string`;
|
|
762
774
|
+ if `key` parameter given and is not a type of a `string`.
|
|
@@ -804,6 +816,9 @@ The function throws a `TypeError` exception in case:
|
|
|
804
816
|
|
|
805
817
|
- code: `ERR_XOBJ_NPOBJ`
|
|
806
818
|
+ if `object` parameter is not an `Object` instance;
|
|
819
|
+
|
|
820
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
821
|
+
|
|
807
822
|
- code: `ERR_XOBJ_NSTR`
|
|
808
823
|
+ if `attr` parameter given and is not a type of a `string`;
|
|
809
824
|
+ if `key` parameter given and is not a type of a `string`.
|
|
@@ -827,6 +842,9 @@ The function throws a `TypeError` exception in case:
|
|
|
827
842
|
|
|
828
843
|
- code: `ERR_XOBJ_NPOBJ`
|
|
829
844
|
+ if `object` parameter is not an `Object` instance;
|
|
845
|
+
|
|
846
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
847
|
+
|
|
830
848
|
- code: `ERR_XOBJ_NSTR`
|
|
831
849
|
+ if `attr` parameter given and is not a type of a `string`;
|
|
832
850
|
+ if `key` parameter given and is not a type of a `string`.
|
|
@@ -853,6 +871,9 @@ The function throws a `TypeError` exception in case:
|
|
|
853
871
|
|
|
854
872
|
- code: `ERR_XOBJ_NPOBJ`
|
|
855
873
|
+ if `object` parameter is not an `Object` instance;
|
|
874
|
+
|
|
875
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
876
|
+
|
|
856
877
|
- code: `ERR_XOBJ_NSTR`
|
|
857
878
|
+ if `attr` parameter given and is not a type of a `string`;
|
|
858
879
|
+ if `value` parameter given and is not a type of a `string`;
|
|
@@ -878,6 +899,9 @@ The function throws a `TypeError` exception in case:
|
|
|
878
899
|
|
|
879
900
|
- code: `ERR_XOBJ_NPOBJ`
|
|
880
901
|
+ if `object` parameter is not an `Object` instance;
|
|
902
|
+
|
|
903
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
904
|
+
|
|
881
905
|
- code: `ERR_XOBJ_NSTR`
|
|
882
906
|
+ if `name` parameter given and is not a type of a `string`;
|
|
883
907
|
- code: `ERR_XOBJ_INVARG_KEY`
|
|
@@ -886,6 +910,27 @@ The function throws a `TypeError` exception in case:
|
|
|
886
910
|
<a name="addXObjElement"></a>
|
|
887
911
|
#### **addXObjElement(object, name)** => `object`
|
|
888
912
|
|
|
913
|
+
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.
|
|
914
|
+
|
|
915
|
+
##### ***parameters***
|
|
916
|
+
|
|
917
|
+
| parameter name | value type | default value | description |
|
|
918
|
+
|:---|---|---:|:---|
|
|
919
|
+
| `object` | `object` | --- | some object |
|
|
920
|
+
| `name` | `string` | --- | some child element ID |
|
|
921
|
+
|
|
922
|
+
##### ***exceptions***
|
|
923
|
+
|
|
924
|
+
The function throws a `TypeError` exception in case:
|
|
925
|
+
|
|
926
|
+
- code: `ERR_XOBJ_NPOBJ`
|
|
927
|
+
+ if `object` parameter is not an `Object` instance;
|
|
928
|
+
|
|
929
|
+
<a name="addXObjElementEx"></a>
|
|
930
|
+
#### **addXObjElementEx(object, name)** => `object`
|
|
931
|
+
|
|
932
|
+
> since: \[v0.2.0]
|
|
933
|
+
|
|
889
934
|
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.
|
|
890
935
|
|
|
891
936
|
##### ***parameters***
|
|
@@ -910,6 +955,9 @@ The function throws a `TypeError` exception in case:
|
|
|
910
955
|
|
|
911
956
|
- code: `ERR_XOBJ_NPOBJ`
|
|
912
957
|
+ if `object` parameter is not an `Object` instance;
|
|
958
|
+
|
|
959
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
960
|
+
|
|
913
961
|
- code: `ERR_XOBJ_NSTR`
|
|
914
962
|
+ if `name` parameter given and is not a type of a `string`;
|
|
915
963
|
- code: `ERR_XOBJ_INVARG_KEY`
|
|
@@ -979,6 +1027,9 @@ The function throws a `TypeError` exception in case:
|
|
|
979
1027
|
|
|
980
1028
|
- code: `ERR_XOBJ_NPOBJ`
|
|
981
1029
|
+ if `object` parameter is not an `Object` instance;
|
|
1030
|
+
|
|
1031
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
1032
|
+
|
|
982
1033
|
- code: `ERR_XOBJ_NSTR`
|
|
983
1034
|
+ if `name` parameter given and is not a type of a `string`;
|
|
984
1035
|
- code: `ERR_XOBJ_INVARG_KEY`
|
|
@@ -1028,6 +1079,9 @@ The function throws a `TypeError` exception in case:
|
|
|
1028
1079
|
|
|
1029
1080
|
- code: `ERR_XOBJ_NPOBJ`
|
|
1030
1081
|
+ if `object` parameter is not an `Object` instance;
|
|
1082
|
+
|
|
1083
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
1084
|
+
|
|
1031
1085
|
- code: `ERR_XOBJ_NSTR`
|
|
1032
1086
|
+ if `name` parameter given and is not a type of a `string`;
|
|
1033
1087
|
- code: `ERR_XOBJ_INVARG_KEY`
|
|
@@ -1052,6 +1106,9 @@ The function throws a `TypeError` exception in case:
|
|
|
1052
1106
|
|
|
1053
1107
|
- code: `ERR_XOBJ_NPOBJ`
|
|
1054
1108
|
+ if `object` parameter is not an `Object` instance;
|
|
1109
|
+
|
|
1110
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
1111
|
+
|
|
1055
1112
|
- code: `ERR_XOBJ_NSTR`
|
|
1056
1113
|
+ if `name` parameter given and is not a type of a `string`;
|
|
1057
1114
|
+ id `value` parameter given and is not a type of a `string`.
|
|
@@ -1059,7 +1116,7 @@ The function throws a `TypeError` exception in case:
|
|
|
1059
1116
|
<a name="clearXObjNode"></a>
|
|
1060
1117
|
#### **clearXObjNode(node)** => `boolean`
|
|
1061
1118
|
|
|
1062
|
-
> since: \[v0.
|
|
1119
|
+
> since: \[v0.3.0]
|
|
1063
1120
|
|
|
1064
1121
|
This function tries to clean a given node.
|
|
1065
1122
|
|
|
@@ -1163,6 +1220,9 @@ The function throws a `TypeError` exception in case:
|
|
|
1163
1220
|
|
|
1164
1221
|
- code: `ERR_XOBJ_NPOBJ`
|
|
1165
1222
|
+ if `object` parameter is not an `Object` instance;
|
|
1223
|
+
|
|
1224
|
+
The function throws a `EvalKeyNameError` exception in case:
|
|
1225
|
+
|
|
1166
1226
|
- code: `ERR_XOBJ_NSTR`
|
|
1167
1227
|
+ if `name` parameter given and is not a type of a `string`;
|
|
1168
1228
|
- code: `ERR_XOBJ_INVARG_KEY`
|
|
@@ -1264,7 +1324,7 @@ The class constructor receives an arguments listed below:
|
|
|
1264
1324
|
<a name="TXmlContentParseOptions+compact"></a>
|
|
1265
1325
|
###### **compact**
|
|
1266
1326
|
|
|
1267
|
-
> since: \[v0.
|
|
1327
|
+
> since: \[v0.3.0]
|
|
1268
1328
|
|
|
1269
1329
|
| property type | read only | description |
|
|
1270
1330
|
|---|---|:---|
|
|
@@ -1311,7 +1371,7 @@ This method transforms a given object to a set of accepted parser options.
|
|
|
1311
1371
|
<a name="EvalKeyNameError"></a>
|
|
1312
1372
|
#### **EvalKeyNameError**
|
|
1313
1373
|
|
|
1314
|
-
> since: \[v0.
|
|
1374
|
+
> since: \[v0.3.0]
|
|
1315
1375
|
|
|
1316
1376
|
This class extends a functionality of a `TypeError`-object to provide more accurate information when an error happened through a key evaluation.
|
|
1317
1377
|
|
package/index.d.ts
CHANGED
|
@@ -1,79 +1,109 @@
|
|
|
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
|
-
clearXObjNode: typeof import("./lib/xObj-lib").clearXObjNode;
|
|
45
|
-
|
|
46
|
-
TXmlContentParseOptions: typeof TXmlContentParseOptions; // [?] class declaration
|
|
47
|
-
DEF_XML_PARSE_OPTIONS: typeof DEF_XML_PARSE_OPTIONS;
|
|
48
|
-
XOBJ_DEF_TNAMES: typeof XOBJ_DEF_TNAMES;
|
|
49
|
-
|
|
50
|
-
EvalKeyNameError: typeof EvalKeyNameError; // [?] class declaration
|
|
51
|
-
|
|
52
|
-
xml2jsParseOptions: xml2jsParseOptions;
|
|
53
|
-
js2xmlParseOptions: js2xmlParseOptions;
|
|
54
|
-
OPT_parserOptions: OPT_parserOptions;
|
|
55
|
-
|
|
56
|
-
XObjENameDescr: XObjENameDescr;
|
|
57
|
-
OPT_inselops_L: OPT_inselops_L;
|
|
58
|
-
OPT_inselops_S: OPT_inselops_S;
|
|
59
|
-
RVAL_reason: RVAL_reason;
|
|
60
|
-
RVAL_emodif: RVAL_emodif;
|
|
61
|
-
VCOR_evalkname: VCOR_evalkname;
|
|
62
|
-
};
|
|
63
|
-
export = _exports;
|
|
64
1
|
import { TXmlContentParseOptions } from "./lib/xObj-defs";
|
|
65
2
|
import { DEF_XML_PARSE_OPTIONS } from "./lib/xObj-defs";
|
|
66
3
|
import { XOBJ_DEF_TNAMES } from "./lib/xObj-defs";
|
|
67
|
-
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
TXmlContentParseOptions,
|
|
7
|
+
DEF_XML_PARSE_OPTIONS,
|
|
8
|
+
XOBJ_DEF_TNAMES,
|
|
9
|
+
};
|
|
68
10
|
|
|
69
11
|
import type {
|
|
70
|
-
|
|
71
|
-
|
|
12
|
+
xml2jsParseOptions, js2xmlParseOptions,
|
|
13
|
+
OPT_parserOptions,
|
|
72
14
|
} from "./lib/xObj-defs";
|
|
73
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
|
+
|
|
74
95
|
import type {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
96
|
+
XObjENameDescr, XObjENameDescrConditions,
|
|
97
|
+
OPT_inselops_L, OPT_inselops_S,
|
|
98
|
+
RVAL_emodif,
|
|
99
|
+
VCOR_evalkname, RVAL_reason,
|
|
100
|
+
IEvalKeyNameResult,
|
|
79
101
|
} from "./lib/xObj-lib";
|
|
102
|
+
|
|
103
|
+
export type {
|
|
104
|
+
XObjENameDescr, XObjENameDescrConditions,
|
|
105
|
+
OPT_inselops_L, OPT_inselops_S,
|
|
106
|
+
RVAL_emodif,
|
|
107
|
+
VCOR_evalkname, RVAL_reason,
|
|
108
|
+
IEvalKeyNameResult,
|
|
109
|
+
};
|
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
|
/**
|
|
@@ -98,6 +98,7 @@ export class TXmlContentParseOptions {
|
|
|
98
98
|
get settings(): OPT_parserOptions;
|
|
99
99
|
/**
|
|
100
100
|
* Returns a value of `compact` option
|
|
101
|
+
* @since 0.3.0
|
|
101
102
|
*/
|
|
102
103
|
get compact(): boolean;
|
|
103
104
|
/**
|
package/lib/xObj-defs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.070-
|
|
1
|
+
// [v0.1.070-20260227]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -145,7 +145,7 @@ class TXmlContentParseOptions {
|
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* Returns a value of `compact` option
|
|
148
|
-
* @since 0.
|
|
148
|
+
* @since 0.3.0
|
|
149
149
|
* @type {boolean}
|
|
150
150
|
*/
|
|
151
151
|
get compact() {
|
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.004-
|
|
1
|
+
// [v0.1.004-20260227]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -41,7 +41,7 @@ const XOBJ_ECODE_TABLE = {
|
|
|
41
41
|
module.exports.XOBJ_ECODE_TABLE = XOBJ_ECODE_TABLE;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* @since 0.
|
|
44
|
+
* @since 0.3.0
|
|
45
45
|
* @augments TypeError
|
|
46
46
|
* @classdesc Extends a base `TypeError` object to provide some information
|
|
47
47
|
* on the errors thrown when a key name evaluation failed
|