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

reshow-runtime

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reshow-runtime - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

13

es/getTypeOf.js

@@ -0,1 +1,3 @@

var types = '|number|string|boolean|object|function|undefined|';
var getTypeOf = function getTypeOf(val, name) {

@@ -6,6 +8,11 @@ if (Number.isNaN(val)) {

try {
if (!name) {
name = Object.getPrototypeOf(val).constructor.name.toLowerCase();
var type = Object.getPrototypeOf(val).constructor.name.toLowerCase();
if (-1 === types.indexOf(type)) {
if (!name) {
name = type;
}
return name;
} else {
return type;
}
return name;
} catch (ex) {

@@ -12,0 +19,0 @@ return Object.prototype.toString.call(val).replace(/^\[object\s(.*)\]$/, '$1').toLowerCase();

@@ -6,2 +6,4 @@ 'use strict';

});
var types = '|number|string|boolean|object|function|undefined|';
var getTypeOf = function getTypeOf(val, name) {

@@ -12,6 +14,11 @@ if (Number.isNaN(val)) {

try {
if (!name) {
name = Object.getPrototypeOf(val).constructor.name.toLowerCase();
var type = Object.getPrototypeOf(val).constructor.name.toLowerCase();
if (-1 === types.indexOf(type)) {
if (!name) {
name = type;
}
return name;
} else {
return type;
}
return name;
} catch (ex) {

@@ -18,0 +25,0 @@ return Object.prototype.toString.call(val).replace(/^\[object\s(.*)\]$/, '$1').toLowerCase();

{
"name": "reshow-runtime",
"version": "0.0.10",
"version": "0.0.11",
"description": "Babel runtime alternative",

@@ -5,0 +5,0 @@ "repository": "react-atomic/reshow",

@@ -40,3 +40,8 @@ 'use strict';

(0, _chai.expect)((0, _typeof3.default)(new FOO())).to.equal('object');
(0, _chai.expect)((0, _typeof3.default)(1)).to.equal('number');
(0, _chai.expect)((0, _typeof3.default)('1')).to.equal('string');
(0, _chai.expect)((0, _typeof3.default)(true)).to.equal('boolean');
(0, _chai.expect)((0, _typeof3.default)(function () {})).to.equal('function');
(0, _chai.expect)((0, _typeof3.default)(undefined)).to.equal('undefined');
});
});

Sorry, the diff of this file is not supported yet

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