UNPKG

qoopido.nucleus

Version:

Lightweight, atomic and modular JavaScript utility library that strongly encourages the creation and usage of small yet flexible, reusable and easily maintainable modules.

27 lines (22 loc) 579 B
/** * @require ../string/lcfirst * @require ../string/ucfirst */ (function() { 'use strict'; function definition(lcfirst, ucfirst) { var regexMatchPrefix = /^-?(?:webkit|khtml|icab|moz|ms|o)([A-Z]|-[a-z])/, regexMatchHyphens = /-([a-z])/gi; function callback(full, first) { return ucfirst(first); } return function functionPropertyUnify(value) { return lcfirst( lcfirst(value) .replace(regexMatchPrefix, '$1') .replace(regexMatchHyphens, callback) ); }; } provide([ '../string/lcfirst', '../string/ucfirst' ], definition); }());