Skip to content

Commit 741bd05

Browse files
committed
Improve address API and more robust resolveName.
1 parent 4de185b commit 741bd05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src.ts/address/checks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function isAddressable(value: any): value is Addressable {
4848
* isAddress("ricmoo.eth")
4949
* //_result:
5050
*/
51-
export function isAddress(value: any): boolean {
51+
export function isAddress(value: any): value is string {
5252
try {
5353
getAddress(value);
5454
return true;
@@ -115,7 +115,7 @@ export function resolveAddress(target: AddressLike, resolver?: null | NameResolv
115115
} else if (isAddressable(target)) {
116116
return checkAddress(target, target.getAddress());
117117

118-
} else if (typeof(target.then) === "function") {
118+
} else if (target && typeof(target.then) === "function") {
119119
return checkAddress(target, target);
120120
}
121121

0 commit comments

Comments
 (0)