trim-right-x
Advanced tools
Comparing version 4.1.0 to 4.1.1
import requireCoercibleToString from 'require-coercible-to-string-x'; | ||
import whiteSpace from 'white-space-x'; | ||
import methodize from 'simple-methodize-x'; | ||
var EMPTY_STRING = ''; | ||
var RegExpCtr = /none/.constructor; | ||
var reRight2018 = new RegExpCtr("[".concat(whiteSpace, "]+$")); | ||
var replace = EMPTY_STRING.replace; | ||
var reRight = new RegExpCtr("[".concat(whiteSpace, "]+$")); | ||
var methodizedReplace = methodize(EMPTY_STRING.replace); | ||
/** | ||
@@ -16,3 +17,3 @@ * This method removes whitespace from the end of a string. (ES2019). | ||
var trimEnd = function trimEnd(string) { | ||
return replace.call(requireCoercibleToString(string), reRight2018, EMPTY_STRING); | ||
return methodizedReplace(requireCoercibleToString(string), reRight, EMPTY_STRING); | ||
}; | ||
@@ -19,0 +20,0 @@ |
@@ -5,9 +5,9 @@ /*! | ||
"copywrite": "Copyright (c) 2017", | ||
"date": "2019-08-14T14:37:56.077Z", | ||
"date": "2019-08-20T19:08:30.996Z", | ||
"describe": "", | ||
"description": "This method removes whitespace from the end of a string.", | ||
"file": "trim-right-x.js", | ||
"hash": "b6e70a3a12b6ef56ab12", | ||
"hash": "3d472650f5ba312feb64", | ||
"license": "MIT", | ||
"version": "4.1.0" | ||
"version": "4.1.1" | ||
} | ||
@@ -153,3 +153,3 @@ */ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 4); | ||
/******/ return __webpack_require__(__webpack_require__.s = 5); | ||
/******/ }) | ||
@@ -165,3 +165,3 @@ /************************************************************************/ | ||
var toStr = Object.prototype.toString; | ||
var hasSymbols = __webpack_require__(1)(); | ||
var hasSymbols = __webpack_require__(2)(); | ||
@@ -205,6 +205,33 @@ if (hasSymbols) { | ||
"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; | ||
}; | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/* WEBPACK VAR INJECTION */(function(global) { | ||
var origSymbol = global.Symbol; | ||
var hasSymbolSham = __webpack_require__(3); | ||
var hasSymbolSham = __webpack_require__(4); | ||
@@ -220,6 +247,6 @@ module.exports = function hasNativeSymbols() { | ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(2))) | ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3))) | ||
/***/ }), | ||
/* 2 */ | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
@@ -250,3 +277,3 @@ | ||
/***/ }), | ||
/* 3 */ | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -300,3 +327,3 @@ | ||
/***/ }), | ||
/* 4 */ | ||
/* 5 */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -687,9 +714,9 @@ | ||
for (var i = 0; i < white_space_x_esm_length; i += 1) { | ||
if (list[i].es2016) { | ||
stringES2016 += list[i].string; | ||
for (var white_space_x_esm_i = 0; white_space_x_esm_i < white_space_x_esm_length; white_space_x_esm_i += 1) { | ||
if (list[white_space_x_esm_i].es2016) { | ||
stringES2016 += list[white_space_x_esm_i].string; | ||
} | ||
if (list[i].es2018) { | ||
stringES2018 += list[i].string; | ||
if (list[white_space_x_esm_i].es2018) { | ||
stringES2018 += list[white_space_x_esm_i].string; | ||
} | ||
@@ -703,9 +730,400 @@ } | ||
// CONCATENATED MODULE: ./node_modules/is-primitive-x/dist/is-primitive-x.esm.js | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
/** | ||
* Returns true if the value is a primitive. | ||
* | ||
* @param {*} [val] - The value to test. | ||
* @returns {boolean} True if a primitive, otherwise false.. | ||
*/ | ||
var isPrimitive = function isPrimitive(val) { | ||
return _typeof(val) === 'object' ? val === null : typeof val !== 'function'; | ||
}; | ||
/* harmony default export */ var is_primitive_x_esm = (isPrimitive); | ||
// EXTERNAL MODULE: ./node_modules/is-string/index.js | ||
var is_string = __webpack_require__(1); | ||
var is_string_default = /*#__PURE__*/__webpack_require__.n(is_string); | ||
// CONCATENATED MODULE: ./node_modules/has-boxed-string-x/dist/has-boxed-string-x.esm.js | ||
var has_boxed_string_x_esm_string = 'a'; | ||
var boxedString = {}.constructor(has_boxed_string_x_esm_string); | ||
/** | ||
* Check failure of by-index access of string characters (IE < 9) | ||
* and failure of `0 in boxedString` (Rhino). | ||
* | ||
* `true` if no failure; otherwise `false`. | ||
* | ||
* @type boolean | ||
*/ | ||
var hasBoxed = boxedString[0] === has_boxed_string_x_esm_string && 0 in boxedString; | ||
/* harmony default export */ var has_boxed_string_x_esm = (hasBoxed); | ||
// CONCATENATED MODULE: ./node_modules/noop-x/dist/noop-x.esm.js | ||
/** | ||
* This method returns undefined. | ||
* | ||
* @returns {undefined} Always undefined. | ||
*/ | ||
var noop = function noop() {}; | ||
/* eslint-disable-line lodash/prefer-noop */ | ||
/* harmony default export */ var noop_x_esm = (noop); | ||
// CONCATENATED MODULE: ./node_modules/has-working-bind-x/dist/has-working-bind-x.esm.js | ||
var has_working_bind_x_esm_bind = noop_x_esm.bind; | ||
var test1 = function test1() { | ||
var a1 = null; | ||
var a2 = null; | ||
var context = null; | ||
var testThis = []; | ||
var test1Fn = function test1Fn(arg1, arg2) { | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
context = this; | ||
a1 = arg1; | ||
a2 = arg2; | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return arguments; | ||
}; | ||
try { | ||
var boundFn = has_working_bind_x_esm_bind.apply(test1Fn, [testThis, 1]); | ||
var args = boundFn(2); | ||
return boundFn.length === 1 && args.length === 2 && a1 === 1 && a2 === 2 && context === testThis; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
var test2 = function test2() { | ||
var a1 = null; | ||
var a2 = null; | ||
var context = null; | ||
var oracle = [1, 2, 3]; | ||
var Ctr = function Ctr(arg1, arg2) { | ||
a1 = arg1; | ||
a2 = arg2; | ||
context = this; | ||
return oracle; | ||
}; | ||
try { | ||
var BoundFn = has_working_bind_x_esm_bind.apply(Ctr, [null]); | ||
var returned = new BoundFn(1, 2); | ||
return BoundFn.length === Ctr.length && returned === oracle && a1 === 1 && a2 === 2 && context !== oracle; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
/** | ||
* Indicates if the engine has a working bind function. | ||
* | ||
* @type {boolean} | ||
*/ | ||
var isWorking = typeof has_working_bind_x_esm_bind === 'function' && test1() && test2(); | ||
/* harmony default export */ var has_working_bind_x_esm = (isWorking); | ||
// CONCATENATED MODULE: ./node_modules/util-pusher-x/dist/util-pusher-x.esm.js | ||
var EMPTY_STRING = ''; | ||
var split = EMPTY_STRING.split; | ||
var max = Math.max; | ||
var util_pusher_x_esm_bind = is_primitive_x_esm.bind, | ||
util_pusher_x_esm_call = is_primitive_x_esm.call; | ||
var stringSplit = function stringSplit(string, pattern) { | ||
// noinspection JSUnresolvedFunction | ||
return split.call(string, pattern); | ||
}; | ||
var $split = has_working_bind_x_esm ? util_pusher_x_esm_bind.call(util_pusher_x_esm_call, split) : stringSplit; | ||
var util_pusher_x_esm_getIterable = function getIterable(arrayLike) { | ||
// noinspection JSUnresolvedFunction | ||
return is_string_default()(arrayLike) ? $split(arrayLike, EMPTY_STRING) : arrayLike; | ||
}; // eslint-disable jsdoc/no-undefined-types | ||
// noinspection JSCommentMatchesSignature | ||
/** | ||
* This pushes or concatenates into a new or existing array. | ||
* | ||
* @param {Array} arrayLike - The source. | ||
* @param {number} [from=0] - The from source index. | ||
* @param {Array} [target=[]] - The target array. | ||
* @returns {*} The target array. | ||
*/ | ||
// eslint-enable jsdoc/no-undefined-types | ||
var util_pusher_x_esm_pusher = function pusher(arrayLike, from) { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
var target = arguments.length > 2 ? arguments[2] : []; | ||
if (typeof arrayLike !== 'string' && is_primitive_x_esm(arrayLike)) { | ||
return target; | ||
} | ||
var iterable = has_boxed_string_x_esm ? arrayLike : util_pusher_x_esm_getIterable(arrayLike); | ||
var length = iterable.length; | ||
for (var i = max(0, from) || 0; i < length; i += 1) { | ||
target[target.length] = arrayLike[i]; | ||
} | ||
return target; | ||
}; | ||
/* harmony default export */ var util_pusher_x_esm = (util_pusher_x_esm_pusher); | ||
// CONCATENATED MODULE: ./node_modules/simple-bind-x/dist/simple-bind-x.esm.js | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var nativeBind = util_pusher_x_esm.bind, | ||
simple_bind_x_esm_call = util_pusher_x_esm.call; | ||
var simple_bind_x_esm_ERROR_MESSAGE = 'bind called on incompatible '; | ||
var object = {}; | ||
var ObjectCtr = object.constructor; | ||
var toStringTag = object.toString; | ||
var funcType = '[object Function]'; | ||
var ZERO = 0; | ||
var argsOffset = 2; | ||
var getMax = function getMax(a, b) { | ||
return a >= b ? a : b; | ||
}; | ||
var simple_bind_x_esm_assertIsFunction = function assertIsFunction(value) { | ||
if (typeof value !== 'function' && toStringTag.apply(value) !== funcType) { | ||
throw new TypeError(simple_bind_x_esm_ERROR_MESSAGE + value); | ||
} | ||
}; | ||
var boundFns = [function zero(binder) { | ||
return function boundFn() { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments)); | ||
}; | ||
}, function one(binder, boundLength) { | ||
return function boundFn(a) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a])); | ||
}; | ||
}, function two(binder, boundLength) { | ||
return function boundFn(a, b) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b])); | ||
}; | ||
}, function three(binder, boundLength) { | ||
/* eslint-disable-next-line max-params */ | ||
return function boundFn(a, b, c) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c])); | ||
}; | ||
}, function four(binder, boundLength) { | ||
/* eslint-disable-next-line max-params */ | ||
return function boundFn(a, b, c, d) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d])); | ||
}; | ||
}, function five(binder, boundLength) { | ||
/* eslint-disable-next-line max-params */ | ||
return function boundFn(a, b, c, d, e) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e])); | ||
}; | ||
}, function six(binder, boundLength) { | ||
/* eslint-disable-next-line max-params */ | ||
return function boundFn(a, b, c, d, e, f) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e, f])); | ||
}; | ||
}, function seven(binder, boundLength) { | ||
/* eslint-disable-next-line max-params */ | ||
return function boundFn(a, b, c, d, e, f, g) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e, f, g])); | ||
}; | ||
}, function eight(binder, boundLength) { | ||
/* eslint-disable-next-line max-params */ | ||
return function boundFn(a, b, c, d, e, f, g, h) { | ||
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */ | ||
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e, f, g, h])); | ||
}; | ||
}]; | ||
var getBoundFn = function getBoundFn(args) { | ||
var _args = _slicedToArray(args, 3), | ||
binder = _args[0], | ||
target = _args[1], | ||
bindArgs = _args[2]; | ||
var boundLength = getMax(ZERO, target.length - getMax(ZERO, bindArgs.length - argsOffset)); | ||
var fn = boundFns[boundLength]; | ||
var boundFn = fn ? fn(binder, boundLength) : boundFns[ZERO](binder); | ||
if (target.prototype) { | ||
/* eslint-disable-next-line lodash/prefer-noop */ | ||
var Empty = function Empty() {}; | ||
Empty.prototype = target.prototype; | ||
boundFn.prototype = new Empty(); | ||
Empty.prototype = null; | ||
} | ||
return boundFn; | ||
}; | ||
var getResult = function getResult(target, boundArgs) { | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
var result = target.apply(this, boundArgs); | ||
/* eslint-disable-next-line babel/no-invalid-this,babel/new-cap */ | ||
return ObjectCtr(result) === result ? result : this; | ||
}; | ||
var implementation = function bind(target, thisArg) { | ||
simple_bind_x_esm_assertIsFunction(target); | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
var bindArgs = arguments; | ||
var bound; | ||
var binder = function binder() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
var boundArgs = util_pusher_x_esm(arguments, ZERO, util_pusher_x_esm(bindArgs, argsOffset)); | ||
/* eslint-disable-next-line babel/no-invalid-this */ | ||
return this instanceof bound ? getResult.apply(this, [target, boundArgs]) : target.apply(thisArg, boundArgs); | ||
}; | ||
bound = getBoundFn([binder, target, bindArgs]); | ||
return bound; | ||
}; | ||
/** | ||
* The bind() method creates a new function that, when called, has its this | ||
* keyword set to the provided value, with a given sequence of arguments | ||
* preceding any provided when the new function is called. | ||
* | ||
* @function bind | ||
* @param {Function} target - The target function. | ||
* @param {*} [thisArg] - The value to be passed as the this parameter to the target | ||
* function when the bound function is called. The value is ignored if the | ||
* bound function is constructed using the new operator. | ||
* @param {...*} [args] - Arguments to prepend to arguments provided to the bound | ||
* function when invoking the target function. | ||
* @throws {TypeError} If target is not a function. | ||
* @returns {Function} The bound function. | ||
*/ | ||
var $bind = has_working_bind_x_esm ? simple_bind_x_esm_call.bind(nativeBind) : implementation; | ||
/* harmony default export */ var simple_bind_x_esm = ($bind); | ||
// CONCATENATED MODULE: ./node_modules/simple-call-x/dist/simple-call-x.esm.js | ||
var $TypeError = TypeError; | ||
var nativeApply = simple_bind_x_esm.apply, | ||
nativeCall = simple_bind_x_esm.call; | ||
var $apply = simple_bind_x_esm(nativeCall, nativeApply); | ||
var simple_call_x_esm_toStringTag = simple_bind_x_esm(nativeApply, {}.toString); | ||
var simple_call_x_esm_ERROR_MESSAGE = ' is not a function'; | ||
var simple_call_x_esm_funcType = '[object Function]'; | ||
var simple_call_x_esm_assertIsFunction = function assertIsFunction(value) { | ||
if (typeof value !== 'function' && simple_call_x_esm_toStringTag(value) !== simple_call_x_esm_funcType) { | ||
throw new $TypeError(value + simple_call_x_esm_ERROR_MESSAGE); | ||
} | ||
return value; | ||
}; // eslint-disable jsdoc/check-param-names | ||
// noinspection JSCommentMatchesSignature | ||
/** | ||
* The abstract operation Call is used to call the [[Call]] internal method of a function object. | ||
* | ||
* @function call | ||
* @param {Function} F - The target function. | ||
* @param {*} [V] - The context. | ||
* @param {Array} [args] - Argument to call the function with. | ||
* @throws {TypeError} If target is not a function. | ||
* @returns {*} The the result of invoking the function. | ||
* @see https://www.ecma-international.org/ecma-262/6.0/#sec-call | ||
*/ | ||
// eslint-enable jsdoc/check-param-names | ||
var simple_call_x_esm_call = function call(F, V) { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return $apply(simple_call_x_esm_assertIsFunction(F), V, util_pusher_x_esm(arguments[2])); | ||
}; | ||
/* harmony default export */ var simple_call_x_esm = (simple_call_x_esm_call); | ||
// CONCATENATED MODULE: ./node_modules/simple-methodize-x/dist/simple-methodize-x.esm.js | ||
var simple_methodize_x_esm_toStringTag = {}.toString; | ||
var simple_methodize_x_esm_ERROR_MESSAGE = 'methodize called on incompatible '; | ||
var simple_methodize_x_esm_funcType = '[object Function]'; | ||
var simple_methodize_x_esm_assertIsFunction = function assertIsFunction(value) { | ||
if (typeof value !== 'function' && simple_call_x_esm(simple_methodize_x_esm_toStringTag, value) !== simple_methodize_x_esm_funcType) { | ||
throw new TypeError(simple_methodize_x_esm_ERROR_MESSAGE + value); | ||
} | ||
return value; | ||
}; | ||
/** | ||
* Methodize a prototype method. Compliant to 8 arguments. | ||
* | ||
* @param {Function} prototypeMethod - The prototype method to methodize. | ||
* @throws {TypeError} If target is not a function. | ||
* @returns {Function} The static method. | ||
*/ | ||
var simple_methodize_x_esm_methodize = function methodize(prototypeMethod) { | ||
simple_methodize_x_esm_assertIsFunction(prototypeMethod); | ||
return function methodized() { | ||
/* eslint-disable-next-line prefer-rest-params */ | ||
return simple_call_x_esm(prototypeMethod, arguments[0], util_pusher_x_esm(arguments, 1)); | ||
}; | ||
}; | ||
/* harmony default export */ var simple_methodize_x_esm = (simple_methodize_x_esm_methodize); | ||
// CONCATENATED MODULE: ./dist/trim-right-x.esm.js | ||
var EMPTY_STRING = ''; | ||
var trim_right_x_esm_EMPTY_STRING = ''; | ||
var RegExpCtr = /none/.constructor; | ||
var reRight2018 = new RegExpCtr("[".concat(white_space_x_esm, "]+$")); | ||
var replace = EMPTY_STRING.replace; | ||
var reRight = new RegExpCtr("[".concat(white_space_x_esm, "]+$")); | ||
var methodizedReplace = simple_methodize_x_esm(trim_right_x_esm_EMPTY_STRING.replace); | ||
/** | ||
@@ -720,3 +1138,3 @@ * This method removes whitespace from the end of a string. (ES2019). | ||
var trim_right_x_esm_trimEnd = function trimEnd(string) { | ||
return replace.call(require_coercible_to_string_x_esm(string), reRight2018, EMPTY_STRING); | ||
return methodizedReplace(require_coercible_to_string_x_esm(string), reRight, trim_right_x_esm_EMPTY_STRING); | ||
}; | ||
@@ -723,0 +1141,0 @@ |
@@ -5,12 +5,12 @@ /*! | ||
"copywrite": "Copyright (c) 2017", | ||
"date": "2019-08-14T14:37:56.077Z", | ||
"date": "2019-08-20T19:08:30.996Z", | ||
"describe": "", | ||
"description": "This method removes whitespace from the end of a string.", | ||
"file": "trim-right-x.min.js", | ||
"hash": "69210ce9217cefa433fb", | ||
"hash": "4e65c8feb6d839909300", | ||
"license": "MIT", | ||
"version": "4.1.0" | ||
"version": "4.1.1" | ||
} | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.trimRightX=t():e.trimRightX=t()}(function(){"use strict";var e,t={}.constructor,r=t.prototype,s=t.defineProperty,n=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},o=function(){return this};try{return s?s(r,"$$globalThis$$",{get:o,configurable:!0}):r.__defineGetter__("$$globalThis$$",o),e="undefined"==typeof $$globalThis$$?n():$$globalThis$$,delete r.$$globalThis$$,e}catch(e){return n()}}(),function(){return function(e){var t={};function r(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(s,n,function(t){return e[t]}.bind(null,n));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";var s=Object.prototype.toString;if(r(1)()){var n=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==s.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&o.test(n.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,r){"use strict";(function(t){var s=t.Symbol,n=r(3);e.exports=function(){return"function"==typeof s&&("function"==typeof Symbol&&("symbol"==typeof s("foo")&&("symbol"==typeof Symbol("bar")&&n())))}}).call(this,r(2))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var s=Object.getOwnPropertySymbols(e);if(1!==s.length||s[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},function(e,t,r){"use strict";r.r(t);for(var s=function(e){return null==e},n=function(e){if(s(e))throw new TypeError("Cannot call method on ".concat(e));return e},o=r(0),i=r.n(o),c="Cannot convert a Symbol value to a string",u=c.constructor,p=function(e){if(i()(e))throw new TypeError(c);return u(e)},f=function(e){return p(n(e))},a=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],d="",l=a.length,y=0;y<l;y+=1)a[y].es2016&&a[y].string,a[y].es2018&&(d+=a[y].string);var b=new(0,/none/.constructor)("[".concat(d,"]+$")),g="".replace;t.default=function(e){return g.call(f(e),b,"")}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.trimRightX=t():e.trimRightX=t()}(function(){"use strict";var e,t={}.constructor,n=t.prototype,r=t.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return r?r(n,"$$globalThis$$",{get:i,configurable:!0}):n.__defineGetter__("$$globalThis$$",i),e="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete n.$$globalThis$$,e}catch(e){return o()}}(),function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(2)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";(function(t){var r=t.Symbol,o=n(4);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";n.r(t);for(var r=function(e){return null==e},o=function(e){if(r(e))throw new TypeError("Cannot call method on ".concat(e));return e},i=n(0),s=n.n(i),c="Cannot convert a Symbol value to a string",u=c.constructor,f=function(e){if(s()(e))throw new TypeError(c);return u(e)},p=function(e){return f(o(e))},l=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],a="",y=l.length,d=0;d<y;d+=1)l[d].es2016&&l[d].string,l[d].es2018&&(a+=l[d].string);var b=a;function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var h=function(e){return"object"===g(e)?null===e:"function"!=typeof e},m=n(1),v=n.n(m),S={}.constructor("a"),j="a"===S[0]&&0 in S,w=function(){}.bind,O="function"==typeof w&&function(){var e=null,t=null,n=null,r=[];try{var o=w.apply(function(r,o){return n=this,e=r,t=o,arguments},[r,1]),i=o(2);return 1===o.length&&2===i.length&&1===e&&2===t&&n===r}catch(e){return!1}}()&&function(){var e=null,t=null,n=null,r=[1,2,3],o=function(o,i){return e=o,t=i,n=this,r};try{var i=w.apply(o,[null]),s=new i(1,2);return i.length===o.length&&s===r&&1===e&&2===t&&n!==r}catch(e){return!1}}(),$="".split,x=Math.max,T=h.bind,P=h.call,E=O?T.call(P,$):function(e,t){return $.call(e,t)},_=function(e){return v()(e)?E(e,""):e},F=function(e,t){var n=arguments.length>2?arguments[2]:[];if("string"!=typeof e&&h(e))return n;for(var r=j?e:_(e),o=r.length,i=x(0,t)||0;i<o;i+=1)n[n.length]=e[i];return n};function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,c=e[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var k=F.bind,N=F.call,C={},I=C.constructor,R=C.toString,q=function(e,t){return e>=t?e:t},A=function(e){if("function"!=typeof e&&"[object Function]"!==R.apply(e))throw new TypeError("bind called on incompatible "+e)},D=[function(e){return function(){return e.apply(this,F(arguments))}},function(e,t){return function(n){return e.apply(this,F(arguments,t,[n]))}},function(e,t){return function(n,r){return e.apply(this,F(arguments,t,[n,r]))}},function(e,t){return function(n,r,o){return e.apply(this,F(arguments,t,[n,r,o]))}},function(e,t){return function(n,r,o,i){return e.apply(this,F(arguments,t,[n,r,o,i]))}},function(e,t){return function(n,r,o,i,s){return e.apply(this,F(arguments,t,[n,r,o,i,s]))}},function(e,t){return function(n,r,o,i,s,c){return e.apply(this,F(arguments,t,[n,r,o,i,s,c]))}},function(e,t){return function(n,r,o,i,s,c,u){return e.apply(this,F(arguments,t,[n,r,o,i,s,c,u]))}},function(e,t){return function(n,r,o,i,s,c,u,f){return e.apply(this,F(arguments,t,[n,r,o,i,s,c,u,f]))}}],L=function(e){var t=M(e,3),n=t[0],r=t[1],o=t[2],i=q(0,r.length-q(0,o.length-2)),s=D[i],c=s?s(n,i):D[0](n);if(r.prototype){var u=function(){};u.prototype=r.prototype,c.prototype=new u,u.prototype=null}return c},X=function(e,t){var n=e.apply(this,t);return I(n)===n?n:this},z=O?N.bind(k):function(e,t){A(e);var n,r=arguments,o=function(){var o=F(arguments,0,F(r,2));return this instanceof n?X.apply(this,[e,o]):e.apply(t,o)};return n=L([o,e,r])},B=TypeError,G=z.apply,H=z(z.call,G),V=z(G,{}.toString),J=function(e){if("function"!=typeof e&&"[object Function]"!==V(e))throw new B(e+" is not a function");return e},K=function(e,t){return H(J(e),t,F(arguments[2]))},Q={}.toString,U=function(e){return function(e){if("function"!=typeof e&&"[object Function]"!==K(Q,e))throw new TypeError("methodize called on incompatible "+e)}(e),function(){return K(e,arguments[0],F(arguments,1))}},W=new(0,/none/.constructor)("[".concat(b,"]+$")),Y=U("".replace);t.default=function(e){return Y(p(e),W,"")}}])}); | ||
//# sourceMappingURL=trim-right-x.min.js.map |
{ | ||
"name": "trim-right-x", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "This method removes whitespace from the end of a string.", | ||
@@ -55,2 +55,3 @@ "homepage": "https://github.com/Xotic750/trim-right-x", | ||
"dependencies": { | ||
"simple-methodize-x": "^1.0.3", | ||
"require-coercible-to-string-x": "^2.1.0", | ||
@@ -67,6 +68,6 @@ "white-space-x": "^4.1.0" | ||
"@babel/runtime": "^7.5.5", | ||
"@types/jest": "^24.0.17", | ||
"@types/node": "^12.7.1", | ||
"@types/webpack": "^4.32.1", | ||
"@xotic750/eslint-config-recommended": "^1.1.2", | ||
"@types/jest": "^24.0.18", | ||
"@types/node": "^12.7.2", | ||
"@types/webpack": "^4.39.0", | ||
"@xotic750/eslint-config-recommended": "^1.1.5", | ||
"babel-core": "^7.0.0-0", | ||
@@ -79,3 +80,3 @@ "babel-eslint": "^10.0.2", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^6.1.0", | ||
"eslint": "^6.2.1", | ||
"eslint-friendly-formatter": "^4.0.1", | ||
@@ -91,3 +92,3 @@ "eslint-import-resolver-webpack": "^0.11.1", | ||
"eslint-plugin-jest": "^22.15.1", | ||
"eslint-plugin-jsdoc": "^15.8.0", | ||
"eslint-plugin-jsdoc": "^15.8.3", | ||
"eslint-plugin-json": "^1.4.0", | ||
@@ -101,4 +102,4 @@ "eslint-plugin-lodash": "^6.0.0", | ||
"eslint-plugin-switch-case": "^1.1.2", | ||
"jest": "^24.8.0", | ||
"jest-cli": "^24.8.0", | ||
"jest": "^24.9.0", | ||
"jest-cli": "^24.9.0", | ||
"jest-file": "^1.0.0", | ||
@@ -110,3 +111,3 @@ "lodash": "^4.17.15", | ||
"prettier": "^1.18.2", | ||
"rimraf": "^2.6.3", | ||
"rimraf": "^3.0.0", | ||
"source-map-loader": "^0.2.4", | ||
@@ -116,5 +117,5 @@ "strip-ansi": "^5.2.0", | ||
"typescript": "^3.5.3", | ||
"webpack": "^4.39.1", | ||
"webpack": "^4.39.2", | ||
"webpack-bundle-analyzer": "^3.4.1", | ||
"webpack-cli": "^3.3.6", | ||
"webpack-cli": "^3.3.7", | ||
"webpack-global-object-x": "^1.0.0", | ||
@@ -121,0 +122,0 @@ "webpack-merge": "^4.2.1" |
import requireCoercibleToString from 'require-coercible-to-string-x'; | ||
import whiteSpace from 'white-space-x'; | ||
import methodize from 'simple-methodize-x'; | ||
const EMPTY_STRING = ''; | ||
const RegExpCtr = /none/.constructor; | ||
const reRight2018 = new RegExpCtr(`[${whiteSpace}]+$`); | ||
const {replace} = EMPTY_STRING; | ||
const reRight = new RegExpCtr(`[${whiteSpace}]+$`); | ||
const methodizedReplace = methodize(EMPTY_STRING.replace); | ||
@@ -17,5 +18,5 @@ /** | ||
const trimEnd = function trimEnd(string) { | ||
return replace.call(requireCoercibleToString(string), reRight2018, EMPTY_STRING); | ||
return methodizedReplace(requireCoercibleToString(string), reRight, EMPTY_STRING); | ||
}; | ||
export default trimEnd; |
Sorry, the diff of this file is not supported yet
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
145634
1062
3
+ Addedsimple-methodize-x@^1.0.3
+ Addedhas-boxed-string-x@2.1.1(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhas-working-bind-x@1.0.1(transitive)
+ Addedis-primitive-x@1.0.1(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addednoop-x@1.2.1(transitive)
+ Addedsimple-bind-x@1.0.3(transitive)
+ Addedsimple-call-x@1.0.3(transitive)
+ Addedsimple-methodize-x@1.0.4(transitive)
+ Addedutil-pusher-x@1.0.3(transitive)