forked from orbit-oss/is
Fix is.nonEmptyArray() type narrowing with undefined (#188)
This commit is contained in:
parent
ad0c3b1429
commit
20ad8231c2
2 changed files with 5 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue