Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

replace-last

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replace-last - npm Package Compare versions

Comparing version 1.0.25 to 1.0.26

2

package.json
{
"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}}();
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc