Skip to content

Commit 655bb31

Browse files
committed
Implement createLookup function to validate input and return an object from country-currency pairs
1 parent 1014ae0 commit 655bb31

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Sprint-2/implement/lookup.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
function createLookup() {
2-
// implementation here
2+
if (!Array.isArray(countryCurrencyPairs)) {
3+
return {};
4+
}
5+
return Object.fromEntries(countryCurrencyPairs);
36
}
47

58
module.exports = createLookup;

0 commit comments

Comments
 (0)