Skip to content

Commit

Permalink
feat(file): withFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-cr committed May 22, 2023
1 parent 484612f commit 6371b8f
Show file tree
Hide file tree
Showing 12 changed files with 769 additions and 63 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ extends:
- '@comicrelief/eslint-config/mixins/jsdoc'

rules:
no-continue: off
'@typescript-eslint/no-non-null-assertion': off
'@typescript-eslint/no-explicit-any': off
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ await withYamlFile('example.yaml', (f) => {
});
```

### `withFiles(search: WithFilesOptions, callback: (f: Text) => void | Promise<void>): Promise<void>`

Work on text files that match the given search criteria.

```ts
// replace every occurrance of 'foo' with 'bar' in every JS file
await withFiles({
include: '**.js',
containing: 'foo',
}, (f) => {
f.replaceAll('foo', 'bar');
});
```

## Test helpers

### `sh.mock()`
Expand Down
Loading

0 comments on commit 6371b8f

Please sign in to comment.