How to use the change-case.upperCaseFirst function in change-case

To help you get started, we’ve selected a few change-case examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rodi01 / RenameIt / src / lib / Rename.js View on Github external
function currentLayer(newLayerName, layerName) {
  // UpperCase
  let name = newLayerName.replace(/%\*u%/gi, changeCase.upperCase(layerName))

  // LowerCase
  name = name.replace(/%\*l%/gi, changeCase.lowerCase(layerName))

  // Title Case
  name = name.replace(/%\*t%/gi, toTitleCase(layerName))

  // UpperCase First
  name = name.replace(/%\*uf%/gi, changeCase.upperCaseFirst(layerName))

  // Camel Case
  name = name.replace(/%\*c%/gi, changeCase.camelCase(layerName))

  // Param Case
  name = name.replace(/%\*pc%/gi, changeCase.paramCase(layerName))

  // Layername
  name = name.replace(/%\*/g, layerName)

  return name
}
github cdes / figma-plus-advanced-rename-plugin / src / rename.js View on Github external
function currentLayer(newLayerName, layerName) {
  // UpperCase
  let name = newLayerName.replace(/%\*u%/gi, changeCase.upperCase(layerName));

  // LowerCase
  name = name.replace(/%\*l%/gi, changeCase.lowerCase(layerName));

  // Title Case
  name = name.replace(/%\*t%/gi, toTitleCase(layerName));
  // name = name.replace(/%\*t%/gi, changeCase.titleCase(layerName))

  // UpperCase First
  name = name.replace(/%\*uf%/gi, changeCase.upperCaseFirst(layerName));

  // Camel Case
  name = name.replace(/%\*c%/gi, changeCase.camelCase(layerName));

  // Layername
  name = name.replace(/%\*/g, layerName);

  return name;
}
github flutter-view / flutter-view / src / compiler.ts View on Github external
function compileTag(tag: Tag, options: Options) : Widget {
	// use the configured class name if we set it in the tagClasses option
	const originalName = tag.name
	for(let tagName of Object.keys(options.tagClasses)) {
		if(tag.name == tagName) tag.name = options.tagClasses[tagName]
	}

	// start building a widget with params
	const widgetClass = upperCaseFirst(camelCase(tag.name))
	const params: Param[] = []
	let generics: string[]
	let pugLine: number
	let pugColumn: number

	// process the tag attributes, transforming them into widget params
	if(tag.attribs) {
		for(const attr in tag.attribs) {
			let type: 'expression' | 'literal' | 'closure'
			let name: string
			if(attr.startsWith(':')) {
				type = 'expression'
				name = attr.substring(1)
			} else if(attr.startsWith('@')) {
				type = 'closure'
				name = attr.substring(1)
github rodi01 / RenameIt-XD / src / lib / Rename.js View on Github external
function currentLayer(newLayerName, layerName) {
  // UpperCase
  let name = newLayerName.replace(/%\*u%/gi, changeCase.upperCase(layerName))

  // LowerCase
  name = name.replace(/%\*l%/gi, changeCase.lowerCase(layerName))

  // Title Case
  name = name.replace(/%\*t%/gi, toTitleCase(layerName))
  // name = name.replace(/%\*t%/gi, changeCase.titleCase(layerName))

  // UpperCase First
  name = name.replace(/%\*uf%/gi, changeCase.upperCaseFirst(layerName))

  // Camel Case
  name = name.replace(/%\*c%/gi, changeCase.camelCase(layerName))

  // Layername
  name = name.replace(/%\*/g, layerName)

  return name
}
github flutter-view / flutter-view / src / plugins / add-constructor-params.ts View on Github external
export function transformWidget(widget: Widget, options: Options): Widget {
	if(widget.originalName) {
		const split = widget.originalName.split(':')
		if(split.length == 2) {
			widget.name = upperCaseFirst(camelCase(split[0]))
			if(!widget.params) widget.params = []
			widget.params.push({
				class: 'param',
				type: 'literal',
				name: 'constructor',
				value: split[1],
				resolved: true
			})
		}
	}

	applyOnDescendants(widget, descendant=>transformWidget(descendant, options))

	return widget	
}
github joshwcomeau / redux-vcr / packages / replay / scripts / add_component / add-component.js View on Github external
function run(componentName) {
  if (!componentName) {
    throw new Error(`
      Please supply a component name!
      'npm run add-component -- YourComponentName'
    `);
  } else if (!changeCase.upperCaseFirst(componentName)) {
    throw new Error(`
      Custom React components need to be in PascalCase.
      You provided ${componentName}.
      Please capitalize the first letter!
    `);
  }

  const componentDirectory = path.join(
    __dirname,
    '../../src/components',
    componentName
  );
  createDirectory(componentDirectory);

  const className = changeCase.paramCase(componentName);
github mozilla / oghliner / lib / bootstrap.js View on Github external
function templateConfigToString(config) {
  var out = [];
  for (var key in config) {
    out.push(chalk.bold(changeCase.upperCaseFirst(key)) + ': ' + config[key]);
  }
  return out.join('\n') + '\n';
}
github cai3178940 / youran / youran-generate-ui / src / utils / common-plugin.js View on Github external
update: function (el, binding, vnode) {
        const value = vnode.data.model.value
        vnode.data.model.callback(upperCaseFirst(value))
      }
    })
github joshwcomeau / redux-vcr / packages / replay / scripts / add_component / index.js View on Github external
function run(componentName) {
  if (!componentName) {
    throw new Error(`
      Please supply a component name!
      'npm run add-component -- YourComponentName'
    `);
  } else if (!changeCase.upperCaseFirst(componentName)) {
    throw new Error(`
      Custom React components need to be in PascalCase.
      You provided ${componentName}.
      Please capitalize the first letter!
    `);
  }

  const componentDirectory = path.join(
    __dirname,
    '../../src/components',
    componentName
  );
  createDirectory(componentDirectory);

  const className = changeCase.paramCase(componentName);