Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

385 B
Raw Blame
import * as v from 'valibot';
import { defineCustomPropertyType, ensureRow } from '../custom-property-definition.models';

export const booleanCustomPropertyDefinition = defineCustomPropertyType({
  typeName: 'boolean',

  value: {
    inputSchema: v.boolean(),

    toDb: ({ value }) => ({ booleanValue: value }),

    fromDb: ensureRow(({ row }) => row.value.booleanValue),
  },
});