Socket
Socket
Sign inDemoInstall

replace-comments-x

Package Overview
Dependencies
16
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.1.1

5

dist/replace-comments-x.esm.js
import toStr from 'to-string-x';
import requireCoercibleToString from 'require-coercible-to-string-x';
import methodize from 'simple-methodize-x';
var EMPTY_STRING = '';
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
var replace = EMPTY_STRING.replace;
var methodizedReplace = methodize(EMPTY_STRING.replace);
/**

@@ -17,3 +18,3 @@ * This method replaces comments in a string.

var replaceComments = function replaceComments(string, replacement) {
return replace.call(requireCoercibleToString(string), STRIP_COMMENTS, arguments.length > 1 ? toStr(replacement) : EMPTY_STRING);
return methodizedReplace(requireCoercibleToString(string), STRIP_COMMENTS, arguments.length > 1 ? toStr(replacement) : EMPTY_STRING);
};

@@ -20,0 +21,0 @@

444

dist/replace-comments-x.js

@@ -5,9 +5,9 @@ /*!

"copywrite": "Copyright (c) 2017",
"date": "2019-08-14T14:43:59.882Z",
"date": "2019-08-20T19:15:02.932Z",
"describe": "",
"description": "Replace the comments in a string.",
"file": "replace-comments-x.js",
"hash": "43b2bd6bd496ca0e17a9",
"hash": "1d04b73538d5136e1783",
"license": "MIT",
"version": "3.1.0"
"version": "3.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__) {

@@ -389,8 +416,399 @@

// 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/replace-comments-x.esm.js
var EMPTY_STRING = '';
var replace_comments_x_esm_EMPTY_STRING = '';
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
var replace = EMPTY_STRING.replace;
var methodizedReplace = simple_methodize_x_esm(replace_comments_x_esm_EMPTY_STRING.replace);
/**

@@ -407,3 +825,3 @@ * This method replaces comments in a string.

var replace_comments_x_esm_replaceComments = function replaceComments(string, replacement) {
return replace.call(require_coercible_to_string_x_esm(string), STRIP_COMMENTS, arguments.length > 1 ? to_string_x_esm(replacement) : EMPTY_STRING);
return methodizedReplace(require_coercible_to_string_x_esm(string), STRIP_COMMENTS, arguments.length > 1 ? to_string_x_esm(replacement) : replace_comments_x_esm_EMPTY_STRING);
};

@@ -410,0 +828,0 @@

@@ -5,12 +5,12 @@ /*!

"copywrite": "Copyright (c) 2017",
"date": "2019-08-14T14:43:59.882Z",
"date": "2019-08-20T19:15:02.932Z",
"describe": "",
"description": "Replace the comments in a string.",
"file": "replace-comments-x.min.js",
"hash": "8c62a20661daec0311f4",
"hash": "a8c315ed0982bdf5d692",
"license": "MIT",
"version": "3.1.0"
"version": "3.1.1"
}
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.replaceCommentsX=e():t.replaceCommentsX=e()}(function(){"use strict";var t,e={}.constructor,r=e.prototype,n=e.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},u=function(){return this};try{return n?n(r,"$$globalThis$$",{get:u,configurable:!0}):r.__defineGetter__("$$globalThis$$",u),t="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete r.$$globalThis$$,t}catch(t){return o()}}(),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=4)}([function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1)()){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";(function(e){var n=e.Symbol,o=r(3);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,r(2))},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}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),u="Cannot convert a Symbol value to a string",i=u.constructor,f=function(t){if(o()(t))throw new TypeError(u);return i(t)},c=function(t){return null==t},l=function(t){if(c(t))throw new TypeError("Cannot call method on ".concat(t));return t},p=function(t){return f(l(t))},y=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,a="".replace;e.default=function(t,e){return a.call(p(t),y,arguments.length>1?f(e):"")}}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.replaceCommentsX=n():t.replaceCommentsX=n()}(function(){"use strict";var t,n={}.constructor,r=n.prototype,e=n.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},u=function(){return this};try{return e?e(r,"$$globalThis$$",{get:u,configurable:!0}):r.__defineGetter__("$$globalThis$$",u),t="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete r.$$globalThis$$,t}catch(t){return o()}}(),function(){return function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},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,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=5)}([function(t,n,r){"use strict";var e=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]"!==e.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,n,r){"use strict";var e=String.prototype.valueOf,o=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 e.call(t),!0}catch(t){return!1}}(t):"[object String]"===o.call(t))}},function(t,n,r){"use strict";(function(n){var e=n.Symbol,o=r(4);t.exports=function(){return"function"==typeof e&&("function"==typeof Symbol&&("symbol"==typeof e("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,r(3))},function(t,n){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,n,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={},n=Symbol("test"),r=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(n in t[n]=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 e=Object.getOwnPropertySymbols(t);if(1!==e.length||e[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,n);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,n,r){"use strict";r.r(n);var e=r(0),o=r.n(e),u="Cannot convert a Symbol value to a string",i=u.constructor,c=function(t){if(o()(t))throw new TypeError(u);return i(t)},f=function(t){return null==t},l=function(t){if(f(t))throw new TypeError("Cannot call method on ".concat(t));return t},p=function(t){return c(l(t))};function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=function(t){return"object"===y(t)?null===t:"function"!=typeof t},s=r(1),b=r.n(s),h={}.constructor("a"),m="a"===h[0]&&0 in h,d=function(){}.bind,g="function"==typeof d&&function(){var t=null,n=null,r=null,e=[];try{var o=d.apply(function(e,o){return r=this,t=e,n=o,arguments},[e,1]),u=o(2);return 1===o.length&&2===u.length&&1===t&&2===n&&r===e}catch(t){return!1}}()&&function(){var t=null,n=null,r=null,e=[1,2,3],o=function(o,u){return t=o,n=u,r=this,e};try{var u=d.apply(o,[null]),i=new u(1,2);return u.length===o.length&&i===e&&1===t&&2===n&&r!==e}catch(t){return!1}}(),v="".split,S=Math.max,j=a.bind,w=a.call,O=g?j.call(w,v):function(t,n){return v.call(t,n)},$=function(t){return b()(t)?O(t,""):t},x=function(t,n){var r=arguments.length>2?arguments[2]:[];if("string"!=typeof t&&a(t))return r;for(var e=m?t:$(t),o=e.length,u=S(0,n)||0;u<o;u+=1)r[r.length]=t[u];return r};function T(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var r=[],e=!0,o=!1,u=void 0;try{for(var i,c=t[Symbol.iterator]();!(e=(i=c.next()).done)&&(r.push(i.value),!n||r.length!==n);e=!0);}catch(t){o=!0,u=t}finally{try{e||null==c.return||c.return()}finally{if(o)throw u}}return r}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var P=x.bind,_=x.call,E={},M=E.constructor,C=E.toString,F=function(t,n){return t>=n?t:n},k=function(t){if("function"!=typeof t&&"[object Function]"!==C.apply(t))throw new TypeError("bind called on incompatible "+t)},A=[function(t){return function(){return t.apply(this,x(arguments))}},function(t,n){return function(r){return t.apply(this,x(arguments,n,[r]))}},function(t,n){return function(r,e){return t.apply(this,x(arguments,n,[r,e]))}},function(t,n){return function(r,e,o){return t.apply(this,x(arguments,n,[r,e,o]))}},function(t,n){return function(r,e,o,u){return t.apply(this,x(arguments,n,[r,e,o,u]))}},function(t,n){return function(r,e,o,u,i){return t.apply(this,x(arguments,n,[r,e,o,u,i]))}},function(t,n){return function(r,e,o,u,i,c){return t.apply(this,x(arguments,n,[r,e,o,u,i,c]))}},function(t,n){return function(r,e,o,u,i,c,f){return t.apply(this,x(arguments,n,[r,e,o,u,i,c,f]))}},function(t,n){return function(r,e,o,u,i,c,f,l){return t.apply(this,x(arguments,n,[r,e,o,u,i,c,f,l]))}}],D=function(t){var n=T(t,3),r=n[0],e=n[1],o=n[2],u=F(0,e.length-F(0,o.length-2)),i=A[u],c=i?i(r,u):A[0](r);if(e.prototype){var f=function(){};f.prototype=e.prototype,c.prototype=new f,f.prototype=null}return c},I=function(t,n){var r=t.apply(this,n);return M(r)===r?r:this},N=g?_.bind(P):function(t,n){k(t);var r,e=arguments,o=function(){var o=x(arguments,0,x(e,2));return this instanceof r?I.apply(this,[t,o]):t.apply(n,o)};return r=D([o,t,e])},X=TypeError,z=N.apply,G=N(N.call,z),q=N(z,{}.toString),B=function(t){if("function"!=typeof t&&"[object Function]"!==q(t))throw new X(t+" is not a function");return t},H=function(t,n){return G(B(t),n,x(arguments[2]))},J={}.toString,K=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,L=function(t){return function(t){if("function"!=typeof t&&"[object Function]"!==H(J,t))throw new TypeError("methodize called on incompatible "+t)}(t),function(){return H(t,arguments[0],x(arguments,1))}}("".replace);n.default=function(t,n){return L(p(t),K,arguments.length>1?c(n):"")}}])});
//# sourceMappingURL=replace-comments-x.min.js.map
{
"name": "replace-comments-x",
"version": "3.1.0",
"version": "3.1.1",
"description": "Replace the comments in a string.",

@@ -55,2 +55,3 @@ "homepage": "https://github.com/Xotic750/replace-comments-x",

"dependencies": {
"simple-methodize-x": "^1.0.3",
"require-coercible-to-string-x": "^2.1.0",

@@ -67,6 +68,6 @@ "to-string-x": "^2.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 toStr from 'to-string-x';
import requireCoercibleToString from 'require-coercible-to-string-x';
import methodize from 'simple-methodize-x';
const EMPTY_STRING = '';
const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
const {replace} = EMPTY_STRING;
const methodizedReplace = methodize(EMPTY_STRING.replace);

@@ -18,5 +19,9 @@ /**

const replaceComments = function replaceComments(string, replacement) {
return replace.call(requireCoercibleToString(string), STRIP_COMMENTS, arguments.length > 1 ? toStr(replacement) : EMPTY_STRING);
return methodizedReplace(
requireCoercibleToString(string),
STRIP_COMMENTS,
arguments.length > 1 ? toStr(replacement) : EMPTY_STRING,
);
};
export default replaceComments;

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc