# Function toIdObject

- toIdObject<C, N, R, I>(resource): Pick<R, "id"> extends I
  ? Meta.IdObject<C, N, R>
  : undefined | Meta.IdObject<C, N, R>

- #### Type Parameters

  - #### C extends Meta.Collections

  - #### N extends string

  - #### R extends {
    id: string;
    } | {
    id: string;
    } & {
    name: string;
    } | Meta.SavedInput<C, N>

  - #### I extends undefined | null | Pick<R, "id"> = undefined | null | Pick<R, "id">

  #### Parameters

  - ##### resource: I

  #### Returns Pick<R, "id"> extends I
  ? Meta.IdObject<C, N, R>
  : undefined | Meta.IdObject<C, N, R>

  - Defined in packages/db/src/meta/id/index.ts:21

Generated using TypeDoc