class-validator#IsPositive TypeScript Examples

The following examples show how to use class-validator#IsPositive. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PostDto.ts    From jaebook-server with MIT License 5 votes vote down vote up
@IsNumber()
  @Max(20)
  @IsPositive()
  public limit: number;
Example #2
Source File: clusters.ts    From Discord-Bot-TypeScript-Template with MIT License 5 votes vote down vote up
@IsDefined()
    @IsInt()
    @IsPositive()
    shardCount: number;
Example #3
Source File: event-metadata.dto.ts    From nestjs-geteventstore with MIT License 5 votes vote down vote up
// EventStore Specific (must be inside event-cloud data when transformed)
  /**
   * Event version
   * @example 1
   */
  @IsPositive()
  version: number;
Example #4
Source File: domains.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@IsInt()
  @IsPositive()
  page: number = 1;
Example #5
Source File: scan-tasks.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@IsInt()
  @IsPositive()
  page: number = 1;
Example #6
Source File: scans.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@IsInt()
  @IsPositive()
  frequency: number = 1;
Example #7
Source File: vulnerabilities.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@IsInt()
  @IsPositive()
  page: number = 1;
Example #8
Source File: create-session.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsOptional()
  @IsPositive()
  @IsInt()
  ttl?: number = null;
Example #9
Source File: get-cross-chain-bridge-route.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsPositive()
  fromChainId?: number;
Example #10
Source File: get-cross-chain-bridge-route.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsPositive()
  toChainId?: number;
Example #11
Source File: pagination.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsOptional()
  @IsPositive()
  @IsInt()
  page?: number = null;
Example #12
Source File: pagination.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsOptional()
  @IsPositive()
  @IsInt()
  @Max(100)
  limit?: number = null;
Example #13
Source File: upsert-blocks.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@Max(Number.MAX_SAFE_INTEGER)
  @IsInt()
  @IsPositive()
  @Type(() => Number)
  readonly size!: number;
Example #14
Source File: order.entity.ts    From rest-api.ts with MIT License 5 votes vote down vote up
@IsPositive()
  @ValidateIf(total => total >= 0)
  @Column({type: 'integer', default: 0, unsigned: true})
  total: number;
Example #15
Source File: placement.entity.ts    From rest-api.ts with MIT License 5 votes vote down vote up
@IsPositive()
  @Column({type: 'integer', default: 0})
  quantity: number = 0;
Example #16
Source File: product.entity.ts    From rest-api.ts with MIT License 5 votes vote down vote up
@IsPositive()
  @IsDefined()
  @Column({type: 'float', nullable: false})
  price: number;