MCPcopy Create free account
hub / github.com/ampproject/amphtml / dashToPascalCase

Function dashToPascalCase

build-system/tasks/make-extension/index.js:51–53  ·  view source on GitHub ↗

* Convert dash-case-name to PascalCaseName. * @param {string} name * @return {string}

(name)

Source from the content-addressed store, hash-verified

49 * @return {string}
50 */
51function dashToPascalCase(name) {
52 return name.replace(/(?:-|^)([a-z])/g, (_, c) => c.toUpperCase());
53}
54
55/**
56 * Replaces from a map of keys/values.

Callers 1

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected