@iamnnort/nestjs-serializer 2.2.9 → 2.10.0

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/README.md CHANGED
@@ -145,9 +145,7 @@ import { AppController } from './controller';
145
145
  @Module({
146
146
  imports: [
147
147
  LoggerModule,
148
- SerializerModule.register({
149
- globalEntityNames: [Model.name],
150
- }),
148
+ SerializerModule,
151
149
  ],
152
150
  controllers: [AppController],
153
151
  })
package/dist/index.d.mts CHANGED
@@ -27,7 +27,6 @@ type SerializerFieldConfig = {
27
27
  fieldTransform?: (value: any, entity: any) => any | Promise<any>;
28
28
  };
29
29
  type SerializerConfig = {
30
- globalEntityNames?: string[];
31
30
  globalLimitedScopes?: string[];
32
31
  globalSecretScopes?: string[];
33
32
  };
package/dist/index.d.ts CHANGED
@@ -27,7 +27,6 @@ type SerializerFieldConfig = {
27
27
  fieldTransform?: (value: any, entity: any) => any | Promise<any>;
28
28
  };
29
29
  type SerializerConfig = {
30
- globalEntityNames?: string[];
31
30
  globalLimitedScopes?: string[];
32
31
  globalSecretScopes?: string[];
33
32
  };
package/dist/index.js CHANGED
@@ -9110,12 +9110,9 @@ var SerializerService = class {
9110
9110
  return _lodash.pick.call(void 0, entity, config.fields);
9111
9111
  }
9112
9112
  const serializerFieldConfigs = global.serializerFieldConfigs.filter((fieldConfig) => {
9113
- const isTarget = fieldConfig.target === entity.constructor;
9113
+ const isTarget = entity instanceof fieldConfig.target;
9114
9114
  if (!isTarget) {
9115
- const isGlobalTarget = (this.config.globalEntityNames || []).includes(fieldConfig.target.name);
9116
- if (!isGlobalTarget) {
9117
- return false;
9118
- }
9115
+ return false;
9119
9116
  }
9120
9117
  const isScope = fieldConfig.scopes.some((scope) => {
9121
9118
  if (!config.scopes) {