@ygracs/xepg-lib-js 0.0.16 → 0.0.17

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 CHANGED
@@ -1,9 +1,18 @@
1
+ #### *v0.0.17*
2
+
3
+ Pre-release version.
4
+
5
+ > - updated dependency on `@ygracs/bsfoc-lib-js` module to v0.1.3;
6
+ > - updated dependency on `@ygracs/dtf-lib-js` module to v0.0.22;
7
+ > - updated dependency on `@ygracs/xobj-lib-js` module to v0.0.14-rc4;
8
+ > - some fixes in `dts-helper.js` lib-module.
9
+
1
10
  #### *v0.0.16*
2
11
 
3
12
  Pre-release version.
4
13
 
5
14
  > - updated dependency on `@ygracs/xobj-lib-js` module to v0.0.14-rc3;
6
- > - updated dependency on `@ygracs/dtf-lib-js` module to v0.0.21.
15
+ > - updated dependency on `@ygracs/dtf-lib-js` module to v0.0.21;
7
16
  > - added `getDTSysDescr` function into `dts-helper.js` lib-module;
8
17
  > - some fixes in `dts-helper.js` lib-module;
9
18
  > - some fixes in `xepgdoc-lib.js` module.
package/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019-2023 Yuri Grachev
4
-
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
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019-2023 Yuri Grachev
4
+
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
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/lib/dts-helper.js CHANGED
@@ -1,4 +1,4 @@
1
- // [v0.1.042-20230326]
1
+ // [v0.1.043-20230711]
2
2
 
3
3
  // === module init block ===
4
4
 
@@ -56,43 +56,49 @@ function convStringToDTValue(value, dts_id, tz){
56
56
  let dt_str = typeof value === 'string' ? value : '';
57
57
  if (chkDTSysID(dtstype)) {
58
58
  switch (getDTSysName(dtstype)) {
59
- case 'default':
59
+ case 'default': {
60
60
  // TODO: check TZ
61
61
  //console.log('convStringToDTValue => dtstype:[default]');
62
62
  result = (new Date(dt_str)).getTime();
63
63
  //console.log('convStringToDTValue => value:['+value+']');
64
64
  //console.log('convStringToDTValue => result:['+result+']');
65
65
  break;
66
- case 'iso8601':
66
+ }
67
+ case 'iso8601': {
67
68
  // TODO: check TZ
68
69
  //console.log('convStringToDTValue => dtstype:[iso8601]');
69
70
  result = (new Date(dt_str)).getTime();
70
71
  //console.log('convStringToDTValue => value:['+value+']');
71
72
  //console.log('convStringToDTValue => result:['+result+']');
72
73
  break;
73
- case 'xmltv':
74
+ }
75
+ case 'xmltv': {
74
76
  // TODO: check TZ
75
77
  //console.log('convStringToDTValue => dtstype:[xmltv]');
76
78
  result = (new Date(convXMLTVToDTValue(dt_str))).getTime();
77
79
  //console.log('convStringToDTValue => value:['+value+']');
78
80
  //console.log('convStringToDTValue => result:['+result+']');
79
81
  break;
80
- case 'timestamp':
82
+ }
83
+ case 'timestamp': {
81
84
  // TODO: check TZ
82
85
  //console.log('convStringToDTValue => dtstype:[timestamp]');
83
86
  result = Number(dt_str);
84
87
  //console.log('convStringToDTValue => value:['+value+']');
85
88
  //console.log('convStringToDTValue => result:['+result+']');
86
89
  break;
87
- case 'utc':
90
+ }
91
+ case 'utc': {
88
92
  // TODO: check TZ
89
93
  //console.log('convStringToDTValue => dtstype:[utc]');
90
94
  result = (new Date(Date.UTC(dt_str))).getTime();
91
95
  //console.log('convStringToDTValue => value:['+value+']');
92
96
  //console.log('convStringToDTValue => result:['+result+']');
93
97
  break;
94
- default:
98
+ }
99
+ default: {
95
100
  break;
101
+ }
96
102
  };
97
103
  if (Number.isNaN(result)) result = 0;
98
104
  };
@@ -110,7 +116,7 @@ function convDTValueToString(value, dts_id, tz){
110
116
  let dtstype = valueToIndex(dts_id);
111
117
  if (!chkDTSysID(dtstype)) dtstype = 0;
112
118
  switch (getDTSysName(dtstype)) {
113
- case 'default':
119
+ case 'default': {
114
120
  // TODO: check TZ
115
121
  //console.log('convDTValueToString => dtstype:[default]');
116
122
  result = convDTValueToDateString(dt_val, {
@@ -119,17 +125,20 @@ function convDTValueToString(value, dts_id, tz){
119
125
  //console.log('convDTValueToString => value:['+value+']');
120
126
  //console.log('convDTValueToString => result:['+result+']');
121
127
  break;
122
- case 'iso8601':
128
+ }
129
+ case 'iso8601': {
123
130
  // TODO: check TZ
124
131
  //console.log('convDTValueToString => dtstype:[iso8601]');
125
132
  result = convDTValueToISO8601(dt_val, {
126
- use_bs_format: false,
133
+ //use_bs_format: false,
134
+ useBaseFormat: false,
127
135
  src_in_utc: false,
128
136
  });
129
137
  //console.log('convDTValueToString => value:['+value+']');
130
138
  //console.log('convDTValueToString => result:['+result+']');
131
139
  break;
132
- case 'xmltv':
140
+ }
141
+ case 'xmltv': {
133
142
  // TODO: check TZ
134
143
  //console.log('convDTValueToString => dtstype:[xmltv]');
135
144
  result = convDTValueToXMLTV(dt_val, {
@@ -138,15 +147,18 @@ function convDTValueToString(value, dts_id, tz){
138
147
  //console.log('convDTValueToString => value:['+value+']');
139
148
  //console.log('convDTValueToString => result:['+result+']');
140
149
  break;
141
- case 'timestamp':
150
+ }
151
+ case 'timestamp': {
142
152
  // TODO: check TZ
143
153
  //console.log('convDTValueToString => dtstype:[timestamp]');
144
154
  result = dt_val.toString();
145
155
  //console.log('convDTValueToString => value:['+value+']');
146
156
  //console.log('convDTValueToString => result:['+result+']');
147
157
  break;
148
- default:
158
+ }
159
+ default: {
149
160
  break;
161
+ }
150
162
  };
151
163
  return result;
152
164
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ygracs/xepg-lib-js",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
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",
@@ -19,7 +19,7 @@
19
19
  "CHANGELOG.md"
20
20
  ],
21
21
  "scripts": {
22
- "test": "TZ='Etc/UTC' jest",
22
+ "test": "cross-env TZ='Etc/UTC' jest",
23
23
  "test-xepg": "TZ='Etc/UTC' jest ./test",
24
24
  "test-xepg:sl": "jest TXEpgSchedulesList",
25
25
  "test-xepg:hc": "TZ='Etc/UTC' jest TXEpgHeader",
@@ -29,14 +29,19 @@
29
29
  "win:test": "set TZ='Etc/UTC' && jest",
30
30
  "win:test-xepg": "set TZ='Etc/UTC' && jest ./test",
31
31
  "win:test-xepg:hc": "set TZ='Etc/UTC' && jest TXEpgHeader"
32
- },
32
+ },
33
+ "imports": {
34
+ "#lib/*": "./lib/*"
35
+ },
33
36
  "dependencies": {
34
- "@ygracs/bsfoc-lib-js": "^0.1.2",
35
- "@ygracs/dtf-lib-js": "^0.0.21",
37
+ "@ygracs/bsfoc-lib-js": "^0.1.3",
38
+ "@ygracs/dtf-lib-js": "^0.0.22",
36
39
  "@ygracs/xml-js6": "^0.0.3-b",
37
- "@ygracs/xobj-lib-js": "^0.0.14-rc3"
40
+ "@ygracs/xobj-lib-js": "^0.0.14-rc4"
38
41
  },
39
42
  "devDependencies": {
40
- "jest": "^29.3.1"
43
+ "cross-env": "^7.0.3",
44
+ "jest": "^29.6.1",
45
+ "minimist": "^1.2.8"
41
46
  }
42
47
  }