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

    Function NumberProperty

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

      Parameters

      • Optionaloptions: IsNumberOptions

        Options to be passed to the decorator.

      • OptionalvalidationOptions: ValidationOptions

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

      Returns PropertyDecorator

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

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

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

      export class EnvironmentVariables {
      @NumberProperty()
      public readonly VALUE!: string;
      }

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

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

      export class EnvironmentVariables {
      @NumberProperty({}, { each: true })
      public readonly VALUES!: string[];
      }