Skip to content

Commit

Permalink
fix(replace): add missing types for new preventAssignment option (#813
Browse files Browse the repository at this point in the history
)

* fix(replace): add missing types for new `preventAssignment` option

closes #812

* chore: trigger ci
  • Loading branch information
danielroe committed Feb 22, 2021
1 parent fbcb8f2 commit 659ed59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/replace/test/types.ts
Expand Up @@ -16,6 +16,7 @@ const config: RollupOptions = {
include: 'config.js',
exclude: 'node_modules/**',
delimiters: ['<@', '@>'],
preventAssignment: true,
VERSION: '1.0.0',
ENVIRONMENT: JSON.stringify('development'),
__dirname: (id) => `'${dirname(id)}'`,
Expand Down
11 changes: 10 additions & 1 deletion packages/replace/types/index.d.ts
Expand Up @@ -8,7 +8,11 @@ export interface RollupReplaceOptions {
* All other options are treated as `string: replacement` replacers,
* or `string: (id) => replacement` functions.
*/
[str: string]: Replacement | RollupReplaceOptions['include'] | RollupReplaceOptions['values'];
[str: string]:
| Replacement
| RollupReplaceOptions['include']
| RollupReplaceOptions['values']
| RollupReplaceOptions['preventAssignment'];

/**
* A minimatch pattern, or array of patterns, of files that should be
Expand All @@ -24,6 +28,11 @@ export interface RollupReplaceOptions {
* of `foo`, supply delimiters
*/
delimiters?: [string, string];
/**
* Prevents replacing strings where they are followed by a single equals
* sign.
*/
preventAssignment?: boolean;
/**
* You can separate values to replace from other options.
*/
Expand Down

0 comments on commit 659ed59

Please sign in to comment.