Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 6defe8e

Browse files
committed
Disposable: use two independent comparisons in isDisposable
1 parent b1ad34e commit 6defe8e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/disposable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Disposable {
88
//
99
// Returns a {Boolean} indicating whether `object` is a valid `Disposable`.
1010
static isDisposable(object) {
11-
return typeof (object != null ? object.dispose : undefined) === "function"
11+
return Boolean(object) && (typeof object.dispose === "function")
1212
}
1313

1414
/*

0 commit comments

Comments
 (0)