@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 CHANGED
@@ -9179,7 +9179,6 @@ SerializerService = exports.SerializerService = _ts_decorate([
9179
9179
  ], SerializerService);
9180
9180
 
9181
9181
  // src/interceptor.ts
9182
-
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 _lodash.pick.call(void 0, response, config.fields);
9209
- }
9210
- if (scopes) {
9211
- return this.serializerService.transform(response, {
9212
- scopes,
9213
- fields: config.fields
9214
- });
9206
+ if (!scopes && !config.fields) {
9207
+ return response;
9215
9208
  }
9216
- return response;
9209
+ return this.serializerService.transform(response, {
9210
+ scopes,
9211
+ fields: config.fields
9212
+ });
9217
9213
  }));
9218
9214
  }
9219
9215
  getScopes(ctx) {