backend-manager 3.0.28 → 3.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -116,6 +116,7 @@ BackendAssistant.prototype.init = function (ref, options) {
|
|
|
116
116
|
self.request.type = (self.ref.req.xhr || _.get(self.ref.req, 'headers.accept', '').indexOf('json') > -1) || (_.get(self.ref.req, 'headers.content-type', '').indexOf('json') > -1) ? 'ajax' : 'form';
|
|
117
117
|
self.request.path = (self.ref.req.path || '');
|
|
118
118
|
self.request.user = self.resolveAccount({authenticated: false});
|
|
119
|
+
|
|
119
120
|
if (options.accept === 'json') {
|
|
120
121
|
self.request.body = tryParse(self.ref.req.body || '{}');
|
|
121
122
|
self.request.query = tryParse(self.ref.req.query || '{}');
|
|
@@ -188,16 +189,24 @@ BackendAssistant.prototype.logProd = function () {
|
|
|
188
189
|
BackendAssistant.prototype.log = function () {
|
|
189
190
|
const self = this;
|
|
190
191
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
const args = Array.prototype.slice.call(arguments);
|
|
193
|
+
const last = args[args.length - 1];
|
|
194
|
+
// const override = last && typeof last === 'object' && last.environment === 'production';
|
|
195
|
+
const pop = last?.environment === 'production' || last?.environment === 'development';
|
|
194
196
|
|
|
195
|
-
if (self.meta.environment === 'development' || override) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
// if (self.meta.environment === 'development' || override) {
|
|
198
|
+
// if (override) {
|
|
199
|
+
// args.pop();
|
|
200
|
+
// }
|
|
201
|
+
// self._log.apply(self, args);
|
|
202
|
+
// }
|
|
203
|
+
|
|
204
|
+
// This makes all OLD logs work even if they use the old {environemnt: 'production'} syntax
|
|
205
|
+
if (pop) {
|
|
206
|
+
args.pop();
|
|
200
207
|
}
|
|
208
|
+
|
|
209
|
+
self._log.apply(self, args);
|
|
201
210
|
};
|
|
202
211
|
|
|
203
212
|
BackendAssistant.prototype.error = function () {
|