Commit 22d1c58
[Refactor] Remove
Remove the no-longer-necessary dependency on fs-access [1] and use the
built-in fs module's access function [2] instead. They are interchangeable
as 1) the former is a polyfill for the latter and 2) there are no recorded
breaking changes to the function signature in Node.js.
In particular, the fs.access documentation specifies only one changes in
the range of versions supported by licensee, which is irrelevant here
(namely that the type of error thrown for non-callback callbacks changed).
I decided to set the access mode to `R_OK` (from the default `F_OK`) as
the access check is performed in preparation for reading the file (line
100). Note that `F_OK` is the only mode supported by fs-access, hence the
absence of an access mode prior to this change.
Note that the fs-access package is deprecated and therefore, in contrast
to the built-in fs module, doesn't receive any updates anymore.
--
1. https://www.npmjs.com/package/fs-access
2. https://nodejs.org/docs/latest-v18.x/api/fs.html#fsaccesspath-mode-callback
3. https://github.com/jslicense/licensee.js/blob/9abd28fde91b5343a9b9322f6e5cb9547093febc/.github/workflows/ci.yml#L8fs-access; use fs.access
1 parent 801ed66 commit 22d1c58
2 files changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
0 commit comments