.transform() - DarthJDG/Mangler.js GitHub Wiki

Transforms all items' property names between snake_case, camelCase and TitleCase.

.transform([options])
Parameter Type Default Description
options Object
String
An object with optional method modifiers, or a string to pass as the to option.

Returns

Returns the mangler object itself for chaining.

Options

Property Type Default Description
to String '_' The type of case to convert to:
  • '_': snake_case (default)
  • 'upper_': SNAKE_CASE uppercased
  • 'lower_': snake_case lowercased
  • 'camel': camelCase
  • 'title': TitleCase
from String 'auto' In addition to 'auto', it can be any of the explicit source formats supported by Mangler.tokenize().
ignore String
Array.String
[] A string or array of strings to ignore and leave as is.

Transforms all items in the mangler object using Mangler.transform() passing the options directly. See Mangler.transform() for more details and examples.

⚠️ **GitHub.com Fallback** ⚠️