/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/utils/isObject.test.ts
21 строка
732 B
Bill
🥬 save cloneObject bytes (#8407)
26 май 2022, 14:39
Не верифицирован
26 май 2022, 14:39
d8c7785
Код
Авторство
О чём код?
import isObject from '../../utils/isObject'; describe('isObject', () => { it('should return true when value is an object', () => { expect(isObject({})).toBeTruthy(); expect(isObject({ foo: 'bar' })).toBeTruthy(); expect(isObject(new Blob())).toBeTruthy(); }); it('should return false when value is not an object or is null', () => { expect(isObject(null)).toBeFalsy(); expect(isObject(undefined)).toBeFalsy(); expect(isObject(-1)).toBeFalsy(); expect(isObject(0)).toBeFalsy(); expect(isObject(1)).toBeFalsy(); expect(isObject('')).toBeFalsy(); expect(isObject([])).toBeFalsy(); expect(isObject(['foo', 'bar'])).toBeFalsy(); expect(isObject(() => null)).toBeFalsy(); }); });