-
-
Notifications
You must be signed in to change notification settings - Fork 352
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
1.2.11
What platform is your computer?
Linux 6.13.5-2-cachyos x86_64 unknown
What steps can reproduce the bug?
import { Type, TypeGuard } from '@sinclair/typebox';
import { t } from 'elysia';
const type = Type.Date();
const isDate = TypeGuard.IsDate(type);
const isUnion = TypeGuard.IsUnion(type);
console.log({ type, isDate, isUnion });
// {
// type: {
// [Symbol(TypeBox.Kind)]: "Date",
// type: "Date",
// },
// isDate: true,
// isUnion: false,
// }
////////////////////// With Elysia /////////////////////////////
const type2 = t.Date();
const isDate2 = TypeGuard.IsDate(type2);
const isUnion2 = TypeGuard.IsUnion(type2);
console.log({ type2, isDate2, isUnion2 });
// {
// type2: {
// [Symbol(TypeBox.Kind)]: "Union",
// anyOf: [
// [Object ...], [Object ...], [Object ...], [Object ...]
// ],
// [Symbol(TypeBox.Transform)]: {
// Decode: [Function],
// Encode: [Function],
// },
// },
// isDate2: false,
// isUnion2: true,
// }
What is the expected behavior?
import { Type, TypeGuard } from '@sinclair/typebox';
import { t } from 'elysia';
const type = Type.Date();
const isDate = TypeGuard.IsDate(type);
const isUnion = TypeGuard.IsUnion(type);
console.log({ type, isDate, isUnion });
// {
// type: {
// [Symbol(TypeBox.Kind)]: "Date",
// type: "Date",
// },
// isDate: true,
// isUnion: false,
// }
////////////////////// With Elysia /////////////////////////////
const type2 = t.Date();
const isDate2 = TypeGuard.IsDate(type2);
const isUnion2 = TypeGuard.IsUnion(type2);
console.log({ type2, isDate2, isUnion2 });
// {
// type: {
// [Symbol(TypeBox.Kind)]: "Date",
// type: "Date",
// },
// isDate: true,
// isUnion: false,
// }
What do you see instead?
in Elysia, t.Date() is an Union 😢
Additional information
No response
Have you try removing the node_modules
and bun.lockb
and try again yet?
No response
hisamafahri
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working