Skip to content

Commit

Permalink
Fix readme interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 20, 2023
1 parent 3a9274e commit 09f486d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ interface CreateReaderOptions<T> {
// Callback to parse a file content into an object
parse?(content: Uint8Array | string, filename: string): MaybePromise<T>;
// Called on error
catch?(error: unknown): MaybePromise<void>;
// Called when the last document is read
finally?(): MaybePromise<void>;
onError?(error: unknown): MaybePromise<void>;
}

interface CreateWriterOptions<T> {
Expand All @@ -145,9 +143,7 @@ interface CreateWriterOptions<T> {
// Callback that retrieves the filename (URL) of a page
name?(data: T): MaybePromise<string>;
// Called on error
catch?(error: unknown): MaybePromise<void>;
// Called when the last document is read
finally?(): MaybePromise<void>;
onError?(error: unknown): MaybePromise<void>;
}

interface Backend {
Expand Down Expand Up @@ -184,12 +180,12 @@ If a `from` or `to` parameter is a plain object in both defaults and later at th
### `CreateReaderOptions` built-in default parameters when not provided
- `cwd`: `'.'`
- `parse`: `JSON.parse`
- `catch`: `(err) => { throw err; }`
- `onError`: `(err) => { throw err; }`
### `CreateWriterOptions` built-in default parameters when not provided
- `cwd`: `'.'`
- `name`: `(data) => data.url`
- `catch`: `(err) => { throw err; }`
- `onError`: `(err) => { throw err; }`
## Missing a feature?
Expand Down

0 comments on commit 09f486d

Please sign in to comment.