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

is-number-object

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-number-object - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

CHANGELOG.md

@@ -0,1 +1,5 @@

1.0.3 / 2015-01-29
=================
* If @@toStringTag is not present, use the old-school Object#toString test.
1.0.2 / 2015-01-29

@@ -2,0 +6,0 @@ =================

9

index.js
'use strict';
var toStr = Number.prototype.toString;
var numToStr = Number.prototype.toString;
var tryNumberObject = function tryNumberObject(value) {
try {
toStr.call(value);
numToStr.call(value);
return true;

@@ -12,2 +12,5 @@ } catch (e) {

};
var toStr = Object.prototype.toString;
var numClass = '[object Number]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';

@@ -17,3 +20,3 @@ module.exports = function isNumberObject(value) {

if (typeof value !== 'object') { return false; }
return tryNumberObject(value);
return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass;
};
{
"name": "is-number-object",
"version": "1.0.2",
"version": "1.0.3",
"author": "Jordan Harband",

@@ -5,0 +5,0 @@ "description": "Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.",

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