xml.js
Version:
XML.js provides helper functions for XML manipulation, including conversion of documents into [JXON](https://developer.mozilla.org/en-US/docs/JXON) objects. It is built on top of [xmldom](https://www.npmjs.org/package/xmldom) & [xpath](https://www.npmjs.o
20 lines (16 loc) • 501 B
JavaScript
var helper = require("lodash");
var XRegExp = require("xregexp").XRegExp;
helper.mixin({
capitalize: function capitalize(text) {
return text.charAt(0).toUpperCase() + text.slice(1);
},
camelize: function camelize(text) {
return text.replace(XRegExp("[^\\p{L}\\d]+([\\p{L}\\d])", "g"), function(match, letter/*, offset, text*/) {
return letter.toUpperCase();
});
},
isDefined: function isDefined() {
return !helper.isUndefined.apply(this, arguments);
}
});
module.exports = helper;