Skip to content

Commit

Permalink
update to support non-ts packages
Browse files Browse the repository at this point in the history
  • Loading branch information
uchibeke committed Oct 16, 2021
1 parent 0c4945d commit 22e9abf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "non-profit-donations",
"version": "0.0.5",
"version": "0.0.6",
"description": "Support non-profits globally. Get the details of verified non profits to support",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/non-profits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ test('list', async (t) => {

test('randomNonProfit', async (t) => {
const randomItem = randomNonProfit();
t.not(typeof randomItem?.name, 'undefined');
t.not(typeof randomItem?.email, 'undefined');
t.not(randomItem?.paymentMethods.length, 0);
t.not(typeof randomItem.name, 'undefined');
t.not(typeof randomItem.email, 'undefined');
t.not(randomItem.paymentMethods.length, 0);
});

test('nonProfitsAcceptingPaymentType', async (t) => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/non-profits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const randomNonProfit = (subList?: readonly NonProfit[]) => {
*/
export const nonprofitsFromCountry = (country: string) => {
return nonProfits.filter(
(org) => org.country?.toLocaleLowerCase() === country?.toLocaleLowerCase()
(org) => org.country.toLocaleLowerCase() === country.toLocaleLowerCase()
);
};

Expand Down Expand Up @@ -120,7 +120,7 @@ export const verifiedNonprofits = () => {
export const nonProfitsAcceptingPaymentType = (paymentType: string) => {
return nonProfits.filter((n) =>
n.paymentMethods.find(
(org) => org.type === paymentType && org.paymentID?.length > 0
(org) => org.type === paymentType && org.paymentID.length > 0
)
);
};
Expand Down

0 comments on commit 22e9abf

Please sign in to comment.