Skip to content

Commit 6dacc68

Browse files
authored
Refactor shouldSupportInterfaces helper (#5358)
1 parent 1c1186a commit 6dacc68

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/utils/introspection/SupportsInterface.behavior.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ const SIGNATURES = {
9393
const INTERFACE_IDS = mapValues(SIGNATURES, interfaceId);
9494

9595
function shouldSupportInterfaces(interfaces = [], signatures = SIGNATURES) {
96+
// case where only signatures are provided
97+
if (!Array.isArray(interfaces)) {
98+
interfaces = Object.keys(interfaces);
99+
signatures = interfaces;
100+
}
101+
96102
interfaces.unshift('ERC165');
97103
signatures.ERC165 = SIGNATURES.ERC165;
98104
const interfaceIds = mapValues(signatures, interfaceId, ([name]) => interfaces.includes(name));

0 commit comments

Comments
 (0)