src/support/configuration.js
function DeepDevOrProd (object, prop) {
	let target = object[prop];
	if (Object.keys(target).indexOf('dev') === -1 && typeof target === 'object') {
		for (const deep of Object.keys(target)) {
			DeepDevOrProd(object[prop], deep);
		}
	} else {
		if (Object.keys(target).indexOf('dev') === -1) {
			object[prop] = target;
		} else {
			object[prop] = isDev ? target.dev : /* istanbul ignore next */ target.prod;
		}
	}
}
function DeepDevOrProd (object, prop) {
	let target = object[prop];
	if (Object.keys(target).indexOf('dev') === -1 && typeof target === 'object') {
		for (const deep of Object.keys(target)) {
			DeepDevOrProd(object[prop], deep);
		}
	} else {
		if (Object.keys(target).indexOf('dev') === -1) {
			object[prop] = target;
		} else {
			object[prop] = isDev ? target.dev : /* istanbul ignore next */ target.prod;
		}
	}
}
function DeepDevOrProd ( object , prop ) { let target = object [ prop ] ; if ( Object . keys ( target ) . indexOf ( 'dev' ) === - 1 && typeof target === 'object' ) { for ( const deep of Object . keys ( target ) ) { DeepDevOrProd ( object [ prop ] , deep ) ; } } else { if ( Object . keys ( target ) . indexOf ( 'dev' ) === - 1 ) { object [ prop ] = target ; } else { object [ prop ] = isDev ? target . dev : /* istanbul ignore next */ target . prod ; } } }
Creates an object based on its dev prod properties and merges them accordint to
the current NODE_ENV
This function is recursive and will transform the hole object
@private
@param {Object} object - target object to transform
@param {String} prop - the property to look at
@example {a:{dev:0,prod:1}} if NODE_ENV = 'development' -> {a:0}
Creates an object based on its dev prod properties and merges them accordint to the current NODE_ENV This function is recursive and will transform the hole object