Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

type-analyzer

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

type-analyzer - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

6

CHANGELOG.md

@@ -19,2 +19,8 @@

#### [0.2.4] - Jan 08 2020 (3ab0fb8)
2cf038e Treat large numeric columns as numbers
#### [0.2.3] - Oct 08 2019 (371f641)
986ce5c [Enhancement] Add support for Array and Object data type)
#### [0.2.2] - Oct 07 2019 (b913061)

@@ -21,0 +27,0 @@ 37de75d add eslint and prettier

2

package.json
{
"name": "type-analyzer",
"description": "Infer types from columns in JSON",
"version": "0.2.3",
"version": "0.2.4",
"main": "index.js",

@@ -6,0 +6,0 @@ "repository": {

@@ -56,5 +56,13 @@ // Copyright (c) 2017 Uber Technologies, Inc.

// numbers:
// 1, 2, 3
VALIDATOR_MAP[DATA_TYPES.INT] = Utils.buildRegexCheck('isInt');
// 1, 2, 3, +40, 15,121
const intRegexCheck = Utils.buildRegexCheck('isInt');
VALIDATOR_MAP[DATA_TYPES.INT] = function isInt(value) {
if (intRegexCheck(value)) {
var asNum = parseInt(value.toString().replace(/(\+|,)/g, ''), 10);
return asNum > Number.MIN_SAFE_INTEGER && asNum < Number.MAX_SAFE_INTEGER;
}
return false;
};
// 1.1, 2.2, 3.3

@@ -61,0 +69,0 @@ VALIDATOR_MAP[DATA_TYPES.FLOAT] = Utils.buildRegexCheck('isFloat');

@@ -164,2 +164,9 @@ // Copyright (c) 2017 Uber Technologies, Inc.

assert.end();
arr = ['182891173641581479', '2e53', '1e16', 182891173641581479].map(mapArr);
assert.equal(
Analyzer.computeColMeta(arr)[0].type,
'NUMBER',
'Inteprets large numeric values as numbers'
);
});

@@ -166,0 +173,0 @@

@@ -33,3 +33,3 @@ // Copyright (c) 2017 Uber Technologies, Inc.

var start = Date.now();
spec.apply(null, arguments);
spec(...arguments);
var duration = Date.now() - start;

@@ -36,0 +36,0 @@ testDurations.push({name: name, duration: duration});

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc