Nuxt/packages/utils/src/context.js
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

17 lines
409 B
JavaScript

export const getContext = function getContext (req, res) {
return { req, res }
}
export const determineGlobals = function determineGlobals (globalName, globals) {
const _globals = {}
for (const global in globals) {
if (typeof globals[global] === 'function') {
_globals[global] = globals[global](globalName)
} else {
_globals[global] = globals[global]
}
}
return _globals
}