@cntwg/xml-lib-js 0.0.36-b → 0.0.37-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/CHANGELOG.md +3 -0
- package/doc/xmldoc-lib.md +6 -6
- package/index.d.ts +40 -37
- package/index.js +9 -0
- package/lib/xml-base.d.ts +22 -22
- package/lib/xml-helper.d.ts +18 -18
- package/lib/xmldoc-lib.d.ts +483 -440
- package/lib/xmldoc-lib.js +62 -43
- package/package.json +5 -12
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Pre-release version.
|
|
4
4
|
|
|
5
|
+
> - update `xmldoc-lib.md`;
|
|
5
6
|
> - update dependency on `@ygracs/xml-js6` module to v0.0.6-b;
|
|
7
|
+
> - update dependency on `@cntwg/file-helper` module to v0.0.3;
|
|
8
|
+
> - update dependency on `@ygracs/bsfoc-lib-js` module to v0.3.3;
|
|
6
9
|
|
|
7
10
|
#### *v0.0.35*
|
|
8
11
|
|
package/doc/xmldoc-lib.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
>|***rev.*:**|0.1.
|
|
1
|
+
>|***rev.*:**|0.1.43|
|
|
2
2
|
>|:---|---:|
|
|
3
|
-
>|date:|
|
|
3
|
+
>|date:|2026-01-18|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
@@ -20,9 +20,9 @@ This descriptor is an `object` that describes a status for an operation with som
|
|
|
20
20
|
| `isERR` | `boolean` | no | a flag which indicates whether an error was happen |
|
|
21
21
|
| `errCode` | `number` | yes | an error code |
|
|
22
22
|
| `errEvent` | `string` | no | an error event identifier |
|
|
23
|
-
| `errMsg` | `string` |
|
|
24
|
-
| `source` | `string` |
|
|
25
|
-
| `content` | `any` |
|
|
23
|
+
| `errMsg` | `string` | yes | an error message |
|
|
24
|
+
| `source` | `string` | yes | path to a file |
|
|
25
|
+
| `content` | `any` | yes | content |
|
|
26
26
|
|
|
27
27
|
## Module constants
|
|
28
28
|
|
|
@@ -702,7 +702,7 @@ If `object` parameter is not a type of `object` or not given a `TypeError` throw
|
|
|
702
702
|
|
|
703
703
|
#### class methods (*special*)
|
|
704
704
|
|
|
705
|
-
##### **init()** => `
|
|
705
|
+
##### **init()** => `void`
|
|
706
706
|
|
|
707
707
|
This method initializes an element with a default values.
|
|
708
708
|
|
package/index.d.ts
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import xObj = require("@ygracs/xobj-lib-js");
|
|
2
|
-
import xmlHelper = require("./lib/xml-helper");
|
|
3
|
-
import xmldoc = require("./lib/xmldoc-lib");
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
readAsTagName,
|
|
7
|
-
readAsAttrName,
|
|
8
|
-
readAsAttrValue,
|
|
9
|
-
valueToElementID,
|
|
10
|
-
} from "./lib/xml-base";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
XML_DEF_PARSE_OPTIONS,
|
|
14
|
-
XML_DEF_ROOT_ETAG_NAME, XML_LANG_ATTR_TNAME,
|
|
15
|
-
TXmlContentParseOptions,
|
|
16
|
-
TXmlAttributesMapper,
|
|
17
|
-
TXmlElementController, TXmlElementsListController,
|
|
18
|
-
TXmlContentDeclaration,
|
|
19
|
-
TXmlContentRootElement,
|
|
20
|
-
TXmlContentContainer,
|
|
21
|
-
} from "./lib/xmldoc-lib";
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
xObj, xmlHelper, xmldoc as xmlDoc,
|
|
25
|
-
readAsTagName,
|
|
26
|
-
readAsAttrName,
|
|
27
|
-
readAsAttrValue,
|
|
28
|
-
valueToElementID,
|
|
29
|
-
XML_DEF_PARSE_OPTIONS,
|
|
30
|
-
XML_DEF_ROOT_ETAG_NAME, XML_LANG_ATTR_TNAME,
|
|
31
|
-
TXmlContentParseOptions,
|
|
32
|
-
TXmlAttributesMapper,
|
|
33
|
-
TXmlElementController, TXmlElementsListController,
|
|
34
|
-
TXmlContentDeclaration,
|
|
35
|
-
TXmlContentRootElement,
|
|
36
|
-
TXmlContentContainer,
|
|
37
|
-
};
|
|
1
|
+
import xObj = require("@ygracs/xobj-lib-js");
|
|
2
|
+
import xmlHelper = require("./lib/xml-helper");
|
|
3
|
+
import xmldoc = require("./lib/xmldoc-lib");
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
readAsTagName,
|
|
7
|
+
readAsAttrName,
|
|
8
|
+
readAsAttrValue,
|
|
9
|
+
valueToElementID,
|
|
10
|
+
} from "./lib/xml-base";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
XML_DEF_PARSE_OPTIONS,
|
|
14
|
+
XML_DEF_ROOT_ETAG_NAME, XML_LANG_ATTR_TNAME,
|
|
15
|
+
TXmlContentParseOptions,
|
|
16
|
+
TXmlAttributesMapper,
|
|
17
|
+
TXmlElementController, TXmlElementsListController,
|
|
18
|
+
TXmlContentDeclaration,
|
|
19
|
+
TXmlContentRootElement,
|
|
20
|
+
TXmlContentContainer,
|
|
21
|
+
} from "./lib/xmldoc-lib";
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
xObj, xmlHelper, xmldoc as xmlDoc,
|
|
25
|
+
readAsTagName,
|
|
26
|
+
readAsAttrName,
|
|
27
|
+
readAsAttrValue,
|
|
28
|
+
valueToElementID,
|
|
29
|
+
XML_DEF_PARSE_OPTIONS,
|
|
30
|
+
XML_DEF_ROOT_ETAG_NAME, XML_LANG_ATTR_TNAME,
|
|
31
|
+
TXmlContentParseOptions,
|
|
32
|
+
TXmlAttributesMapper,
|
|
33
|
+
TXmlElementController, TXmlElementsListController,
|
|
34
|
+
TXmlContentDeclaration,
|
|
35
|
+
TXmlContentRootElement,
|
|
36
|
+
TXmlContentContainer,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
import type { fsoDescr } from '@cntwg/file-helper';
|
|
40
|
+
export type { fsoDescr };
|
package/index.js
CHANGED
|
@@ -7,6 +7,11 @@ const xmldoc = require('./lib/xmldoc-lib');
|
|
|
7
7
|
const xmlHelper = require('./lib/xml-helper');
|
|
8
8
|
const xmlBase = require('./lib/xml-base');
|
|
9
9
|
|
|
10
|
+
const {
|
|
11
|
+
// * import types definitions *
|
|
12
|
+
fsoDescr,
|
|
13
|
+
} = require('@cntwg/file-helper');
|
|
14
|
+
|
|
10
15
|
// === module inner block ===
|
|
11
16
|
|
|
12
17
|
// === module main block ===
|
|
@@ -34,3 +39,7 @@ module.exports.TXmlElementsListController = xmldoc.TXmlElementsListController;
|
|
|
34
39
|
module.exports.TXmlContentDeclaration = xmldoc.TXmlContentDeclaration;
|
|
35
40
|
module.exports.TXmlContentRootElement = xmldoc.TXmlContentRootElement;
|
|
36
41
|
module.exports.TXmlContentContainer = xmldoc.TXmlContentContainer;
|
|
42
|
+
|
|
43
|
+
// * export types definitions *
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
module.exports.fsoDescr = fsoDescr;
|
package/lib/xml-base.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tries to convert a given value to a valid tag name of an XML-element.
|
|
3
|
-
* @since v0.0.28
|
|
4
|
-
*/
|
|
5
|
-
export function readAsTagName(value: any): string;
|
|
6
|
-
/**
|
|
7
|
-
* Tries to convert a given value to a valid name of an XML-attribute.
|
|
8
|
-
* @since v0.0.28
|
|
9
|
-
*/
|
|
10
|
-
export function readAsAttrName(value: any): string;
|
|
11
|
-
/**
|
|
12
|
-
* Tries to convert a given value to a valid "attribute value".
|
|
13
|
-
* @since v0.0.35
|
|
14
|
-
*/
|
|
15
|
-
export function readAsAttrValue(value: any): string | null;
|
|
16
|
-
/**
|
|
17
|
-
* Tries to convert a given value to a valid identifier
|
|
18
|
-
* suitable as a value for an "ID-attribute" of an XML-element.
|
|
19
|
-
* @since v0.0.28
|
|
20
|
-
* @see valueToIDString
|
|
21
|
-
*/
|
|
22
|
-
export function valueToElementID(value: any): string;
|
|
1
|
+
/**
|
|
2
|
+
* Tries to convert a given value to a valid tag name of an XML-element.
|
|
3
|
+
* @since v0.0.28
|
|
4
|
+
*/
|
|
5
|
+
export function readAsTagName(value: any): string;
|
|
6
|
+
/**
|
|
7
|
+
* Tries to convert a given value to a valid name of an XML-attribute.
|
|
8
|
+
* @since v0.0.28
|
|
9
|
+
*/
|
|
10
|
+
export function readAsAttrName(value: any): string;
|
|
11
|
+
/**
|
|
12
|
+
* Tries to convert a given value to a valid "attribute value".
|
|
13
|
+
* @since v0.0.35
|
|
14
|
+
*/
|
|
15
|
+
export function readAsAttrValue(value: any): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Tries to convert a given value to a valid identifier
|
|
18
|
+
* suitable as a value for an "ID-attribute" of an XML-element.
|
|
19
|
+
* @since v0.0.28
|
|
20
|
+
* @see valueToIDString
|
|
21
|
+
*/
|
|
22
|
+
export function valueToElementID(value: any): string;
|
package/lib/xml-helper.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tries to get a child element.
|
|
3
|
-
*/
|
|
4
|
-
export function getChildByPath(obj: TXmlElementController, chain: string[]): TXmlElementController | null;
|
|
5
|
-
/**
|
|
6
|
-
* Tries to get a child element.
|
|
7
|
-
*/
|
|
8
|
-
export function addChildByPath(obj: TXmlElementController, chain: string[]): TXmlElementController | null;
|
|
9
|
-
/**
|
|
10
|
-
* Reads a text values from a given XML-element.
|
|
11
|
-
*/
|
|
12
|
-
export function extractTextValues(obj: TXmlElementController | TXmlElementsListController): string[];
|
|
13
|
-
/**
|
|
14
|
-
* Reads a text values with a `lang` attribute from a given XML-element.
|
|
15
|
-
*/
|
|
16
|
-
export function extractTextValuesLn(obj: TXmlElementController | TXmlElementsListController): any[];
|
|
17
|
-
import { TXmlElementController } from "./xmldoc-lib";
|
|
18
|
-
import { TXmlElementsListController } from "./xmldoc-lib";
|
|
1
|
+
/**
|
|
2
|
+
* Tries to get a child element.
|
|
3
|
+
*/
|
|
4
|
+
export function getChildByPath(obj: TXmlElementController, chain: string[]): TXmlElementController | null;
|
|
5
|
+
/**
|
|
6
|
+
* Tries to get a child element.
|
|
7
|
+
*/
|
|
8
|
+
export function addChildByPath(obj: TXmlElementController, chain: string[]): TXmlElementController | null;
|
|
9
|
+
/**
|
|
10
|
+
* Reads a text values from a given XML-element.
|
|
11
|
+
*/
|
|
12
|
+
export function extractTextValues(obj: TXmlElementController | TXmlElementsListController): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Reads a text values with a `lang` attribute from a given XML-element.
|
|
15
|
+
*/
|
|
16
|
+
export function extractTextValuesLn(obj: TXmlElementController | TXmlElementsListController): any[];
|
|
17
|
+
import { TXmlElementController } from "./xmldoc-lib";
|
|
18
|
+
import { TXmlElementsListController } from "./xmldoc-lib";
|