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

es-abstract

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-abstract - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

helpers/isNaN.js

25

.jscs.json

@@ -48,3 +48,3 @@ {

"disallowQuotedKeysInObjects": "allButReserved",
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },

@@ -154,4 +154,25 @@ "disallowSpaceAfterObjectKeys": true,

"requireEarlyReturn": false
"requireEarlyReturn": false,
"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},
"requireImportAlphabetized": false,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false,
"disallowUnusedVariables": true,
"requireSpacesInsideImportedObjectBraces": true,
"requireUseStrict": true
}

@@ -0,1 +1,11 @@

1.5.1 / 2016-05-30
=================
* [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument
* [Refactor] create `isNaN` helper
* [Deps] update `is-callable`, `function-bind`
* [Deps] update `es-to-primitive`, fix ES5 tests
* [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp`
* [Tests] up to `node` `v6.2`, `v5.11`, `v4.4`
* [Tests] use pretest/posttest for linting/security
1.5.0 / 2015-12-27

@@ -2,0 +12,0 @@ =================

4

es5.js
'use strict';
var $isNaN = Number.isNaN || function (a) { return a !== a; };
var $isNaN = require('./helpers/isNaN');
var $isFinite = require('./helpers/isFinite');

@@ -60,3 +60,3 @@

}
return $isNaN(x) && $isNaN(y);
return $isNaN(x) && $isNaN(y);
}

@@ -63,0 +63,0 @@ };

@@ -7,3 +7,3 @@ 'use strict';

var $isNaN = Number.isNaN || function (a) { return a !== a; };
var $isNaN = require('./helpers/isNaN');
var $isFinite = require('./helpers/isFinite');

@@ -158,3 +158,3 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;

// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-canonicalnumericindexstring
// http://www.ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring
CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) {

@@ -167,2 +167,3 @@ if (toStr.call(argument) !== '[object String]') {

if (this.SameValue(this.ToString(n), argument)) { return n; }
return void 0;
},

@@ -215,3 +216,3 @@

if (hasSymbols) {
var isRegExp = RegExp[Symbol.match];
var isRegExp = argument[Symbol.match];
if (typeof isRegExp !== 'undefined') {

@@ -218,0 +219,0 @@ return ES5.ToBoolean(isRegExp);

{
"name": "es-abstract",
"version": "1.5.0",
"version": "1.5.1",
"author": {

@@ -20,7 +20,9 @@ "name": "Jordan Harband",

"scripts": {
"test": "npm run lint && npm run tests-only && npm run security",
"pretest": "npm run --silent lint",
"test": "npm run tests-only",
"posttest": "npm run --silent security",
"tests-only": "node test/index.js",
"coverage": "covert test/*.js",
"coverage-quiet": "covert test/*.js --quiet",
"lint": "npm run jscs && npm run eslint",
"lint": "npm run --silent jscs && npm run --silent eslint",
"jscs": "jscs test/*.js *.js",

@@ -47,15 +49,15 @@ "eslint": "eslint test/*.js *.js",

"dependencies": {
"function-bind": "^1.0.2",
"is-callable": "^1.1.1",
"es-to-primitive": "^1.1.0",
"function-bind": "^1.1.0",
"is-callable": "^1.1.3",
"es-to-primitive": "^1.1.1",
"is-regex": "^1.0.3"
},
"devDependencies": {
"tape": "^4.4.0",
"tape": "^4.5.1",
"covert": "^1.1.0",
"jscs": "^2.7.0",
"jscs": "^3.0.3",
"editorconfig-tools": "^0.1.1",
"nsp": "^2.2.0",
"eslint": "^1.10.3",
"@ljharb/eslint-config": "^1.6.0",
"nsp": "^2.4.0",
"eslint": "^2.11.1",
"@ljharb/eslint-config": "^5.0.0",
"object-is": "^1.0.1",

@@ -62,0 +64,0 @@ "foreach": "^2.0.5",

@@ -9,3 +9,3 @@ 'use strict';

var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } };
var coercibleObject = { valueOf: function () { return '3'; }, toString: function () { return 42; } };
var coercibleFnObject = { valueOf: function () { return function valueOfFn() {}; }, toString: function () { return 42; } };

@@ -22,3 +22,3 @@ var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } };

test('ToPrimitive', function (t) {
t.test('primitives', function (st) {
t.test('primitives', function (st) {
var testPrimitive = function (primitive) {

@@ -32,11 +32,11 @@ st.ok(is(ES.ToPrimitive(primitive), primitive), primitive + ' is returned correctly');

t.test('objects', function (st) {
st.equal(ES.ToPrimitive(coercibleObject), 3, 'coercibleObject coerces to valueOf');
st.equal(ES.ToPrimitive(coercibleObject, Number), 3, 'coercibleObject with hint Number coerces to valueOf');
st.equal(ES.ToPrimitive(coercibleObject, String), '42', 'coercibleObject with hint String coerces to stringified toString');
st.equal(ES.ToPrimitive(coercibleFnObject), 42, 'coercibleFnObject coerces to toString');
st.equal(ES.ToPrimitive(toStringOnlyObject), 7, 'toStringOnlyObject returns non-stringified toString');
st.equal(ES.ToPrimitive(valueOfOnlyObject), 4, 'valueOfOnlyObject returns valueOf');
st.ok(is(ES.ToPrimitive({}), NaN), '{} with no hint coerces to Object#valueOf');
st.equal(ES.ToPrimitive(coercibleObject), coercibleObject.valueOf(), 'coercibleObject coerces to valueOf');
st.equal(ES.ToPrimitive(coercibleObject, Number), coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
st.equal(ES.ToPrimitive(coercibleObject, String), coercibleObject.toString(), 'coercibleObject with hint String coerces to toString');
st.equal(ES.ToPrimitive(coercibleFnObject), coercibleFnObject.toString(), 'coercibleFnObject coerces to toString');
st.equal(ES.ToPrimitive(toStringOnlyObject), toStringOnlyObject.toString(), 'toStringOnlyObject returns toString');
st.equal(ES.ToPrimitive(valueOfOnlyObject), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString');
st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
st.ok(is(ES.ToPrimitive({}, Number), NaN), '{} with hint Number coerces to NaN');
st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString');
st.throws(function () { return ES.ToPrimitive(uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError');

@@ -43,0 +43,0 @@ st.throws(function () { return ES.ToPrimitive(uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError');

@@ -24,3 +24,3 @@ 'use strict';

test('ToPrimitive', function (t) {
t.test('primitives', function (st) {
t.test('primitives', function (st) {
var testPrimitive = function (primitive) {

@@ -292,3 +292,3 @@ st.ok(is(ES.ToPrimitive(primitive), primitive), primitive + ' is returned correctly');

test('ToString', function (t) {
forEach(objects.concat(primitives), function (item) {
forEach(objects.concat(primitives), function (item) {
t.equal(ES.ToString(item), String(item), 'ES.ToString(' + debug(item) + ') ToStrings to String(' + debug(item) + ')');

@@ -295,0 +295,0 @@ });

@@ -26,3 +26,3 @@ 'use strict';

test('ToPrimitive', function (t) {
t.test('primitives', function (st) {
t.test('primitives', function (st) {
var testPrimitive = function (primitive) {

@@ -29,0 +29,0 @@ st.ok(is(ES.ToPrimitive(primitive), primitive), primitive + ' is returned correctly');

Sorry, the diff of this file is not supported yet

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