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.3.0 to 1.0.0

2

lib/index.js

@@ -9,3 +9,3 @@ module.exports = () => {

state.opts.map(opt => {
state.opts.rules.map(opt => {
if (

@@ -12,0 +12,0 @@ typeof opt.search === "object" &&

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

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

"devDependencies": {
"jest": "21.2.1",
"babel-core": "6.26.0"
"@babel/core": "7.1.0",
"jest": "23.6.0"
}
}

@@ -16,2 +16,20 @@ # babel-plugin-search-and-replace

{
"plugins": [["search-and-replace", {
rules: [
{
"search": "searchedString",
"replace": "replacement"
},
{
"search": /myRegex/,
"replace": "replacement"
}
]
}]]
}
```
For Babel < 7 use babel-plugin-search-and-replace@0.3.0
```json
{
"plugins": [["search-and-replace", [

@@ -18,0 +36,0 @@ {

@@ -1,2 +0,2 @@

const babel = require("babel-core");
const babel = require("@babel/core");
const searchAndReplaceplugin = require("../lib/index");

@@ -26,8 +26,10 @@

searchAndReplaceplugin,
[
{
search: "foo",
replace: "bar"
}
]
{
rules: [
{
search: "foo",
replace: "bar"
}
]
}
]

@@ -44,12 +46,14 @@ ]

searchAndReplaceplugin,
[
{
search: "foo",
replace: "bar"
},
{
search: "hello",
replace: "hey"
}
]
{
rules: [
{
search: "foo",
replace: "bar"
},
{
search: "hello",
replace: "hey"
}
]
}
]

@@ -66,8 +70,10 @@ ]

searchAndReplaceplugin,
[
{
search: /el/,
replace: "aze"
}
]
{
rules: [
{
search: /el/,
replace: "aze"
}
]
}
]

@@ -74,0 +80,0 @@ ]

Sorry, the diff of this file is not supported yet

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