vanillajs-helpers

Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS

View the Project on GitHub Tokimon/vanillajs-helpers

vanillajs-helpers > “pascalCase”

External module: “pascalCase”

Index

Functions


Functions

pascalCase

pascalCase(input?: CamelCaseSettings): CamelCaseFunction

pascalCase(input: string): string

Defined in pascalCase.ts:20

Return a function that transforms a string into a PascalCased word (eg. ‘pascal case’ -> ‘PascalCase’).

const caser = pascalCase({ abbr: true, numbers: true });

caser('data-VALUE2-input'); // -> DataVALUE2Input
caser('XML data input'); // -> XMLDataInput

Parameters:

Param Type Description
input CamelCaseSettings The settings for the returned format method

Returns: CamelCaseFunction

Defined in pascalCase.ts:33

Transform a string into a PascalCased word (eg. ‘pascal case’ -> ‘PascalCase’)

pascalCase('data-value2-input'); // -> DataValue2input
pascalCase('XML data input'); // -> XmlDataInput

Parameters:

Param Type Description
input string The string to format

Returns: string