How to use the pascal function from change-case

Find comprehensive JavaScript change-case.pascal code examples handpicked from public code repositorys.

6
7
8
9
10
11
12
13
14
15

const { param, pascal } = require('change-case');
const { toString } = require('@carbon/icon-helpers');

const classCase = str => {
  const pascalled = pascal(str);
  if (Number.isNaN(Number(pascalled[0]))) {
    return pascalled;
  }
  // append a _ if the string starts with a number
fork icon18
star icon19
watch icon5

+ 2 other calls in file

40
41
42
43
44
45
46
47
48
49
50
51
52


function generateComponentNames(componentType, componentName) {
    const prefix = PREFIX_TYPES[componentType];


    const kebabName = kebab(prefix + componentName);
    const pascalName = pascal(prefix + componentName);


    return {
        kebabName,
        pascalName
fork icon0
star icon1
watch icon0

+ 2 other calls in file