@iamnnort/nestjs-serializer 1.0.4 → 1.1.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/dist/index.d.mts CHANGED
@@ -14,7 +14,7 @@ declare const SerializeRelation: (configs: {
14
14
  }[]) => (target: object, name: string) => void;
15
15
 
16
16
  declare global {
17
- var transformFieldConfigs: {
17
+ var serializerFieldConfigs: {
18
18
  scopes: string[];
19
19
  relationScopes?: string[];
20
20
  target: Function;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ declare const SerializeRelation: (configs: {
14
14
  }[]) => (target: object, name: string) => void;
15
15
 
16
16
  declare global {
17
- var transformFieldConfigs: {
17
+ var serializerFieldConfigs: {
18
18
  scopes: string[];
19
19
  relationScopes?: string[];
20
20
  target: Function;
package/dist/index.js CHANGED
@@ -8993,11 +8993,11 @@ var require_operators = __commonJS({
8993
8993
  });
8994
8994
 
8995
8995
  // src/decorator.ts
8996
- global.transformFieldConfigs = [];
8996
+ global.serializerFieldConfigs = [];
8997
8997
  var SerializeField = /* @__PURE__ */ __name((configs) => {
8998
8998
  return (target, name) => {
8999
8999
  configs.forEach((config) => {
9000
- global.transformFieldConfigs.push({
9000
+ global.serializerFieldConfigs.push({
9001
9001
  scopes: config.scopes,
9002
9002
  target: target.constructor,
9003
9003
  name,
@@ -9009,7 +9009,7 @@ var SerializeField = /* @__PURE__ */ __name((configs) => {
9009
9009
  var SerializeRelation = /* @__PURE__ */ __name((configs) => {
9010
9010
  return (target, name) => {
9011
9011
  configs.forEach((config) => {
9012
- global.transformFieldConfigs.push({
9012
+ global.serializerFieldConfigs.push({
9013
9013
  scopes: config.scopes,
9014
9014
  relationScopes: config.relationScopes,
9015
9015
  target: target.constructor,
@@ -9085,7 +9085,7 @@ var SerializerService = class {
9085
9085
  if (!entity) {
9086
9086
  return entity;
9087
9087
  }
9088
- const transformFieldConfigs = global.transformFieldConfigs.filter((fieldConfig) => {
9088
+ const serializerFieldConfigs = global.serializerFieldConfigs.filter((fieldConfig) => {
9089
9089
  const isTarget = fieldConfig.target === entity.constructor;
9090
9090
  if (!isTarget) {
9091
9091
  const isGlobalTarget = this.globalEntityNames.includes(fieldConfig.target.name);
@@ -9099,7 +9099,7 @@ var SerializerService = class {
9099
9099
  return isScope;
9100
9100
  });
9101
9101
  let transformedEntity = {};
9102
- await Promise.all(transformFieldConfigs.map(async (fieldConfig) => {
9102
+ await Promise.all(serializerFieldConfigs.map(async (fieldConfig) => {
9103
9103
  const fieldName = fieldConfig.fieldName || fieldConfig.name;
9104
9104
  let fieldValue = await entity[fieldConfig.name];
9105
9105
  if (!_lodash.isNil.call(void 0, fieldConfig.relationScopes)) {