New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@typen/num-strict

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typen/num-strict - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

20

dist/index.cjs.js

@@ -5,23 +5,11 @@ 'use strict';

var enumDataTypes = require('@typen/enum-data-types');
var typ = require('@typen/typ');
// Angular 4.3
const isNumeric = x => !isNaN(x - parseFloat(x));
// from x => typeof x
const NUM = 'number';
const STR = 'string';
const OBJ = 'object';
const OptS = Object.prototype.toString;
/**
* const rxObj = /^\[object (.*)]$/
* Equivalent to: Object.prototype.stringify.call(o).match(rxObj)[1]
* @param {*} o
* @return {string}
*/
const typ = o => OptS.call(o).slice(8, -1);
const inferType = x => {
const t = typeof x;
return t === STR ? isNumeric(x) ? NUM : STR : t === OBJ ? typ(x) : t;
return t === enumDataTypes.STR ? isNumeric(x) ? enumDataTypes.NUM : enumDataTypes.STR : t === enumDataTypes.OBJ ? typ.typ(x) : t;
};

@@ -28,0 +16,0 @@

18

dist/index.esm.js

@@ -0,19 +1,7 @@

import { STR, NUM, OBJ } from '@typen/enum-data-types';
import { typ } from '@typen/typ';
// Angular 4.3
const isNumeric = x => !isNaN(x - parseFloat(x));
// from x => typeof x
const NUM = 'number';
const STR = 'string';
const OBJ = 'object';
const OptS = Object.prototype.toString;
/**
* const rxObj = /^\[object (.*)]$/
* Equivalent to: Object.prototype.stringify.call(o).match(rxObj)[1]
* @param {*} o
* @return {string}
*/
const typ = o => OptS.call(o).slice(8, -1);
const inferType = x => {

@@ -20,0 +8,0 @@ const t = typeof x;

{
"name": "@typen/num-strict",
"version": "0.0.1",
"version": "0.0.2",
"description": "A type cheker",

@@ -17,2 +17,6 @@ "main": "dist/index.cjs.js",

},
"dependencies": {
"@typen/enum-data-types": "^0.0.2",
"@typen/typ": "^0.0.2"
},
"repository": {

@@ -33,3 +37,3 @@ "type": "git",

"homepage": "https://github.com/hoyeungw/typen#readme",
"gitHead": "d0fd55ecea305361b1ff7dd19e2ff311f7b46052"
"gitHead": "9b4e2ddb145e45ce721bb778b01ba802ff1d763c"
}
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