Skip to content

Commit 659ed59

Browse files
authored
fix(replace): add missing types for new preventAssignment option (#813)
* fix(replace): add missing types for new `preventAssignment` option closes #812 * chore: trigger ci
1 parent fbcb8f2 commit 659ed59

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/replace/test/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const config: RollupOptions = {
1616
include: 'config.js',
1717
exclude: 'node_modules/**',
1818
delimiters: ['<@', '@>'],
19+
preventAssignment: true,
1920
VERSION: '1.0.0',
2021
ENVIRONMENT: JSON.stringify('development'),
2122
__dirname: (id) => `'${dirname(id)}'`,

packages/replace/types/index.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ export interface RollupReplaceOptions {
88
* All other options are treated as `string: replacement` replacers,
99
* or `string: (id) => replacement` functions.
1010
*/
11-
[str: string]: Replacement | RollupReplaceOptions['include'] | RollupReplaceOptions['values'];
11+
[str: string]:
12+
| Replacement
13+
| RollupReplaceOptions['include']
14+
| RollupReplaceOptions['values']
15+
| RollupReplaceOptions['preventAssignment'];
1216

1317
/**
1418
* A minimatch pattern, or array of patterns, of files that should be
@@ -24,6 +28,11 @@ export interface RollupReplaceOptions {
2428
* of `foo`, supply delimiters
2529
*/
2630
delimiters?: [string, string];
31+
/**
32+
* Prevents replacing strings where they are followed by a single equals
33+
* sign.
34+
*/
35+
preventAssignment?: boolean;
2736
/**
2837
* You can separate values to replace from other options.
2938
*/

0 commit comments

Comments
 (0)