replace-last
Advanced tools
Comparing version 1.0.25 to 1.0.26
{ | ||
"name": "replace-last", | ||
"version": "1.0.25", | ||
"version": "1.0.26", | ||
"description": "Replaces last match for pattern in string with replacement", | ||
@@ -5,0 +5,0 @@ "author": "Daniel Lewis BSc (Hons)", |
@@ -1,1 +0,1 @@ | ||
var replaceLast=function(){"use strict";var t=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},r=function(t,r,n){var e=t.lastIndexOf(r);return e<0?t:t.substring(0,e)+n+t.substring(e+r.length,t.length)},n=function(t,r,n){return r=new RegExp(r.source,"g"),t.replace(r,function(t,e,u){return 1===u.slice(e).match(r).length?n:t})};return function(e,u,i){var o=e;if("number"==typeof e&&(e=e.toString()),"number"==typeof u&&(u=u.toString()),"number"==typeof i&&(i=i.toString()),"string"!=typeof e)return o;if("string"!=typeof i)return o;var f;if("string"==typeof u)f=r(e,u,i);else{if(!t(u))return o;f=n(e,u,i)}return f===e?o:f}}(); | ||
var replaceLast=function(){"use strict";return function(t,r,n){var e=t;if("number"==typeof t&&(t=t.toString()),"number"==typeof r&&(r=r.toString()),"number"==typeof n&&(n=n.toString()),"string"!=typeof t)return e;if("string"!=typeof n)return e;var u;if("string"==typeof r)u=function(t,r,n){var e=t.lastIndexOf(r);return e<0?t:t.substring(0,e)+n+t.substring(e+r.length,t.length)}(t,r,n);else{if(!function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(r))return e;u=function(t,r,n){return r=new RegExp(r.source,"g"),t.replace(r,function(t,e,u){return 1===u.slice(e).match(r).length?n:t})}(t,r,n)}return u===t?e:u}}(); |
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
9418