2016-11-16 01:59:39 +01:00
|
|
|
// Generated by CoffeeScript 1.10.0
|
2016-11-03 01:33:53 +01:00
|
|
|
(function() {
|
2016-11-16 01:59:39 +01:00
|
|
|
"use strict";
|
2016-11-03 01:33:53 +01:00
|
|
|
var prefixMatch;
|
|
|
|
|
|
|
|
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
|
|
|
|
|
|
|
|
exports.normalize = function(str) {
|
|
|
|
return str.toLowerCase();
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.firstCharLowerCase = function(str) {
|
|
|
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.stripPrefix = function(str) {
|
|
|
|
return str.replace(prefixMatch, '');
|
|
|
|
};
|
|
|
|
|
2016-11-16 01:59:39 +01:00
|
|
|
exports.parseNumbers = function(str) {
|
|
|
|
if (!isNaN(str)) {
|
|
|
|
str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.parseBooleans = function(str) {
|
|
|
|
if (/^(?:true|false)$/i.test(str)) {
|
|
|
|
str = str.toLowerCase() === 'true';
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
};
|
|
|
|
|
2016-11-03 01:33:53 +01:00
|
|
|
}).call(this);
|