/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-devtools-shared/src/__tests__/__serializers__/inspectedElementSerializer.js
35 строк
981 B
Sebastian Markbåge
[DevTools] Add Option to Open Local Files directly in External Editor (#33983)
25 июл 2025, 17:16
Не верифицирован
25 июл 2025, 17:16
142fd27
Код
Авторство
О чём код?
// `test` is part of Jest's serializer API export function test(maybeInspectedElement) { if ( maybeInspectedElement === null || typeof maybeInspectedElement !== 'object' ) { return false; } const hasOwnProperty = Object.prototype.hasOwnProperty.bind( maybeInspectedElement, ); return ( hasOwnProperty('canEditFunctionProps') && hasOwnProperty('canEditHooks') && hasOwnProperty('canToggleSuspense') && hasOwnProperty('canToggleError') ); } // print() is part of Jest's serializer API export function print(inspectedElement, serialize, indent) { // Don't stringify this object; that would break nested serializers. return serialize({ context: inspectedElement.context, events: inspectedElement.events, hooks: inspectedElement.hooks, id: inspectedElement.id, owners: inspectedElement.owners, props: inspectedElement.props, rootType: inspectedElement.rootType, state: inspectedElement.state, }); }