From dedd701b36ed7d88a71e89c0ddc2b0c2404f249d Mon Sep 17 00:00:00 2001 From: Itai Steinherz Date: Thu, 25 Oct 2018 00:35:35 +0300 Subject: [PATCH] Fix method signature --- source/index.ts | 4 ++-- source/tests/test.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/index.ts b/source/index.ts index 47727a4..afdb3a1 100644 --- a/source/index.ts +++ b/source/index.ts @@ -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: any): value is String => - !Number.isNaN(Number(value)) && !nullOrUndefined(value); + export const numericString = (value: string): bool => + !Number.isNaN(Number(value)); export const array = Array.isArray; export const buffer = isBuffer; diff --git a/source/tests/test.ts b/source/tests/test.ts index 1199430..e57cb69 100644 --- a/source/tests/test.ts +++ b/source/tests/test.ts @@ -430,8 +430,6 @@ test('is.numericString', t => { t.true(m.numericString('5')); t.true(m.numericString('-3.2')); t.true(m.numericString('Infinity')); - t.false(m.numericString(undefined)); - t.false(m.numericString(null)); }); test('is.array', t => {