UNPKG

@jahands/notion-client

Version:
18 lines 599 B
/** * Utility for enforcing exhaustiveness checks in the type system. * * @see https://basarat.gitbook.io/typescript/type-system/discriminated-unions#throw-in-exhaustive-checks * * @param value The variable with no remaining values */ export function assertNever(value) { throw new Error(`Unexpected value should never occur: ${value}`); } export function pick(base, keys) { const entries = keys.map((key) => [key, base?.[key]]); return Object.fromEntries(entries); } export function isObject(o) { return typeof o === 'object' && o !== null; } //# sourceMappingURL=utils.js.map