Fix is.nonEmptyArray() type narrowing with undefined (#188)

This commit is contained in:
Eugene 2023-07-17 10:42:04 +01:00 committed by GitHub
parent ad0c3b1429
commit 20ad8231c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -1626,7 +1626,7 @@ test('is.nonEmptyArray', t => {
});
{
const strings = ['🦄', 'unicorn'];
const strings = ['🦄', 'unicorn'] as string[] | undefined;
const function_ = (value: string) => value;
if (is.nonEmptyArray(strings)) {
@ -1656,7 +1656,7 @@ test('is.nonEmptyArray', t => {
}
{
const strings = ['🦄', 'unicorn'];
const strings = ['🦄', 'unicorn'] as string[] | undefined;
const function_ = (value: string) => value;
assert.nonEmptyArray(strings);