Closed marcus-sa closed 11 months ago
Interesting, Omit
doesn't work with referenced types:
import { typeOf, validate } from '@deepkit/type';
test('validate nested interfaces', () => {
interface A {
readonly a: string;
readonly value: string;
};
type B = Omit<A, 'value'>;
const type = typeOf<B>();
console.log(validate({}, type)); // []
});
It only works for inline types https://github.com/deepkit/deepkit-framework/blob/3fd48ea79d807410412f84d1bfd3010b8f5bbefe/packages/type/tests/standard-functions.spec.ts#L42-L45
Pick
only works for inline types as well.
weird, works for me. Added also a test that shows Omit works with non-inline types: https://github.com/deepkit/deepkit-framework/commit/a47111c53f43ceb11cbbf4f4fb72c8d72eac9507
weird, works for me. Added also a test that shows Omit works with non-inline types: a47111c
I assume it's because my typescript target was set to esnext
.
weird, works for me. Added also a test that shows Omit works with non-inline types: a47111c
I assume it's because my typescript target was set to
esnext
.
@marcj yeah it works fine when it's set to es2022
.
@typescript/vfs
is bugged and doesn't return the correct lib files for esnext
.