/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/isPlainObject.test.ts
23 строки
813 B
Gromit (전민재)
✅ chore: add noop Utils Function (#11455)
03 фев 2024, 01:09
Не верифицирован
03 фев 2024, 01:09
5c3b4c0
Код
Авторство
О чём код?
import isPlainObject from '../utils/isPlainObject'; import noop from '../utils/noop'; describe('isPlainObject', function () { it('should identify plan object or not', function () { function test() { return { test: noop, }; } expect(isPlainObject(Object.create({}))).toBeTruthy(); expect(isPlainObject(Object.create(Object.prototype))).toBeTruthy(); expect(isPlainObject({ foo: 'bar' })).toBeTruthy(); expect(isPlainObject({})).toBeTruthy(); expect(isPlainObject(Object.create(null))).toBeFalsy(); expect(!isPlainObject(/foo/)).toBeTruthy(); expect(!isPlainObject(function () {})).toBeTruthy(); expect(!isPlainObject(['foo', 'bar'])).toBeTruthy(); expect(!isPlainObject([])).toBeTruthy(); expect(!isPlainObject(test)).toBeTruthy(); }); });