export interface Identifiable<T> {
readonly id: T;
}
export interface Entity<ID> extends Identifiable<ID> {
readonly createdAt: ZonedDateTime;
modifiedAt: ZonedDateTime;
}
export type EntityOpts<T extends Entity<unknown>> = Omit<
Partial<T>,
'id' | 'createdAt' | 'modifiedAt'
>;
replace Omit
with Except
in this code and all of the "excluded" keys will still be available for use and compile.
> yarn list typescript type-fest && node --version
yarn list v1.22.4
warning Filtering by arguments is deprecated. Please use the pattern option instead.
ββ @google-cloud/logging@4.5.2
β ββ type-fest@0.3.1
ββ eslint@6.8.0
β ββ ansi-escapes@4.2.1
β β ββ type-fest@0.5.2
β ββ type-fest@0.8.1
ββ inquirer@7.0.3
β ββ type-fest@0.5.2
ββ meow@7.0.1
β ββ read-pkg-up@7.0.1
β β ββ type-fest@0.8.1
β ββ read-pkg@5.2.0
β β ββ type-fest@0.6.0
β ββ type-fest@0.13.1
ββ type-fest@0.15.1
ββ typescript@3.7.4
β¨ Done in 1.28s.
v12.16.3
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too