diff --git a/source/index.ts b/source/index.ts index 9bed5cc..7e68ccb 100644 --- a/source/index.ts +++ b/source/index.ts @@ -170,7 +170,7 @@ is.array = (value: unknown, assertion?: (value: T) => value is T): return false; } - if (!assertion) { + if (!is.function_(assertion)) { return true; } diff --git a/test/test.ts b/test/test.ts index 16e376c..c5c98cd 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1537,6 +1537,8 @@ test('is.all', t => { t.false(is.all(is.string, '🦄', [])); t.false(is.all(is.set, new Map(), {})); + t.true(is.all(is.array, ...[['1'], ['2']])); + t.throws(() => { is.all(null as any, true); });