Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 767 Bytes

isNumberParseable.md

File metadata and controls

39 lines (23 loc) · 767 Bytes

[libraryNameWithSpacesAndUpperCases]Docs


[libraryNameWithSpacesAndUpperCases] / isNumberParseable

Function: isNumberParseable()

isNumberParseable(value): value is NumberParseable

Check if value is parseable to number.

Parameters

value: unknown

An unknown value to be checked.

Returns

value is NumberParseable

Example

isNumberParseable('AAAA');
//=> false

isNumberParseable('100');
//=> true

if (!isNumberParseable(value))
  throw new Error('Value can\'t be parseable to `Number`.')
return Number(value);

Defined in

index.ts:24