diff --git a/src/general.ts b/src/general.ts index 00e9ff8..ec89163 100644 --- a/src/general.ts +++ b/src/general.ts @@ -121,4 +121,4 @@ export function getGlobalThis() { export function isNonEmptyArray(val: unknown): val is Array { return isArray(val) && !!val.length -} \ No newline at end of file +} diff --git a/tests/array.spec.ts b/tests/array.spec.ts index 1e4434c..f96bc74 100644 --- a/tests/array.spec.ts +++ b/tests/array.spec.ts @@ -12,7 +12,6 @@ import { shuffle, sum, sumBy, - isNonEmptyArray, } from '../src' it('uniq', () => { @@ -95,8 +94,3 @@ it('sum', () => { it('sumBy', () => { expect(sumBy([{ value: 1 }, { value: 2 }, { value: 3 }], (item) => item.value)).toBe(6) }) - -it('isNonEmptyArray', () => { - expect(isNonEmptyArray([])).toBe(false) - expect(isNonEmptyArray([1, 2])).toBe(true) -}) diff --git a/tests/general.spec.ts b/tests/general.spec.ts new file mode 100644 index 0000000..1618159 --- /dev/null +++ b/tests/general.spec.ts @@ -0,0 +1,7 @@ +import { it, expect } from 'vitest' +import { isNonEmptyArray } from '../src' + +it('isNonEmptyArray', () => { + expect(isNonEmptyArray([])).toBe(false) + expect(isNonEmptyArray([1, 2])).toBe(true) +})