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

to-string-x

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-string-x - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

6

index.js
/**
* @file ES6-compliant shim for ToString.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tostring|7.1.12 ToString ( argument )}
* @version 1.4.1
* @version 1.4.2
* @author Xotic750 <Xotic750@gmail.com>

@@ -13,2 +13,3 @@ * @copyright Xotic750

var castString = ''.constructor;
var isSymbol = require('is-symbol');

@@ -32,2 +33,3 @@

* $toString(Object(Symbol.iterator)); // TypeError
* $toString(Object.create(null)); // TypeError
*/

@@ -39,3 +41,3 @@ module.exports = function ToString(value) {

return String(value);
return castString(value);
};

@@ -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-tostring|7.1.12 ToString ( argument )}
* @version 1.4.1
* @version 1.4.2
* @author Xotic750 <Xotic750@gmail.com>

@@ -15,2 +15,3 @@ * @copyright Xotic750

var castString = ''.constructor;
var isSymbol = _dereq_('is-symbol');

@@ -34,2 +35,3 @@

* $toString(Object(Symbol.iterator)); // TypeError
* $toString(Object.create(null)); // TypeError
*/

@@ -41,3 +43,3 @@ module.exports = function ToString(value) {

return String(value);
return castString(value);
};

@@ -44,0 +46,0 @@

!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 ToString.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tostring|7.1.12 ToString ( argument )}
* @version 1.4.1
* @version 1.4.2
* @author Xotic750 <Xotic750@gmail.com>

@@ -10,2 +10,2 @@ * @copyright Xotic750

*/
"use strict";var isSymbol=_dereq_("is-symbol");module.exports=function ToString(value){if(isSymbol(value))throw new TypeError("Cannot convert a Symbol value to a string");return String(value)}},{"is-symbol":2}],2:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,isSymbolObject=function isSymbolObject(value){return"symbol"==typeof value.valueOf()&&symStringRegex.test(symToStr.call(value))};module.exports=function isSymbol(value){if("symbol"==typeof value)return!0;if("[object Symbol]"!==toStr.call(value))return!1;try{return isSymbolObject(value)}catch(e){return!1}}}else module.exports=function isSymbol(value){return!1}},{}]},{},[1])(1)});
"use strict";var castString="".constructor,isSymbol=_dereq_("is-symbol");module.exports=function ToString(value){if(isSymbol(value))throw new TypeError("Cannot convert a Symbol value to a string");return castString(value)}},{"is-symbol":2}],2:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,isSymbolObject=function isSymbolObject(value){return"symbol"==typeof value.valueOf()&&symStringRegex.test(symToStr.call(value))};module.exports=function isSymbol(value){if("symbol"==typeof value)return!0;if("[object Symbol]"!==toStr.call(value))return!1;try{return isSymbolObject(value)}catch(e){return!1}}}else module.exports=function isSymbol(value){return!1}},{}]},{},[1])(1)});
{
"name": "to-string-x",
"version": "1.4.1",
"version": "1.4.2",
"description": "ES6-compliant shim for ToString.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/Xotic750/to-string-x",

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

**See**: [7.1.12 ToString ( argument )](http://www.ecma-international.org/ecma-262/6.0/#sec-tostring)
**Version**: 1.4.1
**Version**: 1.4.2
**Author**: Xotic750 <Xotic750@gmail.com>

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

$toString(Object(Symbol.iterator)); // TypeError
$toString(Object.create(null)); // TypeError
```

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