Skip to content

Commit

Permalink
Spelling is now supported. (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellabitta authored Feb 27, 2024
1 parent 469746b commit 5a0713b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/isEmpty.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const isEmpty = (obj) => {
} else if (
["boolean", "number", "bigint", "symbol", "function"].includes(typeof obj)
) {
throw new Error(`Unsuported type: ${typeof obj}`);
throw new Error(`Unsupported type: ${typeof obj}`);
} else {
return Object.keys(obj).length === 0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/lib/isEmpty.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,39 @@ test("isEmpty throws for unsupported types", (t) => {
isEmpty(true);
},
{
message: "Unsuported type: boolean",
message: "Unsupported type: boolean",
},
);
assert.throws(
() => {
isEmpty(1);
},
{
message: "Unsuported type: number",
message: "Unsupported type: number",
},
);
assert.throws(
() => {
isEmpty(BigInt(9007199254740991));
},
{
message: "Unsuported type: bigint",
message: "Unsupported type: bigint",
},
);
assert.throws(
() => {
isEmpty(Symbol("foo"));
},
{
message: "Unsuported type: symbol",
message: "Unsupported type: symbol",
},
);
assert.throws(
() => {
isEmpty(() => {});
},
{
message: "Unsuported type: function",
message: "Unsupported type: function",
},
);
});

0 comments on commit 5a0713b

Please sign in to comment.