We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2828f6a commit 4750aeeCopy full SHA for 4750aee
src/promises.ts
@@ -182,7 +182,8 @@ export class FileHandle implements IFileHandle {
182
}
183
184
185
-export default function createPromisesApi(vol: Volume): IPromisesAPI {
+export default function createPromisesApi(vol: Volume): null | IPromisesAPI {
186
+ if (typeof Promise === 'undefined') return null;
187
return {
188
FileHandle,
189
src/volume.ts
@@ -575,6 +575,7 @@ export class Volume {
575
'ExperimentalWarning',
576
);
577
578
+ if (this.promisesApi === null) throw new Error('Promise is not supported in this environment.');
579
return this.promisesApi;
580
581
0 commit comments