UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

11 lines (10 loc) 406 B
import type { Merge } from './merge.js'; type NonNullValues<O> = { [K in keyof O]: Exclude<O[K], undefined | null>; } & {}; /** * Make some fields of `O` not nullable (deeply or not) * (Optional fields & `undefined` are left untouched) */ export type NonNull<OBJECT extends object, KEYS extends keyof OBJECT = keyof OBJECT> = Merge<Omit<OBJECT, KEYS>, NonNullValues<Pick<OBJECT, KEYS>>>; export {};