Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
fix: ensure script is in commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
rabraghib committed Apr 9, 2022
1 parent dc1e8c6 commit fab5069
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.1",
"description": ":octocat: Information and public meta data about techy brands right in your JS!",
"main": "src/index.js",
"type": "commonjs",
"repository": {
"type": "git",
"url": "git+https://github.com/ngaox/brands-warehouse.git"
Expand All @@ -13,4 +14,4 @@
"url": "https://github.com/ngaox/brands-warehouse/issues"
},
"homepage": "https://github.com/ngaox/brands-warehouse#readme"
}
}
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @param {string} slug
* @returns {import('./index').IBrandInfo | undefined}
*/
export function getBrandInfo(slug) {
module.exports.getBrandInfo = function (slug) {
try {
return require(`../brands/${slug.toLowerCase().replace(":", "/")}.json`);
} catch (error) {}

return undefined;
}
};

0 comments on commit fab5069

Please sign in to comment.