2024-12-08 21:04:32 -08:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
|
|
const getError = () => new Error("Node APIs are not available in browser context.");
|
|
|
|
|
const throwForSync = () => {
|
|
|
|
|
throw getError();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const fs = {
|
2025-10-11 16:36:47 -07:00
|
|
|
// @ts-ignore
|
2024-12-08 21:04:32 -08:00
|
|
|
"access": (path, callback) => callback(getError()),
|
|
|
|
|
"accessSync": throwForSync,
|
2025-10-11 16:36:47 -07:00
|
|
|
// @ts-ignore
|
2024-12-08 21:04:32 -08:00
|
|
|
"readFile": (path, options, callback) => callback(getError()),
|
|
|
|
|
"readFileSync": throwForSync
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const os = {};
|
|
|
|
|
|
|
|
|
|
export const path = {
|
|
|
|
|
"dirname": throwForSync,
|
|
|
|
|
"resolve": throwForSync
|
|
|
|
|
};
|