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

babel-plugin-search-and-replace

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-search-and-replace - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

tests/__snapshots__/index.spec.js.snap

8

lib/index.js

@@ -10,2 +10,10 @@ module.exports = () => {

state.opts.map(opt => {
if (
typeof opt.search === "object" &&
path.node.value.match(opt.search)
) {
path.node.value = path.node.value.replace(opt.search, opt.replace);
return;
}
if (path.node.value === opt.search) {

@@ -12,0 +20,0 @@ path.node.value = opt.replace;

6

package.json
{
"name": "babel-plugin-search-and-replace",
"version": "0.2.0",
"version": "0.3.0",
"main": "lib/index.js",

@@ -13,7 +13,5 @@ "repository": "https://github.com/the-smaug/babel-plugin-search-and-replace",

"devDependencies": {
"jest": "21.2.1"
},
"dependencies": {
"jest": "21.2.1",
"babel-core": "6.26.0"
}
}

@@ -18,8 +18,8 @@ # babel-plugin-search-and-replace

{
"search": "foo",
"replace": "bar",
},
{
"search": "searchedString",
"replace": "replacement"
},
{
"search": /myRegex/,
"replace": "replacement"
}

@@ -26,0 +26,0 @@ ]]]

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