split-if-boxed-bug-x
Advanced tools
Comparing version 1.0.0 to 1.1.0
11
index.js
/** | ||
* @file Tests if a value is a string with the boxed bug; splits to an array. | ||
* @version 1.0.0 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -12,8 +12,7 @@ * @copyright Xotic750 | ||
var splitString = require('has-boxed-string-x') === false; | ||
var strSplit; | ||
var isString; | ||
if (splitString) { | ||
strSplit = String.prototype.split; | ||
isString = require('is-string'); | ||
if (require('has-boxed-string-x') === false) { | ||
strSplit = ''.split; | ||
isString = typeof strSplit === 'function' && require('is-string'); | ||
} | ||
@@ -38,4 +37,4 @@ | ||
module.exports = function splitIfBoxedBug(value) { | ||
return splitString && isString(value) ? strSplit.call(value, '') : value; | ||
return isString && isString(value) ? strSplit.call(value, '') : value; | ||
}; | ||
(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){ | ||
/** | ||
* @file Tests if a value is a string with the boxed bug; splits to an array. | ||
* @version 1.0.0 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -13,8 +13,7 @@ * @copyright Xotic750 | ||
var splitString = _dereq_('has-boxed-string-x') === false; | ||
var strSplit; | ||
var isString; | ||
if (splitString) { | ||
strSplit = String.prototype.split; | ||
isString = _dereq_('is-string'); | ||
if (_dereq_('has-boxed-string-x') === false) { | ||
strSplit = ''.split; | ||
isString = typeof strSplit === 'function' && _dereq_('is-string'); | ||
} | ||
@@ -39,10 +38,38 @@ | ||
module.exports = function splitIfBoxedBug(value) { | ||
return splitString && isString(value) ? strSplit.call(value, '') : value; | ||
return isString && isString(value) ? strSplit.call(value, '') : value; | ||
}; | ||
},{"has-boxed-string-x":2,"is-string":3}],2:[function(_dereq_,module,exports){ | ||
},{"has-boxed-string-x":3,"is-string":4}],2:[function(_dereq_,module,exports){ | ||
/** | ||
* @file Constructors cached from literals. | ||
* @version 1.0.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
* @copyright Xotic750 | ||
* @license {@link <https://opensource.org/licenses/MIT> MIT} | ||
* @module cached-constructors-x | ||
*/ | ||
'use strict'; | ||
/** | ||
* Constructors cached from literals. | ||
* | ||
* @type Object | ||
* @example | ||
* var constructors = require('cached-constructors-x'); | ||
*/ | ||
module.exports = { | ||
Array: [].constructor, | ||
Boolean: true.constructor, | ||
Number: (0).constructor, | ||
Object: {}.constructor, | ||
RegExp: (/(?:)/).constructor, | ||
String: ''.constructor | ||
}; | ||
},{}],3:[function(_dereq_,module,exports){ | ||
/** | ||
* @file Check support of by-index access of string characters. | ||
* @version 1.0.1 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -56,3 +83,3 @@ * @copyright Xotic750 | ||
var boxedString = Object('a'); | ||
var boxedString = _dereq_('cached-constructors-x').Object('a'); | ||
@@ -69,3 +96,3 @@ /** | ||
},{}],3:[function(_dereq_,module,exports){ | ||
},{"cached-constructors-x":2}],4:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -72,0 +99,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 Tests if a value is a string with the boxed bug; splits to an array. | ||
* @version 1.0.0 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -9,5 +9,13 @@ * @copyright Xotic750 | ||
*/ | ||
"use strict";var strSplit,isString,splitString=!1===_dereq_("has-boxed-string-x");splitString&&(strSplit=String.prototype.split,isString=_dereq_("is-string")),module.exports=function splitIfBoxedBug(value){return splitString&&isString(value)?strSplit.call(value,""):value}},{"has-boxed-string-x":2,"is-string":3}],2:[function(_dereq_,module,exports){/** | ||
"use strict";var strSplit,isString;!1===_dereq_("has-boxed-string-x")&&(isString="function"==typeof(strSplit="".split)&&_dereq_("is-string")),module.exports=function splitIfBoxedBug(value){return isString&&isString(value)?strSplit.call(value,""):value}},{"has-boxed-string-x":3,"is-string":4}],2:[function(_dereq_,module,exports){/** | ||
* @file Constructors cached from literals. | ||
* @version 1.0.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
* @copyright Xotic750 | ||
* @license {@link <https://opensource.org/licenses/MIT> MIT} | ||
* @module cached-constructors-x | ||
*/ | ||
"use strict";module.exports={Array:[].constructor,Boolean:(!0).constructor,Number:(0).constructor,Object:{}.constructor,RegExp:/(?:)/.constructor,String:"".constructor}},{}],3:[function(_dereq_,module,exports){/** | ||
* @file Check support of by-index access of string characters. | ||
* @version 1.0.1 | ||
* @version 1.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -18,2 +26,2 @@ * @copyright Xotic750 | ||
*/ | ||
"use strict";var boxedString=Object("a");module.exports="a"===boxedString[0]&&0 in boxedString},{}],3:[function(_dereq_,module,exports){"use strict";var strValue=String.prototype.valueOf,tryStringObject=function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?tryStringObject(value):"[object String]"===toStr.call(value))}},{}]},{},[1])(1)}); | ||
"use strict";var boxedString=_dereq_("cached-constructors-x").Object("a");module.exports="a"===boxedString[0]&&0 in boxedString},{"cached-constructors-x":2}],4:[function(_dereq_,module,exports){"use strict";var strValue=String.prototype.valueOf,tryStringObject=function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?tryStringObject(value):"[object String]"===toStr.call(value))}},{}]},{},[1])(1)}); |
{ | ||
"name": "split-if-boxed-bug-x", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Tests if a value is a string with the boxed bug; splits to an array.", | ||
@@ -34,3 +34,3 @@ "homepage": "https://github.com/Xotic750/split-if-boxed-bug-x", | ||
"dependencies": { | ||
"has-boxed-string-x": "^1.0.1", | ||
"has-boxed-string-x": "^1.1.0", | ||
"is-string": "^1.0.4" | ||
@@ -37,0 +37,0 @@ }, |
@@ -26,3 +26,3 @@ <a href="https://travis-ci.org/Xotic750/split-if-boxed-bug-x" | ||
**Version**: 1.0.0 | ||
**Version**: 1.1.0 | ||
**Author**: Xotic750 <Xotic750@gmail.com> | ||
@@ -29,0 +29,0 @@ **License**: [MIT](<https://opensource.org/licenses/MIT>) |
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
20010
187
Updatedhas-boxed-string-x@^1.1.0