Home / File/ timelineDataSerializer.js — react Source File

timelineDataSerializer.js — react Source File

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

File javascript BabelCompiler Validation 2 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  0cee2a62_bc8b_3abb_2ba6_d77cfc667c07["timelineDataSerializer.js"]
  a413acd5_7541_e904_f255_d4dd9b5e5bc1["hasOwnProperty"]
  0cee2a62_bc8b_3abb_2ba6_d77cfc667c07 --> a413acd5_7541_e904_f255_d4dd9b5e5bc1
  af78c51d_c7cb_3bf4_550f_f3fcc48f4f34["isArray"]
  0cee2a62_bc8b_3abb_2ba6_d77cfc667c07 --> af78c51d_c7cb_3bf4_550f_f3fcc48f4f34
  style 0cee2a62_bc8b_3abb_2ba6_d77cfc667c07 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import hasOwnProperty from 'shared/hasOwnProperty';
import isArray from 'shared/isArray';

function formatLanes(laneArray) {
  const lanes = laneArray.reduce((current, reduced) => current + reduced, 0);
  return '0b' + lanes.toString(2).padStart(31, '0');
}

// `test` is part of Jest's serializer API
export function test(maybeTimelineData) {
  if (
    maybeTimelineData != null &&
    typeof maybeTimelineData === 'object' &&
    hasOwnProperty.call(maybeTimelineData, 'lanes') &&
    isArray(maybeTimelineData.lanes)
  ) {
    return true;
  }

  return false;
}

// print() is part of Jest's serializer API
export function print(timelineData, serialize, indent) {
  return serialize({
    ...timelineData,
    lanes: formatLanes(timelineData.lanes),
  });
}

Domain

Subdomains

Dependencies

  • hasOwnProperty
  • isArray

Frequently Asked Questions

What does timelineDataSerializer.js do?
timelineDataSerializer.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 timelineDataSerializer.js?
timelineDataSerializer.js defines 3 function(s): formatLanes, print, test.
What does timelineDataSerializer.js depend on?
timelineDataSerializer.js imports 2 module(s): hasOwnProperty, isArray.
Where is timelineDataSerializer.js in the architecture?
timelineDataSerializer.js is located at packages/react-devtools-shared/src/__tests__/__serializers__/timelineDataSerializer.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