@ygracs/xepg-lib-js 0.0.25 → 0.0.27-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 +16 -0
- package/LICENSE +1 -1
- package/doc/xepgdoc-lib.md +56 -51
- package/index.d.ts +23 -0
- package/index.js +2 -1
- package/lib/dts-helper.d.ts +37 -0
- package/lib/dts-helper.js +7 -6
- package/lib/xepgdoc-lib.d.ts +590 -0
- package/lib/xepgdoc-lib.js +232 -259
- package/lib/xml-base.d.ts +21 -0
- package/lib/xml-base.js +4 -27
- package/package.json +17 -11
- /package/doc/{xepgdoc-example.xepg → xepgdoc-example-s02.xepg} +0 -0
- /package/doc/{xepgdoc-spec.md → xepgdoc-spec-02.md} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tries to convert a given value to a valid tag name of an XML-element.
|
|
3
|
+
* @since v0.0.23
|
|
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.23
|
|
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.25
|
|
14
|
+
*/
|
|
15
|
+
export function readAsAttrValue(value: any): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Tries to convert a given value to a valid identifier suitable as a value
|
|
18
|
+
* for an "ID-attribute" of an XML-element.
|
|
19
|
+
* @since v0.0.23
|
|
20
|
+
*/
|
|
21
|
+
export function valueToElementID(value: any): string;
|
package/lib/xml-base.js
CHANGED
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.003-20260305]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
|
-
//valueToIndex,
|
|
7
6
|
valueToIDString,
|
|
8
|
-
//readAsString, readAsNumber,
|
|
9
|
-
//isNotEmptyString,
|
|
10
|
-
//isArray, isObject, isPlainObject,
|
|
11
7
|
} = require('@ygracs/bsfoc-lib-js');
|
|
12
8
|
|
|
13
9
|
// === module inner block ===
|
|
14
10
|
|
|
15
|
-
/***
|
|
16
|
-
* (* helper function definitions *)
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
11
|
// === module main block ===
|
|
20
12
|
|
|
21
|
-
/***
|
|
22
|
-
* (* constant definitions *)
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/***
|
|
26
|
-
* (* function definitions *)
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
13
|
/**
|
|
30
14
|
* Tries to convert a given value to a valid tag name of an XML-element.
|
|
31
15
|
* @since v0.0.23
|
|
@@ -47,6 +31,7 @@ function readAsTagName(value) {
|
|
|
47
31
|
};
|
|
48
32
|
return tagName;
|
|
49
33
|
};
|
|
34
|
+
module.exports.readAsTagName = readAsTagName;
|
|
50
35
|
|
|
51
36
|
/**
|
|
52
37
|
* Tries to convert a given value to a valid name of an XML-attribute.
|
|
@@ -69,6 +54,7 @@ function readAsAttrName(value) {
|
|
|
69
54
|
};
|
|
70
55
|
return attrName;
|
|
71
56
|
};
|
|
57
|
+
module.exports.readAsAttrName = readAsAttrName;
|
|
72
58
|
|
|
73
59
|
/**
|
|
74
60
|
* Tries to convert a given value to a valid "attribute value".
|
|
@@ -97,6 +83,7 @@ function readAsAttrValue(value) {
|
|
|
97
83
|
};
|
|
98
84
|
return result;
|
|
99
85
|
};
|
|
86
|
+
module.exports.readAsAttrValue = readAsAttrValue;
|
|
100
87
|
|
|
101
88
|
/**
|
|
102
89
|
* Tries to convert a given value to a valid identifier suitable as a value
|
|
@@ -120,14 +107,4 @@ function valueToElementID(value) {
|
|
|
120
107
|
};
|
|
121
108
|
return id;
|
|
122
109
|
};
|
|
123
|
-
|
|
124
|
-
/***
|
|
125
|
-
* (* class definitions *)
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
// === module exports block ===
|
|
129
|
-
|
|
130
|
-
module.exports.readAsTagName = readAsTagName;
|
|
131
|
-
module.exports.readAsAttrName = readAsAttrName;
|
|
132
|
-
module.exports.readAsAttrValue = readAsAttrValue;
|
|
133
110
|
module.exports.valueToElementID = valueToElementID;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ygracs/xepg-lib-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27-b",
|
|
4
4
|
"description": "A library for handling an EPG-sources based on an XEPG-format",
|
|
5
5
|
"author": "ygracs <cs70th-om@rambler.ru>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"EPG"
|
|
14
14
|
],
|
|
15
15
|
"main": "./index.js",
|
|
16
|
+
"types": "./index.d.ts",
|
|
16
17
|
"files": [
|
|
17
18
|
"doc/xepgdoc-spec-draft.dtd",
|
|
18
19
|
"doc/*.xepg",
|
|
@@ -20,29 +21,34 @@
|
|
|
20
21
|
"lib/xepgdoc-lib.js",
|
|
21
22
|
"lib/dts-helper.js",
|
|
22
23
|
"lib/xml-base.js",
|
|
24
|
+
"lib/*.d.ts",
|
|
23
25
|
"index.js",
|
|
26
|
+
"index.d.ts",
|
|
24
27
|
"CHANGELOG.md"
|
|
25
28
|
],
|
|
26
29
|
"scripts": {
|
|
27
30
|
"test": "cross-env TZ='Etc/UTC' jest",
|
|
28
31
|
"build-doc-md": "jsdoc2md",
|
|
29
|
-
"build-doc-html": "jsdoc"
|
|
32
|
+
"build-doc-html": "jsdoc",
|
|
33
|
+
"gen-dts": "npx -p typescript tsc"
|
|
30
34
|
},
|
|
31
35
|
"imports": {
|
|
32
36
|
"#lib/*": "./lib/*",
|
|
33
37
|
"#test-dir/*": "./__test__/*"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@cntwg/file-helper": "^0.0.
|
|
37
|
-
"@ygracs/bsfoc-lib-js": "
|
|
38
|
-
"@ygracs/dtf-lib-js": "^0.0.
|
|
39
|
-
"@ygracs/xml-js6": "^0.0.
|
|
40
|
-
"@ygracs/xobj-lib-js": "
|
|
40
|
+
"@cntwg/file-helper": "^0.0.3",
|
|
41
|
+
"@ygracs/bsfoc-lib-js": "~0.3.3",
|
|
42
|
+
"@ygracs/dtf-lib-js": "^0.0.33",
|
|
43
|
+
"@ygracs/xml-js6": "^0.0.8-b",
|
|
44
|
+
"@ygracs/xobj-lib-js": "~0.3.0"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
+
"@ygracs/test-helper": "~0.0.2-b",
|
|
48
|
+
"cross-env": "^10.1.0",
|
|
49
|
+
"jest": "^30.2.0",
|
|
50
|
+
"jsdoc-to-markdown": "^9.1.3",
|
|
51
|
+
"minimist": "^1.2.8",
|
|
52
|
+
"typescript": "~5.9.3"
|
|
47
53
|
}
|
|
48
54
|
}
|
|
File without changes
|
|
File without changes
|