0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/server/overrides.js
Katharina Irrgang 54559f24f9 fix: memory leak (#7291)
closes #7189

- downgrade lodash to 3.x
- downgrade bookshelf to 0.9.x
- downgrade knex to 0.10.x
- keep lodash 4.x functions
2016-09-01 10:53:08 +02:00

27 lines
938 B
JavaScript

var moment = require('moment-timezone'),
_ = require('lodash'),
toPairs = require('lodash.topairs'),
fromPairs = require('lodash.frompairs'),
toString = require('lodash.tostring'),
pickBy = require('lodash.pickby'),
uniqBy = require('lodash.uniqby'),
omitBy = require('lodash.omitby');
/**
* force UTC
* - you can require moment or moment-timezone, both is configured to UTC
* - you are allowed to use new Date() to instantiate datetime values for models, because they are transformed into UTC in the model layer
* - be careful when not working with models, every value from the native JS Date is local TZ
* - be careful when you work with date operations, therefor always wrap a date into moment
*/
moment.tz.setDefault('UTC');
/**
* lodash 4.x functions we use
*/
_.toPairs = toPairs;
_.fromPairs = fromPairs;
_.toString = toString;
_.omitBy = omitBy;
_.uniqBy = uniqBy;
_.pickBy = pickBy;