Skip to content

Commit e1aba23

Browse files
committed
feat(node-polyfills): add isAbsolute and normalize functions; implement Stats class with directory/file checks
1 parent d7ef0e0 commit e1aba23

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

examples/app-react-crud/mocks/node-polyfills.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,19 @@ export const basename = (path) => path;
5151
export const extname = (path) => '';
5252
export const sep = '/';
5353
export const relative = () => '';
54+
export const isAbsolute = () => false;
55+
export const normalize = (p: string) => p;
5456

5557
export const posix = {};
5658
export const win32 = {};
5759

5860
// fs/promises and other missing exports
5961
export const open = async () => ({ close: async () => {} });
62+
export class Stats {
63+
isDirectory() { return false; }
64+
isFile() { return false; }
65+
isSymbolicLink() { return false; }
66+
}
6067
export const watchFile = () => {};
6168
export const unwatchFile = () => {};
6269

0 commit comments

Comments
 (0)