mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: add missing ReplaceInFileOptions to utils.d.ts type declaration
The replaceInFile function in utils.js accepts an optional `options`
parameter with `{ all?: boolean }` for replacing all occurrences, but
the .d.ts type declaration was missing this parameter entirely.
This commit is contained in:
parent
6f95dbe7ba
commit
7b94b51269
1 changed files with 9 additions and 1 deletions
10
scripts/lib/utils.d.ts
vendored
10
scripts/lib/utils.d.ts
vendored
|
|
@ -93,11 +93,19 @@ export function writeFile(filePath: string, content: string): void;
|
|||
/** Append to a text file, creating parent directories if needed */
|
||||
export function appendFile(filePath: string, content: string): void;
|
||||
|
||||
export interface ReplaceInFileOptions {
|
||||
/**
|
||||
* When true and search is a string, replaces ALL occurrences (uses String.replaceAll).
|
||||
* Ignored for RegExp patterns — use the `g` flag instead.
|
||||
*/
|
||||
all?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace text in a file (cross-platform sed alternative).
|
||||
* @returns true if the file was found and updated, false if file not found
|
||||
*/
|
||||
export function replaceInFile(filePath: string, search: string | RegExp, replace: string): boolean;
|
||||
export function replaceInFile(filePath: string, search: string | RegExp, replace: string, options?: ReplaceInFileOptions): boolean;
|
||||
|
||||
/**
|
||||
* Count occurrences of a pattern in a file.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue