@typen/vector-type
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -10,2 +10,4 @@ 'use strict'; | ||
const nullish = x => x === null || x === void 0; | ||
/** | ||
@@ -24,9 +26,9 @@ * | ||
let o, | ||
nullish = null; | ||
nullType = null; | ||
const distinct = (l = vec === null || vec === void 0 ? void 0 : vec.length) === (l & 0x7f) ? (o = [], vectorMapper.iterate(vec, x => { | ||
if (omitNull && nullish(x)) nullish = x;else if (o.indexOf(x = inferType$1(x)) < 0) o.push(x); | ||
if (omitNull && nullish(x)) nullType = x;else if (o.indexOf(x = inferType$1(x)) < 0) o.push(x); | ||
}, l), o) : (o = {}, vectorMapper.iterate(vec, x => { | ||
if (omitNull && nullish(x)) nullish = x;else if (!((x = inferType$1(x)) in o)) o[x] = void 0; | ||
if (omitNull && nullish(x)) nullType = x;else if (!((x = inferType$1(x)) in o)) o[x] = void 0; | ||
}, l), Object.keys(o)); | ||
return distinct.length ? distinct : [nullish]; | ||
return distinct.length ? distinct : [nullType]; | ||
}; | ||
@@ -67,5 +69,3 @@ /** | ||
const VectorType = (config = {}) => { | ||
return vectorType.bind(config); | ||
}; | ||
const VectorType = (config = {}) => vectorType.bind(config); | ||
@@ -72,0 +72,0 @@ exports.InferTypes = InferTypes; |
@@ -6,2 +6,4 @@ import { NUL, NUM } from '@typen/enum-data-types'; | ||
const nullish = x => x === null || x === void 0; | ||
/** | ||
@@ -20,9 +22,9 @@ * | ||
let o, | ||
nullish = null; | ||
nullType = null; | ||
const distinct = (l = vec === null || vec === void 0 ? void 0 : vec.length) === (l & 0x7f) ? (o = [], iterate(vec, x => { | ||
if (omitNull && nullish(x)) nullish = x;else if (o.indexOf(x = inferType(x)) < 0) o.push(x); | ||
if (omitNull && nullish(x)) nullType = x;else if (o.indexOf(x = inferType(x)) < 0) o.push(x); | ||
}, l), o) : (o = {}, iterate(vec, x => { | ||
if (omitNull && nullish(x)) nullish = x;else if (!((x = inferType(x)) in o)) o[x] = void 0; | ||
if (omitNull && nullish(x)) nullType = x;else if (!((x = inferType(x)) in o)) o[x] = void 0; | ||
}, l), Object.keys(o)); | ||
return distinct.length ? distinct : [nullish]; | ||
return distinct.length ? distinct : [nullType]; | ||
}; | ||
@@ -63,6 +65,4 @@ /** | ||
const VectorType = (config = {}) => { | ||
return vectorType.bind(config); | ||
}; | ||
const VectorType = (config = {}) => vectorType.bind(config); | ||
export { InferTypes, VectorType, inferTypes, vectorType }; |
{ | ||
"name": "@typen/vector-type", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Check type for array", | ||
@@ -18,6 +18,6 @@ "main": "dist/index.cjs.js", | ||
"dependencies": { | ||
"@typen/enum-data-types": "^0.1.8", | ||
"@typen/enum-tabular-types": "^0.1.8", | ||
"@typen/infer-type": "^0.1.8", | ||
"@typen/num-strict": "^0.1.8", | ||
"@typen/enum-data-types": "^0.1.9", | ||
"@typen/enum-tabular-types": "^0.1.9", | ||
"@typen/infer-type": "^0.1.9", | ||
"@typen/num-strict": "^0.1.9", | ||
"@vect/vector-mapper": "^0.2.9" | ||
@@ -40,3 +40,3 @@ }, | ||
"homepage": "https://github.com/hoyeungw/typen#readme", | ||
"gitHead": "4d0944b622508c4ba7b58434cf9561fd477df810" | ||
"gitHead": "2d6090b8ca96a339fa7e18bb34bf74bb479485f1" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7590
117
Updated@typen/infer-type@^0.1.9
Updated@typen/num-strict@^0.1.9