split-if-boxed-bug-x
Advanced tools
Comparing version 2.0.0 to 2.0.1
/*! | ||
{ | ||
"author": "Graham Fairweather", | ||
"copywrite": "Copyright (c) 2017-present", | ||
"date": "2019-07-10T18:53:00.430Z", | ||
"date": "2019-07-12T13:52:24.384Z", | ||
"describe": "", | ||
"description": "Tests if a value is a string with the boxed bug; splits to an array.", | ||
"file": "split-if-boxed-bug-x.js", | ||
"hash": "fa7be3158835375d008e", | ||
"hash": "4332662aef3451194be1", | ||
"license": "MIT", | ||
"version": "2.0.0" | ||
"version": "2.0.1" | ||
} | ||
@@ -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,46 +134,32 @@ /************************************************************************/ | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = splitIfBoxedBug; | ||
var strValue = String.prototype.valueOf; | ||
var tryStringObject = function tryStringObject(value) { | ||
try { | ||
strValue.call(value); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
var toStr = Object.prototype.toString; | ||
var strClass = '[object String]'; | ||
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; | ||
var _hasBoxedStringX = _interopRequireDefault(__webpack_require__(1)); | ||
module.exports = function isString(value) { | ||
if (typeof value === 'string') { return true; } | ||
if (typeof value !== 'object') { return false; } | ||
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; | ||
}; | ||
var _isString = _interopRequireDefault(__webpack_require__(3)); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var strSplit = ''.split; | ||
var isStringFn = _hasBoxedStringX.default === false && typeof strSplit === 'function' && _isString.default; | ||
/** | ||
* This method tests if a value is a string with the boxed bug; splits to an | ||
* array for iteration; otherwise returns the original value. | ||
* | ||
* @param {*} value - The value to be tested. | ||
* @returns {*} An array or characters if value was a string with the boxed bug; | ||
* otherwise the value. | ||
*/ | ||
function splitIfBoxedBug(value) { | ||
return isStringFn && isStringFn(value) ? strSplit.call(value, '') : value; | ||
} | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
/** | ||
* @file Check support of by-index access of string characters. | ||
* @version 1.1.1 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
* @copyright Xotic750 | ||
* @license {@link <https://opensource.org/licenses/MIT> MIT} | ||
* @module has-boxed-string-x | ||
*/ | ||
__webpack_require__.r(__webpack_exports__); | ||
var boxedString = __webpack_require__(2).Object('a'); | ||
// CONCATENATED MODULE: ./node_modules/has-boxed-string-x/dist/has-boxed-string-x.esm.js | ||
var string = 'a'; | ||
var boxedString = {}.constructor(string); | ||
/** | ||
@@ -186,66 +173,33 @@ * Check failure of by-index access of string characters (IE < 9) | ||
*/ | ||
module.exports = boxedString[0] === 'a' && (0 in boxedString); | ||
var hasBoxed = boxedString[0] === string && 0 in boxedString; | ||
/* harmony default export */ var has_boxed_string_x_esm = (hasBoxed); | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/** | ||
* @file Constructors cached from literals. | ||
* @version 1.0.2 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
* @copyright Xotic750 | ||
* @license {@link <https://opensource.org/licenses/MIT> MIT} | ||
* @module cached-constructors-x | ||
*/ | ||
// EXTERNAL MODULE: ./node_modules/is-string/index.js | ||
var is_string = __webpack_require__(0); | ||
var is_string_default = /*#__PURE__*/__webpack_require__.n(is_string); | ||
// CONCATENATED MODULE: ./dist/split-if-boxed-bug-x.esm.js | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return splitIfBoxedBug; }); | ||
var EMPTY_STRING = ''; | ||
var strSplit = EMPTY_STRING.split; | ||
var isStringFn = has_boxed_string_x_esm === false && typeof strSplit === 'function' && is_string_default.a; | ||
/** | ||
* Constructors cached from literals. | ||
* This method tests if a value is a string with the boxed bug; splits to an | ||
* array for iteration; otherwise returns the original value. | ||
* | ||
* @type Object | ||
* @example | ||
* var constructors = require('cached-constructors-x'); | ||
* @param {*} [value] - The value to be tested. | ||
* @returns {*} An array or characters if value was a string with the boxed bug; | ||
* otherwise the value. | ||
*/ | ||
module.exports = { | ||
Array: [].constructor, | ||
Boolean: true.constructor, | ||
Function: function () {}.constructor, | ||
Number: (0).constructor, | ||
Object: {}.constructor, | ||
RegExp: (/(?:)/).constructor, | ||
String: ''.constructor | ||
}; | ||
function splitIfBoxedBug(value) { | ||
return isStringFn && isStringFn(value) ? strSplit.call(value, EMPTY_STRING) : value; | ||
} | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var strValue = String.prototype.valueOf; | ||
var tryStringObject = function tryStringObject(value) { | ||
try { | ||
strValue.call(value); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
var toStr = Object.prototype.toString; | ||
var strClass = '[object String]'; | ||
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; | ||
module.exports = function isString(value) { | ||
if (typeof value === 'string') { return true; } | ||
if (typeof value !== 'object') { return false; } | ||
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; | ||
}; | ||
/***/ }) | ||
@@ -252,0 +206,0 @@ /******/ ]); |
/*! | ||
{ | ||
"author": "Graham Fairweather", | ||
"copywrite": "Copyright (c) 2017-present", | ||
"date": "2019-07-10T18:53:00.430Z", | ||
"date": "2019-07-12T13:52:24.384Z", | ||
"describe": "", | ||
"description": "Tests if a value is a string with the boxed bug; splits to an array.", | ||
"file": "split-if-boxed-bug-x.min.js", | ||
"hash": "55cad5c857418d677762", | ||
"hash": "6c22bb92f0a53890fea6", | ||
"license": "MIT", | ||
"version": "2.0.0" | ||
"version": "2.0.1" | ||
} | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.splitIfBoxedBugX=e():t.splitIfBoxedBugX=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 n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return f&&f(t)?c.call(t,""):t};var o=u(n(1)),r=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}var c="".split,f=!1===o.default&&"function"==typeof c&&r.default},function(t,e,n){"use strict"; | ||
/** | ||
* @file Check support of by-index access of string characters. | ||
* @version 1.1.1 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
* @copyright Xotic750 | ||
* @license {@link <https://opensource.org/licenses/MIT> MIT} | ||
* @module has-boxed-string-x | ||
*/var o=n(2).Object("a");t.exports="a"===o[0]&&0 in o},function(t,e,n){"use strict"; | ||
/** | ||
* @file Constructors cached from literals. | ||
* @version 1.0.2 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
* @copyright Xotic750 | ||
* @license {@link <https://opensource.org/licenses/MIT> MIT} | ||
* @module cached-constructors-x | ||
*/t.exports={Array:[].constructor,Boolean:(!0).constructor,Function:function(){}.constructor,Number:(0).constructor,Object:{}.constructor,RegExp:/(?:)/.constructor,String:"".constructor}},function(t,e,n){"use strict";var o=String.prototype.valueOf,r=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(u?function(t){try{return o.call(t),!0}catch(t){return!1}}(t):"[object String]"===r.call(t))}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.splitIfBoxedBugX=e():t.splitIfBoxedBugX=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 n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";var o=String.prototype.valueOf,r=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(u?function(t){try{return o.call(t),!0}catch(t){return!1}}(t):"[object String]"===r.call(t))}},function(t,e,n){"use strict";n.r(e);var o={}.constructor("a"),r="a"===o[0]&&0 in o,u=n(0),f=n.n(u);n.d(e,"default",function(){return p});var i="",c=i.split,l=!1===r&&"function"==typeof c&&f.a;function p(t){return l&&l(t)?c.call(t,i):t}}])}); | ||
//# sourceMappingURL=split-if-boxed-bug-x.min.js.map |
{ | ||
"name": "split-if-boxed-bug-x", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Tests if a value is a string with the boxed bug; splits to an array.", | ||
@@ -25,8 +25,8 @@ "homepage": "https://github.com/Xotic750/split-if-boxed-bug-x", | ||
], | ||
"browser": "dist/split-if-boxed-bug-x.min.js", | ||
"module": "src/split-if-boxed-bug-x.js", | ||
"module": "dist/split-if-boxed-bug-x.esm.js", | ||
"main": "dist/split-if-boxed-bug-x.js", | ||
"scripts": { | ||
"build:esm": "mkdirp dist && babel -s true --env-name esm src/split-if-boxed-bug-x.js -o dist/split-if-boxed-bug-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 --", | ||
@@ -55,3 +55,3 @@ "clean": "rimraf dist && npm run clean:coverage", | ||
"dependencies": { | ||
"has-boxed-string-x": "^1.1.1", | ||
"has-boxed-string-x": "^2.0.1", | ||
"is-string": "^1.0.4" | ||
@@ -62,2 +62,7 @@ }, | ||
"@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", | ||
@@ -67,10 +72,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", | ||
@@ -90,3 +97,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", | ||
@@ -102,10 +109,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", | ||
@@ -112,0 +125,0 @@ "typescript": "^3.5.3", |
import hasBoxed from 'has-boxed-string-x'; | ||
import isString from 'is-string'; | ||
const strSplit = ''.split; | ||
const EMPTY_STRING = ''; | ||
const strSplit = EMPTY_STRING.split; | ||
const isStringFn = hasBoxed === false && typeof strSplit === 'function' && isString; | ||
@@ -11,3 +12,3 @@ | ||
* | ||
* @param {*} value - The value to be tested. | ||
* @param {*} [value] - The value to be tested. | ||
* @returns {*} An array or characters if value was a string with the boxed bug; | ||
@@ -17,3 +18,3 @@ * otherwise the value. | ||
export default function splitIfBoxedBug(value) { | ||
return isStringFn && isStringFn(value) ? strSplit.call(value, '') : value; | ||
return isStringFn && isStringFn(value) ? strSplit.call(value, EMPTY_STRING) : value; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10
0
34251
66
235
+ Addedhas-boxed-string-x@2.1.1(transitive)
- Removedcached-constructors-x@1.0.2(transitive)
- Removedhas-boxed-string-x@1.1.1(transitive)
Updatedhas-boxed-string-x@^2.0.1