Skip to content

Commit

Permalink
feat: [Reader] nilable file support
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Jun 22, 2024
1 parent c4f6fc4 commit 1a8faa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ relative to the given point.
**Note**: This is an abstract class and must be extended.
- `file` ([`Value`][vfile-value] | [`VFile`][vfile-api]) &mdash; file to read
- `file` ([`Value`][vfile-value] | [`VFile`][vfile-api] | `null` | `undefined`) &mdash; file to read
- `start` ([`Point`][point] | `null` | `undefined`) &mdash; point before first reader value
#### <small>Type Parameters</small>
Expand Down
6 changes: 3 additions & 3 deletions src/abstract.reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ abstract class Reader<
* @see {@linkcode VFile}
* @see {@linkcode Value}
*
* @param {Value | VFile} file - File to read
* @param {(Value | VFile | null)?} file - File to read
* @param {(Point | null)?} [start] - Point before first reader value
*/
constructor(file: Value | VFile, start?: Point | null) {
super(file, start)
constructor(file?: Value | VFile | null, start?: Point | null) {
super(file ??= '', start)

this.#position = null
this.source = String(file)
Expand Down

0 comments on commit 1a8faa0

Please sign in to comment.