Skip to content

Commit f1d512e

Browse files
committed
Added a comment
1 parent 46596de commit f1d512e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/storage/src/implementation/type.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18+
import { isNodeSdk } from '@firebase/util';
1819
import { invalidArgument } from './error';
1920

2021
export function isJustDef<T>(p: T | null | undefined): p is T | null {
@@ -39,7 +40,9 @@ export function isNativeBlob(p: unknown): p is Blob {
3940
}
4041

4142
export function isNativeBlobDefined(): boolean {
42-
return typeof Blob !== 'undefined';
43+
// Note: The `isNodeSdk()` check can be removed when `ts-node` adds native Blob support
44+
// PR: https://github.com/node-fetch/node-fetch/pull/1664
45+
return typeof Blob !== 'undefined' && !isNodeSdk();
4346
}
4447

4548
export function validateNumber(

packages/storage/test/unit/task.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ describe('Firebase Storage > Upload Task', () => {
505505

506506
// Function that notifies when we are in the middle of an exponential backoff
507507
const readyToCancel = new Promise<null>(resolve => {
508+
// @ts-ignore The types for `stub.callsFake` is incompatible with types of `clock.setTimeout`
508509
stub.callsFake((fn, timeout) => {
509510
// @ts-ignore The types for `stub.callsFake` is incompatible with types of `clock.setTimeout`
510511
const res = fakeSetTimeout(fn, timeout);

0 commit comments

Comments
 (0)