This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify-loader/lib/util.js

35 lines
712 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
/**
* Stolen from Vue
* @see https://github.com/vuejs/vue/blob/52719cca/src/shared/util.js
*/
const camelizeRE = /-(\w)/g
const camelize = str => {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '')
}
const capitalize = str => {
return str.charAt(0).toUpperCase() + str.slice(1)
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = str => {
return str.replace(hyphenateRE, '-$1').toLowerCase()
}
function requirePeer (name) {
try {
return require(name)
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') throw e
throw new Error(`Module "${name}" required by "vuetify-loader" not found.`)
}
}
module.exports = {
camelize,
capitalize,
hyphenate,
requirePeer
}