@otakusan76/nestjs-environment-variables-provider - v1.0.6
    Preparing search index...

    Function BooleanProperty

    • This decorator can be used to validate and transform a field in a Boolean or an array of Booleans.

      Parameters

      • OptionalvalidationOptions: ValidationOptions

        Validation options (e.g. each for collections).

      Returns PropertyDecorator

      A property decorator that validates and transforms the field to a boolean or an array of booleans.

      Your can load environment variables in the form of a boolean.

      import { BooleanProperty } from '@otakusan76/nestjs-environment-variables-provider/decorators';

      export class EnvironmentVariables {
      @BooleanProperty()
      public readonly VALUE!: boolean;
      }

      You also can load environment variables in the form of an array of booleans.

      import { BooleanProperty } from '@otakusan76/nestjs-environment-variables-provider/decorators';

      export class EnvironmentVariables {
      @BooleanProperty({ each: true })
      public readonly VALUES!: boolean[];
      }