Home / Function/ getCanonicalizedValue() — react Function Reference

getCanonicalizedValue() — react Function Reference

Architecture documentation for the getCanonicalizedValue() function in App.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d7d9b50f_e8ce_781f_f5e2_b018e3478d96["getCanonicalizedValue()"]
  444f4239_c2fb_3bc5_1037_eb595d98f6e1["App.js"]
  d7d9b50f_e8ce_781f_f5e2_b018e3478d96 -->|defined in| 444f4239_c2fb_3bc5_1037_eb595d98f6e1
  8241cc1c_6a89_d873_cf16_ea64af5940d6["getRenderedAttributeValue()"]
  8241cc1c_6a89_d873_cf16_ea64af5940d6 -->|calls| d7d9b50f_e8ce_781f_f5e2_b018e3478d96
  style d7d9b50f_e8ce_781f_f5e2_b018e3478d96 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fixtures/attribute-behavior/src/App.js lines 126–212

function getCanonicalizedValue(value) {
  switch (typeof value) {
    case 'undefined':
      return '<undefined>';
    case 'object':
      if (value === null) {
        return '<null>';
      }
      if ('baseVal' in value) {
        return getCanonicalizedValue(value.baseVal);
      }
      if (value instanceof SVGLength) {
        return '<SVGLength: ' + value.valueAsString + '>';
      }
      if (value instanceof SVGRect) {
        return (
          '<SVGRect: ' +
          [value.x, value.y, value.width, value.height].join(',') +
          '>'
        );
      }
      if (value instanceof SVGPreserveAspectRatio) {
        return (
          '<SVGPreserveAspectRatio: ' +
          value.align +
          '/' +
          value.meetOrSlice +
          '>'
        );
      }
      if (value instanceof SVGNumber) {
        return value.value;
      }
      if (value instanceof SVGMatrix) {
        return (
          '<SVGMatrix ' +
          value.a +
          ' ' +
          value.b +
          ' ' +
          value.c +
          ' ' +
          value.d +
          ' ' +
          value.e +
          ' ' +
          value.f +
          '>'
        );
      }
      if (value instanceof SVGTransform) {
        return (
          getCanonicalizedValue(value.matrix) +
          '/' +
          value.type +
          '/' +
          value.angle
        );
      }
      if (typeof value.length === 'number') {
        return (
          '[' +
          Array.from(value)
            .map(v => getCanonicalizedValue(v))
            .join(', ') +
          ']'
        );
      }
      let name = (value.constructor && value.constructor.name) || 'object';
      return '<' + name + '>';
    case 'function':
      return '<function>';
    case 'symbol':
      return '<symbol>';
    case 'number':
      return `<number: ${value}>`;
    case 'string':
      if (value === '') {
        return '<empty string>';
      }
      return '"' + value + '"';

Domain

Subdomains

Frequently Asked Questions

What does getCanonicalizedValue() do?
getCanonicalizedValue() is a function in the react codebase, defined in fixtures/attribute-behavior/src/App.js.
Where is getCanonicalizedValue() defined?
getCanonicalizedValue() is defined in fixtures/attribute-behavior/src/App.js at line 126.
What calls getCanonicalizedValue()?
getCanonicalizedValue() is called by 1 function(s): getRenderedAttributeValue.

Analyze Your Own Codebase

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

Try Supermodel Free