/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/utils/isKey.test.ts
15 строк
465 B
Bill
7️⃣ V7 (#3741)
01 апр 2021, 00:14
Не верифицирован
01 апр 2021, 00:14
9555d16
Код
Авторство
О чём код?
import isKey from '../../utils/isKey'; describe('isKey', () => { it('should return true when it is not a deep key', () => { expect(isKey('test')).toBeTruthy(); expect(isKey('fooBar')).toBeTruthy(); }); it('should return false when it is a deep key', () => { expect(isKey('test.foo')).toBeFalsy(); expect(isKey('test.foo[0]')).toBeFalsy(); expect(isKey('test[1]')).toBeFalsy(); expect(isKey('test.foo[0].bar')).toBeFalsy(); }); });