Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Enhancement] Upgrade type-analyzer to pass 0/1 as integer (#317)

Shan He448aa56dcc8a
diff --git a/package.json b/package.json
index 95cf67515..51b067fa4 100644
--- a/package.json
+++ b/package.json
@@ -104,7 +104,7 @@
"reselect": "^3.0.1",
"styled-components": "^2.2.4",
"supercluster": "^3.0.0",
- "type-analyzer": "https://registry.npmjs.org/type-analyzer/-/type-analyzer-0.1.4.tgz",
+ "type-analyzer": "https://registry.npmjs.org/type-analyzer/-/type-analyzer-0.2.1.tgz",
"uber-licence": "^3.1.1",
"viewport-mercator-project": "^6.0.0",
"wellknown": "^0.5.0"
diff --git a/test/node/utils/data-processor-test.js b/test/node/utils/data-processor-test.js
index d2b89755f..1e0c3b356 100644
--- a/test/node/utils/data-processor-test.js
+++ b/test/node/utils/data-processor-test.js
@@ -41,34 +41,38 @@ test('Processor -> getFieldsFromData', t => {
time_str: 'January 1st 2017 11:00pm ',
value: '4',
surge: '1.2',
- isTrip: 'true'
+ isTrip: 'true',
+ zeroOnes: '0'
}, {
time: '2016-09-17 00:30:08',
trip_epoch: '1472860800000',
time_str: 'January 1st 2017 11:01pm ',
value: '3',
surge: null,
- isTrip: 'false'
+ isTrip: 'false',
+ zeroOnes: '1'
}, {
time: null,
trip_epoch: null,
time_str: 'January 1st, 2017 11:02pm ',
value: '2',
surge: '1.3',
- isTrip: null
+ isTrip: null,
+ zeroOnes: '1'
}, {
time: null,
trip_epoch: null,
time_str: 'January 1st, 2017 11:02pm ',
value: '0',
surge: '1.4',
- isTrip: null
+ isTrip: null,
+ zeroOnes: '0'
}];
const headerRow = Object.keys(data[0]);
const fields = getFieldsFromData(data, headerRow);
const expectedFieldTypes =
- ['timestamp', 'timestamp', 'timestamp', 'integer', 'real', 'boolean'];
+ ['timestamp', 'timestamp', 'timestamp', 'integer', 'real', 'boolean', 'integer'];
fields.forEach((f, i) =>
t.equal(f.type, expectedFieldTypes[i],
diff --git a/yarn.lock b/yarn.lock
index 2a581489d..514f14551 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7448,9 +7448,9 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
-"type-analyzer@https://registry.npmjs.org/type-analyzer/-/type-analyzer-0.1.4.tgz":
- version "0.1.4"
- resolved "https://registry.npmjs.org/type-analyzer/-/type-analyzer-0.1.4.tgz#4592d5792831d0fb061a68feb870d7d171c287aa"
+"type-analyzer@https://registry.npmjs.org/type-analyzer/-/type-analyzer-0.2.1.tgz":
+ version "0.2.1"
+ resolved "https://registry.npmjs.org/type-analyzer/-/type-analyzer-0.2.1.tgz#c3a04552be0114d079a54b5def72a828605f9cf9"
type-check@~0.3.1, type-check@~0.3.2:
version "0.3.2"