ParseIntPipe

Defines the built-in ParseInt Pipe

  
class ParseIntPipe implements PipeTransform {
  protected exceptionFactory: (error: string) => any
  transform(value: string, metadata: ArgumentMetadata): Promise<number>
  protected isNumeric(value: string): boolean
}

See also

Properties

Property Description
protected exceptionFactory: (error: string) => any

Methods

transform()

Method that accesses and performs optional transformation on argument for in-flight requests.


transform(value: string, metadata: ArgumentMetadata): Promise<number>

Parameters

Option Type Description
value string

currently processed route argument

metadata ArgumentMetadata

contains metadata about the currently processed route argument

Returns

Promise<number>

isNumeric()


protected isNumeric(value: string): boolean

Parameters

Option Type Description
value string

currently processed route argument

Returns

boolean true if value is a valid integer number