Skip to content

Commit c74f88e

Browse files
committed
Only warn once
1 parent bf0c536 commit c74f88e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/asbind-instance/bind-function.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,19 @@ const converters = new Map([
7272
]
7373
]);
7474

75+
const warned = new Set();
7576
function getConverterForType(typeName) {
7677
for (const [matcher, converter] of converters) {
7778
if (matcher.test(typeName)) {
7879
return converter;
7980
}
8081
}
81-
console.warn(
82-
`No converter for ${JSON.stringify(typeName)}, using pass-through`
83-
);
82+
if (!warned.has(typeName)) {
83+
console.warn(
84+
`No converter for ${JSON.stringify(typeName)}, using pass-through`
85+
);
86+
warned.add(typeName);
87+
}
8488
return { ascToJs: nop, jsToAsc: nop };
8589
}
8690

0 commit comments

Comments
 (0)