@yarnpkg/fslib
Advanced tools
+8
-6
@@ -14,7 +14,9 @@ import { EventEmitter } from 'events'; | ||
| }; | ||
| export type Dirent<T extends Path> = Omit<NodeDirent, `name` | `path`> & { | ||
| export type Dirent<T extends Path> = Omit<NodeDirent, `name` | `path` | `parentPath`> & { | ||
| name: Filename; | ||
| /** @deprecated */ | ||
| path: T; | ||
| parentPath: T; | ||
| }; | ||
| export type DirentNoPath = Omit<NodeDirent, `name` | `path`> & { | ||
| export type DirentNoPath = Omit<NodeDirent, `name` | `path` | `parentPath`> & { | ||
| name: Filename; | ||
@@ -311,8 +313,8 @@ }; | ||
| abstract lutimesSync(p: P, atime: Date | string | number, mtime: Date | string | number): void; | ||
| abstract readFilePromise(p: FSPath<P>, encoding?: null): Promise<Buffer>; | ||
| abstract readFilePromise(p: FSPath<P>, encoding?: null): Promise<NonSharedBuffer>; | ||
| abstract readFilePromise(p: FSPath<P>, encoding: BufferEncoding): Promise<string>; | ||
| abstract readFilePromise(p: FSPath<P>, encoding?: BufferEncoding | null): Promise<Buffer | string>; | ||
| abstract readFileSync(p: FSPath<P>, encoding?: null): Buffer; | ||
| abstract readFilePromise(p: FSPath<P>, encoding?: BufferEncoding | null): Promise<NonSharedBuffer | string>; | ||
| abstract readFileSync(p: FSPath<P>, encoding?: null): NonSharedBuffer; | ||
| abstract readFileSync(p: FSPath<P>, encoding: BufferEncoding): string; | ||
| abstract readFileSync(p: FSPath<P>, encoding?: BufferEncoding | null): Buffer | string; | ||
| abstract readFileSync(p: FSPath<P>, encoding?: BufferEncoding | null): NonSharedBuffer | string; | ||
| abstract readlinkPromise(p: P): Promise<P>; | ||
@@ -319,0 +321,0 @@ abstract readlinkSync(p: P): P; |
+4
-4
@@ -180,8 +180,8 @@ import { BigIntStats, Stats } from 'fs'; | ||
| symlinkSync(target: PortablePath, p: PortablePath, type?: SymlinkType): void; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: null): Promise<Buffer>; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: null): Promise<NonSharedBuffer>; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding: BufferEncoding): Promise<string>; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): Promise<Buffer | string>; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: null): Buffer; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): Promise<NonSharedBuffer | string>; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: null): NonSharedBuffer; | ||
| readFileSync(p: FSPath<PortablePath>, encoding: BufferEncoding): string; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): Buffer | string; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): NonSharedBuffer | string; | ||
| readdirPromise(p: PortablePath, opts?: null): Promise<Array<Filename>>; | ||
@@ -188,0 +188,0 @@ readdirPromise(p: PortablePath, opts: { |
+3
-3
@@ -697,7 +697,7 @@ "use strict"; | ||
| return this.baseFs.watch(p, | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
| }, (mountFs, { subPath }) => { | ||
| return mountFs.watch(subPath, | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
@@ -709,3 +709,3 @@ }); | ||
| return this.baseFs.watchFile(p, | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
@@ -712,0 +712,0 @@ }, () => { |
+4
-4
@@ -131,8 +131,8 @@ import fs, { BigIntStats, Stats } from 'fs'; | ||
| symlinkSync(target: PortablePath, p: PortablePath, type?: SymlinkType): void; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: null): Promise<Buffer>; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: null): Promise<NonSharedBuffer>; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding: BufferEncoding): Promise<string>; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): Promise<Buffer | string>; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: null): Buffer; | ||
| readFilePromise(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): Promise<NonSharedBuffer | string>; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: null): NonSharedBuffer; | ||
| readFileSync(p: FSPath<PortablePath>, encoding: BufferEncoding): string; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): Buffer | string; | ||
| readFileSync(p: FSPath<PortablePath>, encoding?: BufferEncoding | null): NonSharedBuffer | string; | ||
| readdirPromise(p: PortablePath, opts?: null): Promise<Array<Filename>>; | ||
@@ -139,0 +139,0 @@ readdirPromise(p: PortablePath, opts: { |
+4
-4
@@ -46,3 +46,3 @@ "use strict"; | ||
| }).then(dir => { | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| // | ||
@@ -69,3 +69,3 @@ // We need a way to tell TS that the values returned by the `read` | ||
| : this.realFs.opendirSync(path_1.npath.fromPortablePath(p)); | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| // | ||
@@ -456,3 +456,3 @@ // We need a way to tell TS that the values returned by the `read` | ||
| return this.realFs.watch(path_1.npath.fromPortablePath(p), | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
@@ -462,3 +462,3 @@ } | ||
| return this.realFs.watchFile(path_1.npath.fromPortablePath(p), | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
@@ -465,0 +465,0 @@ } |
@@ -234,3 +234,3 @@ "use strict"; | ||
| setupFn(patchedFsPromises, `open`, async (...args) => { | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| const fd = await fakeFs.openPromise(...args); | ||
@@ -250,3 +250,3 @@ return new FileHandle_1.FileHandle(fd, fakeFs); | ||
| // https://github.com/nodejs/node/blob/ba684805b6c0eded76e5cd89ee00328ac7a59365/lib/internal/util.js#L293 | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| patchedFs.read[util_1.promisify.custom] = async (fd, buffer, ...args) => { | ||
@@ -256,3 +256,3 @@ const res = fakeFs.readPromise(fd, buffer, ...args); | ||
| }; | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| patchedFs.write[util_1.promisify.custom] = async (fd, buffer, ...args) => { | ||
@@ -259,0 +259,0 @@ const res = fakeFs.writePromise(fd, buffer, ...args); |
@@ -137,8 +137,8 @@ import { Stats, BigIntStats } from 'fs'; | ||
| symlinkSync(target: P, p: P, type?: SymlinkType): void; | ||
| readFilePromise(p: FSPath<P>, encoding?: null): Promise<Buffer>; | ||
| readFilePromise(p: FSPath<P>, encoding?: null): Promise<NonSharedBuffer>; | ||
| readFilePromise(p: FSPath<P>, encoding: BufferEncoding): Promise<string>; | ||
| readFilePromise(p: FSPath<P>, encoding?: BufferEncoding | null): Promise<Buffer | string>; | ||
| readFileSync(p: FSPath<P>, encoding?: null): Buffer; | ||
| readFilePromise(p: FSPath<P>, encoding?: BufferEncoding | null): Promise<NonSharedBuffer | string>; | ||
| readFileSync(p: FSPath<P>, encoding?: null): NonSharedBuffer; | ||
| readFileSync(p: FSPath<P>, encoding: BufferEncoding): string; | ||
| readFileSync(p: FSPath<P>, encoding?: BufferEncoding | null): Buffer | string; | ||
| readFileSync(p: FSPath<P>, encoding?: BufferEncoding | null): NonSharedBuffer | string; | ||
| readdirPromise(p: P, opts?: null): Promise<Array<Filename>>; | ||
@@ -145,0 +145,0 @@ readdirPromise(p: P, opts: { |
+2
-2
@@ -235,3 +235,3 @@ "use strict"; | ||
| return this.baseFs.watch(this.mapToBase(p), | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
@@ -241,3 +241,3 @@ } | ||
| return this.baseFs.watchFile(this.mapToBase(p), | ||
| // @ts-expect-error | ||
| // @ts-expect-error - reason TBS | ||
| a, b); | ||
@@ -244,0 +244,0 @@ } |
+2
-2
| { | ||
| "name": "@yarnpkg/fslib", | ||
| "version": "3.1.2", | ||
| "version": "3.1.3", | ||
| "license": "BSD-2-Clause", | ||
@@ -15,3 +15,3 @@ "main": "./lib/index.js", | ||
| "devDependencies": { | ||
| "@yarnpkg/libzip": "^3.1.1" | ||
| "@yarnpkg/libzip": "^3.2.2" | ||
| }, | ||
@@ -18,0 +18,0 @@ "scripts": { |
231711
0.16%6004
0.03%