Skip to content

Commit

Permalink
Merge pull request #5 from oceans404/main
Browse files Browse the repository at this point in the history
allot() should not throw an error on a `null` field
  • Loading branch information
lapets authored Feb 4, 2025
2 parents 7cf0126 + 7ff64c9 commit e9d52da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nillion/nilql",
"version": "0.0.0-alpha.9",
"version": "0.0.0-alpha.10",
"description": "Library for working with encrypted data within NilDB queries and replies.",
"license": "MIT",
"homepage": "https://github.com/nillionnetwork/nilql-ts",
Expand Down
7 changes: 5 additions & 2 deletions src/nilql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ function allot(document: object): object[] {
if (
typeof document === "number" ||
typeof document === "boolean" ||
typeof document === "string"
typeof document === "string" ||
document === null
) {
return [document];
}
Expand Down Expand Up @@ -947,7 +948,9 @@ function allot(document: object): object[] {
return shares;
}

throw new TypeError("number, boolean, string, array, or object expected");
throw new TypeError(
"number, boolean, string, array, null, or object expected",
);
}

/**
Expand Down

0 comments on commit e9d52da

Please sign in to comment.