Skip to content

Commit

Permalink
FrWithTags should work for 0
Browse files Browse the repository at this point in the history
  • Loading branch information
OAGr committed Jan 12, 2024
1 parent 53a91d0 commit 9c06bd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twenty-rocks-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@quri/squiggle-lang": patch
---

Bug fix: frWithTags should work for 0 value
1 change: 1 addition & 0 deletions packages/squiggle-lang/__tests__/library/tag_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe("Tags", () => {

describe("format", () => {
testEvalToBe("123 -> Tag.format('.2%') -> Tag.getFormat", '".2%"');
testEvalToBe("0 -> Tag.format('.2%') -> Tag.getFormat", '".2%"');
});

describe("notebook", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/squiggle-lang/src/library/registry/frTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const frWithTags = <T>(
unpack: (v) => {
const unpackedItem = itemType.unpack(v);
return (
(unpackedItem && {
(unpackedItem !== undefined && {
value: unpackedItem,
tags: v.tags ?? new ValueTags({}),
}) ||
Expand Down

0 comments on commit 9c06bd7

Please sign in to comment.