Firebase Update

This commit is contained in:
Lukas Nowy
2018-12-22 23:30:39 +01:00
parent befb44764d
commit acffe619b3
11523 changed files with 1614327 additions and 930246 deletions

20
express-server/node_modules/snakeize/index.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
module.exports = function walk (obj) {
if (!obj || typeof obj !== 'object') return obj;
if (isDate(obj) || isRegex(obj)) return obj;
if (Array.isArray(obj)) return obj.map(walk);
return Object.keys(obj).reduce(function (acc, key) {
var camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, function (m, x) {
return '_' + x.toLowerCase();
});
acc[camel] = walk(obj[key]);
return acc;
}, {});
};
var isDate = function (obj) {
return Object.prototype.toString.call(obj) === '[object Date]';
};
var isRegex = function (obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
};