node-libcurl
Version:
The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl
30 lines (25 loc) • 1.24 kB
JavaScript
const regexp = /^([A-Z]+)(FUNCTION|CONNECTS|DATA|RESOLVE|VALUE|ALIASES|REDIRS|CERT|KEY|MAX|AGE|REDIR|DELAY|AGENT|OPTIONS|TEXT|USERPWD|PASSWD|LEVEL|SVC|SOCKET|SSL|PUBLIC|LOCATION|LIST|(? convertToDashCase(piece))
.map((item) => (Array.isArray(item) ? item.join('_') : item))
.join('_')
.split('_')
.map((item, idx) =>
idx > 0
? item.charAt(0).toUpperCase() + item.slice(1).toLowerCase()
: item.toLowerCase(),
)
.join('')
}
module.exports = {
convertCurlConstantToCamelCase,
}