MCPcopy Create free account
hub / github.com/microsoft/SandDance / decamelize

Function decamelize

docs/app/js/sanddance-app.js:6645–6647  ·  view source on GitHub ↗

* Decamelizes a string with/without a custom separator (hyphen by default). * from: https://ourcodeworld.com/articles/read/608/how-to-camelize-and-decamelize-strings-in-javascript * * @param str String in camelcase * @param separator Separator for the new decamelized string.

(str, separator = "-")

Source from the content-addressed store, hash-verified

6643 * @param str String in camelcase
6644 * @param separator Separator for the new decamelized string.
6645 */ function decamelize(str, separator = "-") {
6646 return str.replace(/([a-z\d])([A-Z])/g, "$1" + separator + "$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1" + separator + "$2").toLowerCase();
6647}
6648function createElement(tag, attrs, ...children) {
6649 if (typeof tag === "function") {
6650 const fn = tag;

Callers 1

flattenFunction · 0.70

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected