Skip to content

Commit d5017be

Browse files
committed
return obj instead of array for name details
1 parent 9f78180 commit d5017be

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/usBabyNames.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ const getDetailed = async (nameInput, sexInput) => {
2626
console.log('err', err);
2727
reject (err);
2828
}
29-
fulfill(rows);
29+
if (!rows.length) {
30+
return fulfill({});
31+
}
32+
return fulfill(rows[0]);
3033
});
3134
});
3235
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "usbabynames",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "Returns data about baby names used in the United States 1880-2021",
55
"main": "lib/usBabyNames.mjs",
66
"scripts": {

0 commit comments

Comments
 (0)