UNPKG

compare-by

Version:

A versatile utility library for sorting arrays of objects by one or multiple keys with customizable sort directions.

16 lines (14 loc) 354 B
import { arrayify } from './array'; describe('util', () => { describe('array', () => { describe('arrayify', () => { test('non-array input', () => { expect(arrayify(1)).toEqual([1]); }); test('array input', () => { expect(arrayify([1])).toEqual([1]); expect(arrayify([1, 2])).toEqual([1, 2]); }); }); }); });