UNPKG

nestjs-appwrite

Version:

Easier Appwrite integration for your NestJS application.

23 lines (19 loc) 598 B
import typeMetadataStorage from '../../storage/type-metadata.storage'; import { determineRequiredValue, PropOptions } from './prop.options'; export type BooleanPropOptions = PropOptions<boolean> & { isArray?: boolean; }; export function BooleanProp(options: BooleanPropOptions = {}): PropertyDecorator { return (target, propertyKey) => { const propKey = propertyKey.toString(); typeMetadataStorage.addPropertyMetadata( target.constructor, propKey, { ...options, required: determineRequiredValue(options), type: Boolean } ); }; }