Open
Description
In version 1.0.11
, Objects.Omit
and Objects.Pick
make all properties required. It also ignores readonly
and make everything writable
https://codesandbox.io/s/typescript-playground-export-forked-5y6rtd
import { Pipe, Objects, Identity } from "hotscript";
type HasNoOptionals1 = Pipe<
// ^?
{
readonly a: string;
b: number;
c?: boolean;
d?: number;
},
[Objects.Omit<"a">]
>;
type HasNoOptionals2 = Pipe<
// ^?
{
readonly a: string;
b: number;
c?: boolean;
d?: number;
},
[Objects.Omit<"">]
>;
type HasNoOptionals3 = Pipe<
// ^?
{
readonly a: string;
b: number;
c?: boolean;
d?: number;
},
[Objects.Pick<"a" | "c">]
>;
type HasNoOptionals4 = Pipe<
// ^?
{
readonly a: string;
b: number;
c?: boolean;
d?: number;
},
[Objects.Pick<"a" | "b" | "c" | "d">]
>;
type WithIdentity = Pipe<
// ^?
{
readonly a: string;
b: number;
c?: boolean;
d?: number;
},
[Identity]
>;
Output
export {};
Compiler Options
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"esModuleInterop": true,
"declaration": true,
"target": "ES2017",
"jsx": "react",
"module": "ESNext",
"moduleResolution": "node"
}
}
Playground Link: Provided
Metadata
Metadata
Assignees
Labels
No labels