Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Sync API Refactor #87

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { TsonOptions, TsonType, createTson } from "./index.js";
import { expectError, waitError } from "./internals/testUtils.js";

test("multiple handlers for primitive string found", () => {
const stringHandler: TsonType<string, string> = {
const stringHandler = {
primitive: "string",
};
} as TsonType<string, string>;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equivalent to the other way around. Did you want to use the satisfies operator?

Copy link
Contributor Author

@helmturner helmturner Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is necessary due to the changes in src/sync/syncTypes.ts (sorry for the slow reply!)

const opts: TsonOptions = {
types: [stringHandler, stringHandler],
};
Expand Down Expand Up @@ -98,9 +98,9 @@ test("async: duplicate keys", async () => {
});

test("async: multiple handlers for primitive string found", async () => {
const stringHandler: TsonType<string, string> = {
const stringHandler = {
primitive: "string",
};
} as TsonType<string, string>;

const err = await waitError(async () => {
const iterator = createTsonAsync({
Expand Down
Loading