Home / File/ treeContextStateSerializer.js — react Source File

treeContextStateSerializer.js — react Source File

Architecture documentation for treeContextStateSerializer.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript BabelCompiler Validation 1 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  6368f317_a2ff_596b_8cb4_4dbf63d3f81e["treeContextStateSerializer.js"]
  15ddbedd_95dc_5545_807f_882c0a98271f["utils"]
  6368f317_a2ff_596b_8cb4_4dbf63d3f81e --> 15ddbedd_95dc_5545_807f_882c0a98271f
  style 6368f317_a2ff_596b_8cb4_4dbf63d3f81e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {printStore} from 'react-devtools-shared/src/devtools/utils';

// `test` is part of Jest's serializer API
export function test(maybeState) {
  if (maybeState === null || typeof maybeState !== 'object') {
    return false;
  }

  const hasOwnProperty = Object.prototype.hasOwnProperty.bind(maybeState);
  // Duck typing at its finest.
  return (
    hasOwnProperty('inspectedElementID') &&
    hasOwnProperty('ownerFlatTree') &&
    hasOwnProperty('ownerSubtreeLeafElementID')
  );
}

// print() is part of Jest's serializer API
export function print(state, serialize, indent) {
  // This is a big of a hack but it works around having to pass in a meta object e.g. {store, state}.
  // DevTools tests depend on a global Store object anyway (initialized via setupTest).
  const store = global.store;

  return printStore(store, false, state);
}

Domain

Subdomains

Functions

Dependencies

  • utils

Frequently Asked Questions

What does treeContextStateSerializer.js do?
treeContextStateSerializer.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in treeContextStateSerializer.js?
treeContextStateSerializer.js defines 2 function(s): print, test.
What does treeContextStateSerializer.js depend on?
treeContextStateSerializer.js imports 1 module(s): utils.
Where is treeContextStateSerializer.js in the architecture?
treeContextStateSerializer.js is located at packages/react-devtools-shared/src/__tests__/__serializers__/treeContextStateSerializer.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/__tests__/__serializers__).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free