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

to-length-x

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-length-x - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

2

index.js
/**
* @file ES6-compliant shim for ToLength.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -6,0 +6,0 @@ * @copyright Xotic750

@@ -5,3 +5,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -431,3 +431,3 @@ * @copyright Xotic750

* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign|20.2.2.29 Math.sign(x)}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -583,3 +583,3 @@ * @copyright Xotic750

* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger|7.1.4 ToInteger ( argument )}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -627,3 +627,3 @@ * @copyright Xotic750

* @file Converts argument to a value of type Number.
* @version 1.0.1
* @version 1.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -670,3 +670,3 @@ * @copyright Xotic750

var $toNumber = function toNumber(argument) {
var value = toPrimitive(argument, 'number');
var value = toPrimitive(argument, Number);
if (typeof value === 'symbol') {

@@ -673,0 +673,0 @@ throw new TypeError('Cannot convert a Symbol value to a number');

!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){/**
* @file ES6-compliant shim for ToLength.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -63,3 +63,3 @@ * @copyright Xotic750

* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign|20.2.2.29 Math.sign(x)}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -98,3 +98,3 @@ * @copyright Xotic750

* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger|7.1.4 ToInteger ( argument )}
* @version 2.0.1
* @version 2.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -107,3 +107,3 @@ * @copyright Xotic750

* @file Converts argument to a value of type Number.
* @version 1.0.1
* @version 1.1.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -114,3 +114,3 @@ * @copyright Xotic750

*/
"use strict";var toPrimitive=_dereq_("to-primitive-x"),trim=_dereq_("trim-x"),pStrSlice=String.prototype.slice,binaryRegex=/^0b[01]+$/i,test=binaryRegex.test,isBinary=function _isBinary(value){return test.call(binaryRegex,value)},octalRegex=/^0o[0-7]+$/i,isOctal=function _isOctal(value){return test.call(octalRegex,value)},nonWS=["\x85","\u200b","\ufffe"].join(""),nonWSregex=new RegExp("["+nonWS+"]","g"),hasNonWS=function _hasNonWS(value){return test.call(nonWSregex,value)},invalidHexLiteral=/^[-+]0x[0-9a-f]+$/i,isInvalidHexLiteral=function _isInvalidHexLiteral(value){return test.call(invalidHexLiteral,value)},$toNumber=function toNumber(argument){var value=toPrimitive(argument,"number");if("symbol"==typeof value)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof value){if(isBinary(value))return $toNumber(parseInt(pStrSlice.call(value,2),2));if(isOctal(value))return $toNumber(parseInt(pStrSlice.call(value,2),8));if(hasNonWS(value)||isInvalidHexLiteral(value))return NaN;var trimmed=trim(value);if(trimmed!==value)return $toNumber(trimmed)}return Number(value)};module.exports=$toNumber},{"to-primitive-x":20,"trim-x":25}],20:[function(_dereq_,module,exports){/**
"use strict";var toPrimitive=_dereq_("to-primitive-x"),trim=_dereq_("trim-x"),pStrSlice=String.prototype.slice,binaryRegex=/^0b[01]+$/i,test=binaryRegex.test,isBinary=function _isBinary(value){return test.call(binaryRegex,value)},octalRegex=/^0o[0-7]+$/i,isOctal=function _isOctal(value){return test.call(octalRegex,value)},nonWS=["\x85","\u200b","\ufffe"].join(""),nonWSregex=new RegExp("["+nonWS+"]","g"),hasNonWS=function _hasNonWS(value){return test.call(nonWSregex,value)},invalidHexLiteral=/^[-+]0x[0-9a-f]+$/i,isInvalidHexLiteral=function _isInvalidHexLiteral(value){return test.call(invalidHexLiteral,value)},$toNumber=function toNumber(argument){var value=toPrimitive(argument,Number);if("symbol"==typeof value)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof value){if(isBinary(value))return $toNumber(parseInt(pStrSlice.call(value,2),2));if(isOctal(value))return $toNumber(parseInt(pStrSlice.call(value,2),8));if(hasNonWS(value)||isInvalidHexLiteral(value))return NaN;var trimmed=trim(value);if(trimmed!==value)return $toNumber(trimmed)}return Number(value)};module.exports=$toNumber},{"to-primitive-x":20,"trim-x":25}],20:[function(_dereq_,module,exports){/**
* @file Converts a JavaScript object to a primitive value.

@@ -117,0 +117,0 @@ * @version 1.0.1

{
"name": "to-length-x",
"version": "2.0.1",
"version": "2.1.0",
"description": "ES6-compliant shim for ToLength.",

@@ -33,3 +33,3 @@ "homepage": "https://github.com/Xotic750/to-length-x",

"max-safe-integer": "^1.0.1",
"to-integer-x": "^2.0.1"
"to-integer-x": "^2.1.0"
},

@@ -36,0 +36,0 @@ "devDependencies": {

@@ -27,3 +27,3 @@ <a href="https://travis-ci.org/Xotic750/to-length-x"

**See**: [7.1.15 ToLength ( argument )](http://www.ecma-international.org/ecma-262/6.0/#sec-tolength)
**Version**: 2.0.1
**Version**: 2.1.0
**Author**: Xotic750 <Xotic750@gmail.com>

@@ -30,0 +30,0 @@ **License**: [MIT](&lt;https://opensource.org/licenses/MIT&gt;)

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