Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/src/schemas/literal/literal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ describe('literal', () => {
expectNoSchemaIssue(literal(45.67), [45.67]);
});

test('for valid NaN literal', () => {
expectNoSchemaIssue(literal(NaN), [NaN]);
});

test('for valid string literal', () => {
expectNoSchemaIssue(literal(''), ['']);
expectNoSchemaIssue(literal('foo'), ['foo']);
Expand Down
2 changes: 1 addition & 1 deletion library/src/schemas/literal/literal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function literal(
return _getStandardProps(this);
},
'~run'(dataset, config) {
if (dataset.value === this.literal) {
if (Object.is(dataset.value, this.literal)) {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
// @ts-expect-error
Comment thread
coderabbitai[bot] marked this conversation as resolved.
dataset.typed = true;
} else {
Expand Down