Skip to content

Commit fc39fde

Browse files
committed
Fix gh-204: make file friendler for bad parsers
1 parent a124cce commit fc39fde

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.github/workflows/release.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
types: [created]
55
jobs:
66
release-js:
7-
name: 'jsbt v0.3.1' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/release.yml@c45f03360e0171b138f04568d2fdd35d7bbc0d35
7+
name: 'jsbt v0.3.3' # Should match commit below
8+
uses: paulmillr/jsbt/.github/workflows/release.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea
99
secrets:
1010
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1111
permissions:
1212
contents: write
1313
id-token: write
14+
attestations: write

.github/workflows/test-js.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ on:
44
- pull_request
55
jobs:
66
test-js:
7-
name: 'jsbt v0.3.1' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/test-js.yml@c45f03360e0171b138f04568d2fdd35d7bbc0d35
7+
name: 'jsbt v0.3.3' # Should match commit below
8+
uses: paulmillr/jsbt/.github/workflows/test-js.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea

index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ for await (const entry of readdirp('.')) {
1313
```
1414
*/
1515
/*! readdirp - MIT License (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) */
16-
import type { Stats, Dirent } from 'node:fs';
17-
import { stat, lstat, readdir, realpath } from 'node:fs/promises';
16+
import type { Dirent, Stats } from 'node:fs';
17+
import { lstat, readdir, realpath, stat } from 'node:fs/promises';
18+
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from 'node:path';
1819
import { Readable } from 'node:stream';
19-
import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from 'node:path';
2020

2121
// We can't use statSync, lstatSync, because some users may want to
2222
// use graceful-fs, which doesn't support sync methods.
@@ -156,7 +156,8 @@ export class ReaddirpStream extends Readable {
156156
this._stat = statMethod;
157157
}
158158

159-
this._maxDepth = opts.depth ?? defaultOptions.depth!;
159+
this._maxDepth =
160+
opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth!;
160161
this._wantsDir = type ? DIR_TYPES.has(type) : false;
161162
this._wantsFile = type ? FILE_TYPES.has(type) : false;
162163
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"test:coverage": "c8 node test/index.test.js"
5555
},
5656
"devDependencies": {
57-
"@paulmillr/jsbt": "0.3.1",
57+
"@paulmillr/jsbt": "0.3.3",
5858
"@types/node": "20.14.8",
5959
"c8": "10.1.3",
6060
"chai": "4.3.4",

0 commit comments

Comments
 (0)