Socket
Socket
Sign inDemoInstall

@rollup/plugin-replace

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-replace - npm Package Compare versions

Comparing version 2.4.2 to 3.0.0

10

CHANGELOG.md
# @rollup/plugin-replace ChangeLog
## v3.0.0
_2021-07-16_
### Breaking Changes
- fix
## v2.4.2

@@ -124,2 +132,2 @@

- First release
- First release

2

dist/rollup-plugin-replace.cjs.js

@@ -58,3 +58,3 @@ 'use strict';

)
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b" + lookahead), 'g');
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b(?!\\.)" + lookahead), 'g');

@@ -61,0 +61,0 @@ return {

@@ -52,3 +52,3 @@ import MagicString from 'magic-string';

)
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b" + lookahead), 'g');
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b(?!\\.)" + lookahead), 'g');

@@ -55,0 +55,0 @@ return {

{
"name": "@rollup/plugin-replace",
"version": "2.4.2",
"version": "3.0.0",
"publishConfig": {

@@ -9,3 +9,6 @@ "access": "public"

"license": "MIT",
"repository": "rollup/plugins",
"repository": {
"url": "rollup/plugins",
"directory": "packages/replace"
},
"author": "Rich Harris <richard.a.harris@gmail.com>",

@@ -18,14 +21,11 @@ "homepage": "https://github.com/rollup/plugins/tree/master/packages/replace#readme",

"build": "rollup -c",
"ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm run build && pnpm run lint",
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm run test -- --verbose && pnpm run test:ts",
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
"lint:js": "eslint --fix --cache src test types --ext .js,.ts",
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
"ci:test": "pnpm test -- --verbose && pnpm test:ts",
"prebuild": "del-cli dist",
"prepare": "pnpm run build",
"prepublishOnly": "pnpm run lint && pnpm run test",
"pretest": "pnpm run build",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name",
"test": "ava",

@@ -32,0 +32,0 @@ "test:ts": "tsc types/index.d.ts test/types.ts --noEmit"

@@ -64,6 +64,11 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-replace

Type: `Array[...String, String]`<br>
Default: `['\b', '\b']`
Default: `['\b', '\b(?!\.)']`
Specifies the boundaries around which strings will be replaced. By default, delimiters are [word boundaries](https://www.regular-expressions.info/wordboundaries.html). See [Word Boundaries](#word-boundaries) below for more information.
Specifies the boundaries around which strings will be replaced. By default, delimiters are [word boundaries](https://www.regular-expressions.info/wordboundaries.html) and also prevent replacements of instances with nested access. See [Word Boundaries](#word-boundaries) below for more information.
For example, if you pass `typeof window` in `values` to-be-replaced, then you could expect the following scenarios:
- `typeof window` **will** be replaced
- `typeof window.document` **will not** be replaced due to `(?!\.)` boundary
- `typeof windowSmth` **will not** be replaced due to a `\b` boundary
### `preventAssignment`

@@ -70,0 +75,0 @@

@@ -49,3 +49,3 @@ import MagicString from 'magic-string';

)
: new RegExp(`\\b(${keys.join('|')})\\b${lookahead}`, 'g');
: new RegExp(`\\b(${keys.join('|')})\\b(?!\\.)${lookahead}`, 'g');

@@ -52,0 +52,0 @@ return {

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