@iamnnort/nestjs-serializer 1.1.6 → 1.1.7
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/dist/index.js +6 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9179,7 +9179,6 @@ SerializerService = _ts_decorate([
|
|
|
9179
9179
|
], SerializerService);
|
|
9180
9180
|
|
|
9181
9181
|
// src/interceptor.ts
|
|
9182
|
-
import { pick as pick2 } from "lodash";
|
|
9183
9182
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
9184
9183
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9185
9184
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9204,16 +9203,13 @@ var SerializerInterceptor = /* @__PURE__ */ __name((config) => {
|
|
|
9204
9203
|
const scopes = this.getScopes(ctx);
|
|
9205
9204
|
return next.handle().pipe((0, import_operators.map)(async (responsePromise) => {
|
|
9206
9205
|
const response = await responsePromise;
|
|
9207
|
-
if (config.fields) {
|
|
9208
|
-
return
|
|
9206
|
+
if (!scopes && !config.fields) {
|
|
9207
|
+
return response;
|
|
9209
9208
|
}
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
});
|
|
9215
|
-
}
|
|
9216
|
-
return response;
|
|
9209
|
+
return this.serializerService.transform(response, {
|
|
9210
|
+
scopes,
|
|
9211
|
+
fields: config.fields
|
|
9212
|
+
});
|
|
9217
9213
|
}));
|
|
9218
9214
|
}
|
|
9219
9215
|
getScopes(ctx) {
|