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 2.0.3 to 2.0.4

dist/to-string-x.esm.js

70

dist/to-string-x.js
/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2015-present",
"date": "2019-07-10T12:22:07.292Z",
"date": "2019-07-12T11:51:51.259Z",
"describe": "",
"description": "ES6-compliant shim for ToString.",
"file": "to-string-x.js",
"hash": "3995b4f2f8935d0ac37f",
"hash": "2351d1d9eceb37aa7593",
"license": "MIT",
"version": "2.0.3"
"version": "2.0.4"
}

@@ -122,3 +123,3 @@ */

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })

@@ -133,33 +134,2 @@ /************************************************************************/

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ToString;
var _isSymbol = _interopRequireDefault(__webpack_require__(1));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The abstract operation ToString converts argument to a value of type String.
*
* @param {*} [value] - The value to convert to a string.
* @throws {TypeError} If `value` is a Symbol.
* @returns {string} The converted value.
*/
function ToString(value) {
if ((0, _isSymbol.default)(value)) {
throw new TypeError('Cannot convert a Symbol value to a string');
}
return ''.constructor(value);
}
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;

@@ -201,2 +171,32 @@ var hasSymbols = __webpack_require__(2)();

/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToString; });
/* harmony import */ var is_symbol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var is_symbol__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(is_symbol__WEBPACK_IMPORTED_MODULE_0__);
var ERROR_MESSAGE = 'Cannot convert a Symbol value to a string';
var castString = ERROR_MESSAGE.constructor;
/**
* The abstract operation ToString converts argument to a value of type String.
*
* @param {*} [value] - The value to convert to a string.
* @throws {TypeError} If `value` is a Symbol.
* @returns {string} The converted value.
*/
function ToString(value) {
if (is_symbol__WEBPACK_IMPORTED_MODULE_0___default()(value)) {
throw new TypeError(ERROR_MESSAGE);
}
return castString(value);
}
/***/ }),
/* 2 */

@@ -203,0 +203,0 @@ /***/ (function(module, exports, __webpack_require__) {

/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2015-present",
"date": "2019-07-10T12:22:07.292Z",
"date": "2019-07-12T11:51:51.259Z",
"describe": "",
"description": "ES6-compliant shim for ToString.",
"file": "to-string-x.min.js",
"hash": "ee3283c5460ef8f2ce4d",
"hash": "4100fa6bab1dbae8906c",
"license": "MIT",
"version": "2.0.3"
"version": "2.0.4"
}
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.toStringX=e():t.toStringX=e()}(function(){"use strict";return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()}(),function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,n.default)(t))throw new TypeError("Cannot convert a Symbol value to a string");return"".constructor(t)};var o,n=(o=r(1))&&o.__esModule?o:{default:o}},function(t,e,r){"use strict";var o=Object.prototype.toString;if(r(2)()){var n=Symbol.prototype.toString,u=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==o.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u.test(n.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,r){"use strict";(function(e){var o=e.Symbol,n=r(4);t.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}}).call(this,r(3))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.toStringX=e():t.toStringX=e()}(function(){"use strict";return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")()}(),function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(2)()){var o=Symbol.prototype.toString,u=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",function(){return i});var n=r(0),o=r.n(n),u="Cannot convert a Symbol value to a string",f=u.constructor;function i(t){if(o()(t))throw new TypeError(u);return f(t)}},function(t,e,r){"use strict";(function(e){var n=e.Symbol,o=r(4);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,r(3))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}}])});
//# sourceMappingURL=to-string-x.min.js.map
{
"name": "to-string-x",
"version": "2.0.3",
"version": "2.0.4",
"description": "ES6-compliant shim for ToString.",

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

],
"browser": "dist/to-string-x.min.js",
"module": "src/to-string-x.js",
"module": "dist/to-string-x.esm.js",
"main": "dist/to-string-x.js",
"scripts": {
"build:esm": "mkdirp dist && babel -s true --env-name esm src/to-string-x.js -o dist/to-string-x.esm.js",
"build:base": "webpack --bail --progress --profile --colors",
"build": "cross-env NODE_ENV=production npm run build:base --",
"build": "npm run build:esm && cross-env NODE_ENV=production npm run build:base --",
"build:dev": "npm run build:base --",

@@ -53,3 +53,3 @@ "clean": "rimraf dist && npm run clean:coverage",

"dependencies": {
"is-symbol": "^1.0.1"
"is-symbol": "^1.0.2"
},

@@ -59,2 +59,7 @@ "devDependencies": {

"@babel/core": "^7.5.4",
"@babel/node": "^7.5.0",
"@babel/plugin-proposal-class-properties": "^7.5.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-export-default-from": "^7.2.0",
"@babel/plugin-syntax-export-namespace-from": "^7.2.0",
"@babel/plugin-transform-property-mutators": "^7.2.0",

@@ -64,10 +69,12 @@ "@babel/plugin-transform-runtime": "^7.5.0",

"@babel/runtime": "^7.5.4",
"@prorenata/eslint-config-vue": "^1.13.5",
"@prorenata/eslint-config-vue": "^1.13.6",
"@types/jest": "^24.0.15",
"@types/node": "^12.6.1",
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"@types/node": "^12.6.2",
"babel-core": "^7.0.0-0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"babel-plugin-lodash": "^3.3.4",
"caniuse-lite": "^1.0.30000983",
"chalk": "^2.4.2",
"concurrently": "^4.1.1",
"cross-env": "^5.2.0",

@@ -87,3 +94,3 @@ "eslint": "=5.16.0",

"eslint-plugin-jest": "^22.7.2",
"eslint-plugin-jsdoc": "^15.3.2",
"eslint-plugin-jsdoc": "^15.3.5",
"eslint-plugin-json": "^1.4.0",

@@ -99,10 +106,16 @@ "eslint-plugin-lodash": "^5.1.0",

"friendly-errors-webpack-plugin": "^1.7.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0",
"jest-cli": "^24.8.0",
"jest-css": "^1.0.1",
"jest-file": "^1.0.0",
"lodash": "^4.17.13",
"jsdoc-to-markdown": "^5.0.0",
"lodash": "^4.17.14",
"lodash-webpack-plugin": "^0.11.5",
"mkdirp": "^0.5.1",
"node-notifier": "^5.4.0",
"nodemon": "^1.19.1",
"prettier": "=1.14.3",
"rimraf": "^2.6.3",
"semver": "^6.2.0",
"source-map-loader": "^0.2.4",
"terser-webpack-plugin": "^1.3.0",

@@ -109,0 +122,0 @@ "typescript": "^3.5.3",

import isSymbol from 'is-symbol';
const ERROR_MESSAGE = 'Cannot convert a Symbol value to a string';
const castString = ERROR_MESSAGE.constructor;
/**

@@ -12,6 +14,6 @@ * The abstract operation ToString converts argument to a value of type String.

if (isSymbol(value)) {
throw new TypeError('Cannot convert a Symbol value to a string');
throw new TypeError(ERROR_MESSAGE);
}
return ''.constructor(value);
return castString(value);
}

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