Sha256: 1418a0f08e800adcb928a5cef344af3d33bd75b8fd9f670c2bcf9b2d7012908c

Contents?: true

Size: 250 Bytes

Versions: 31

Compression:

Stored size: 250 Bytes

Contents

/**
 * convert dashes and underscore strings into camelCase strings
 * @param {string} str
 * @returns {string}
 */
export function toCamelCase(str) {
  return str
    .split(/-|_/)
    .reduce((a, b) => a + b.charAt(0).toUpperCase() + b.slice(1))
}

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
alchemy_cms-7.3.5 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.8 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.1.13 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.3.4 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.3.3 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.3.2 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.7 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.3.1 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.3.0 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.6 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.5 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.1.12 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.4 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.1.11 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.3 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.1.10 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.2 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.1.9 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.2.1 app/javascript/alchemy_admin/utils/string_conversions.js
alchemy_cms-7.1.8 app/javascript/alchemy_admin/utils/string_conversions.js