@vizabi/reader-ddfcsv 4.5.0 → 4.5.2
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/dist/reader-ddfcsv-polyfill.js +1 -1
- package/dist/reader-ddfcsv-polyfill.js.map +1 -1
- package/dist/reader-ddfcsv.js +2 -2
- package/dist/reader-ddfcsv.js.map +1 -1
- package/lib/src/ddf-csv.js +7 -5
- package/lib/src/ddf-csv.js.map +1 -1
- package/lib/src/ddfcsv-reader.js +2 -3
- package/lib/src/ddfcsv-reader.js.map +1 -1
- package/lib/src/file-readers/github-path-adapter.js +1 -2
- package/lib/src/file-readers/github-path-adapter.js.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/resource-selection-optimizer/index.js +1 -2
- package/lib/src/resource-selection-optimizer/index.js.map +1 -1
- package/lib-web/src/ddf-csv.js +7 -5
- package/lib-web/src/ddf-csv.js.map +1 -1
- package/lib-web/src/ddfcsv-reader.js +2 -3
- package/lib-web/src/ddfcsv-reader.js.map +1 -1
- package/lib-web/src/file-readers/frontend-file-reader.js +0 -1
- package/lib-web/src/file-readers/frontend-file-reader.js.map +1 -1
- package/lib-web/src/file-readers/github-path-adapter.js +1 -2
- package/lib-web/src/file-readers/github-path-adapter.js.map +1 -1
- package/lib-web/src/index-web.js +2 -2
- package/lib-web/src/resource-selection-optimizer/index.js +1 -2
- package/lib-web/src/resource-selection-optimizer/index.js.map +1 -1
- package/package.json +3 -5
- package/src/ddf-csv.ts +7 -4
- package/src/file-readers/frontend-file-reader.ts +0 -2
- package/test/definition/datapoints-definition.spec.ts +1 -1
- package/test/multi-instances.spec.ts +1 -1
- package/test/result-fixtures/in-clause-under-conjunction-1.json +100 -100
- package/test/result-fixtures/in-clause-under-conjunction-2.json +70169 -70169
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizabi/reader-ddfcsv",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"description": "Vizabi DDFcsv reader",
|
|
5
5
|
"author": "Vyacheslav Chub<vyacheslav.chub@valor-software.com>",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
"tsc-web": "tsc --project tsconfig-web.json && TARGET_DIR=lib-web npm run set-own-version",
|
|
20
20
|
"submodules:init": "git submodule update --init -f",
|
|
21
21
|
"coverage:clean": "rm -rf coverage && rm -rf .nyc_output && rm -rf coverage.lcov",
|
|
22
|
-
"
|
|
23
|
-
"pree2e": "npm run submodules:init && npm run remove-unneeded && npm run coverage:clean && npm run tslint && npm run tsc-node",
|
|
22
|
+
"pree2e": "npm run submodules:init && npm run coverage:clean && npm run tslint && npm run tsc-node",
|
|
24
23
|
"e2e": "nyc mocha",
|
|
25
24
|
"pree2e:doc": "npm run pree2e",
|
|
26
25
|
"e2e:doc": "mocha --require ts-node/register -R markdown > API.SPECIFICATION.md --recursive test/*.spec.ts",
|
|
@@ -57,7 +56,6 @@
|
|
|
57
56
|
"cross-project-diagnostics": "0.1.5",
|
|
58
57
|
"d3-time-format": "^2.2.3",
|
|
59
58
|
"ddf-query-validator": "1.4.1",
|
|
60
|
-
"fetch-polyfill": "0.8.2",
|
|
61
59
|
"https": "1.0.0",
|
|
62
60
|
"lodash.clonedeep": "4.5.0",
|
|
63
61
|
"lodash.compact": "3.0.1",
|
|
@@ -119,7 +117,7 @@
|
|
|
119
117
|
"tslib": " 2.6.2",
|
|
120
118
|
"tslint": "6.1.3",
|
|
121
119
|
"tslint-no-unused-expression-chai": "0.1.4",
|
|
122
|
-
"typescript": "5.4
|
|
120
|
+
"typescript": "5.5.4",
|
|
123
121
|
"uglifyjs-webpack-plugin": "1.2.5",
|
|
124
122
|
"webpack": "4.8.1",
|
|
125
123
|
"webpack-bundle-analyzer": "^3.0.4",
|
package/src/ddf-csv.ts
CHANGED
|
@@ -405,8 +405,8 @@ export function ddfCsvReader (logger?: any) {
|
|
|
405
405
|
where[key] = where[key].reduce((res, value) => {
|
|
406
406
|
const valueKeys = Object.keys(value);
|
|
407
407
|
if (valueKeys.length > 1) {
|
|
408
|
-
for (const
|
|
409
|
-
res.push({ [
|
|
408
|
+
for (const vKey of valueKeys) {
|
|
409
|
+
res.push({ [vKey]: value[vKey] });
|
|
410
410
|
}
|
|
411
411
|
} else {
|
|
412
412
|
res.push(value);
|
|
@@ -851,7 +851,10 @@ export function ddfCsvReader (logger?: any) {
|
|
|
851
851
|
// skip parsing time/string concept types
|
|
852
852
|
const concept: any = options.conceptsLookup.get(headerName) || {};
|
|
853
853
|
|
|
854
|
-
return !includes([
|
|
854
|
+
return !includes(['time', 'string', 'entity_domain', 'entity_set'], concept.concept_type);
|
|
855
|
+
},
|
|
856
|
+
transform: value => {
|
|
857
|
+
return value === '' ? null : value
|
|
855
858
|
},
|
|
856
859
|
complete: result => {
|
|
857
860
|
debug(`finish reading "${filePath}"`);
|
|
@@ -879,7 +882,7 @@ export function ddfCsvReader (logger?: any) {
|
|
|
879
882
|
const constraints = resource.schema.fields.reduce((result, field) => {
|
|
880
883
|
if (field.constraints?.enum) {
|
|
881
884
|
if (!datasetWithConstraints) datasetWithConstraints = true;
|
|
882
|
-
result[field.name] = field.constraints.enum
|
|
885
|
+
result[field.name] = field.constraints.enum;
|
|
883
886
|
}
|
|
884
887
|
return result;
|
|
885
888
|
}, {});
|
|
@@ -187,7 +187,7 @@ function parseYear(resultFixture, concepts = ['year', 'time']) {
|
|
|
187
187
|
for (const row of resultFixture) {
|
|
188
188
|
for (const concept of concepts) {
|
|
189
189
|
if (row[concept] && typeof row[concept] === 'string') {
|
|
190
|
-
row[concept] = new Date(Date.UTC(row[concept], 0));
|
|
190
|
+
row[concept] = new Date(Date.UTC(+row[concept], 0));
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|