Home / File/ hyphenateStyleName.js — react Source File

hyphenateStyleName.js — react Source File

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

File javascript BabelCompiler Validation 2 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  3af39105_ac73_ac11_e339_aecf80d45947["hyphenateStyleName.js"]
  e3e314a2_4cee_1a10_2d68_791d5d66f89e["CSSPropertyOperations.js"]
  e3e314a2_4cee_1a10_2d68_791d5d66f89e --> 3af39105_ac73_ac11_e339_aecf80d45947
  4ae326e8_2c2e_2843_d5a5_16edbddd103a["ReactFizzConfigDOM.js"]
  4ae326e8_2c2e_2843_d5a5_16edbddd103a --> 3af39105_ac73_ac11_e339_aecf80d45947
  style 3af39105_ac73_ac11_e339_aecf80d45947 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

const uppercasePattern = /([A-Z])/g;
const msPattern = /^ms-/;

/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 */
export default function hyphenateStyleName(name: string): string {
  return name
    .replace(uppercasePattern, '-$1')
    .toLowerCase()
    .replace(msPattern, '-ms-');
}

Domain

Subdomains

Frequently Asked Questions

What does hyphenateStyleName.js do?
hyphenateStyleName.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 hyphenateStyleName.js?
hyphenateStyleName.js defines 1 function(s): hyphenateStyleName.
What files import hyphenateStyleName.js?
hyphenateStyleName.js is imported by 2 file(s): CSSPropertyOperations.js, ReactFizzConfigDOM.js.
Where is hyphenateStyleName.js in the architecture?
hyphenateStyleName.js is located at packages/react-dom-bindings/src/shared/hyphenateStyleName.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom-bindings/src/shared).

Analyze Your Own Codebase

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

Try Supermodel Free