New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

string-replace-async

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-replace-async - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

19

index.js

@@ -44,5 +44,4 @@ 'use strict';

return prev.then(function (ret) {
return assignReplacement(match, replacer).then(function (match) {
ret.push(match);
return ret;
return assignReplacement(match, replacer).then(function (res) {
return ret.concat([res]);
});

@@ -63,3 +62,3 @@ });

if (typeof replacer === 'string') {
return Promise.resolve(str.replace(re, replacer));
return str.replace(re, replacer);
}

@@ -79,10 +78,18 @@

function fn(str, re, replacer, seq) {
try {
return Promise.resolve(processString(str, re, replacer, seq));
} catch (e) {
return Promise.reject(e);
}
}
function stringReplaceAsync(str, re, replacer) {
return processString(str, re, replacer, false);
return fn(str, re, replacer, false);
}
stringReplaceAsync.seq = function (str, re, replacer) {
return processString(str, re, replacer, true);
return fn(str, re, replacer, true);
};
module.exports = stringReplaceAsync;
{
"name": "string-replace-async",
"version": "1.1.0",
"version": "1.2.0",
"description": "Asynchronous String.prototype.replace()",

@@ -5,0 +5,0 @@ "license": "MIT",

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