Improve tests and check if string is empty
This commit is contained in:
parent
522c7482f2
commit
605b4f4470
2 changed files with 14 additions and 6 deletions
|
|
@ -136,8 +136,8 @@ namespace is { // tslint:disable-line:no-namespace
|
|||
// tslint:enable:variable-name
|
||||
|
||||
export const nullOrUndefined = (value: any): value is null | undefined => null_(value) || undefined(value);
|
||||
export const numericString = (value: string): boolean =>
|
||||
!Number.isNaN(Number(value));
|
||||
export const numericString = (value: any): boolean =>
|
||||
string(value) && value.length > 0 && !Number.isNaN(Number(value));
|
||||
|
||||
export const array = Array.isArray;
|
||||
export const buffer = isBuffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue