@tsed/json-mapper 7.83.3 → 8.0.0-alpha.10

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.
Files changed (99) hide show
  1. package/lib/browser/json-mapper.umd.min.js +1 -1
  2. package/lib/browser/json-mapper.umd.min.js.map +1 -1
  3. package/lib/esm/components/DateMapper.js.map +1 -1
  4. package/lib/esm/components/PrimitiveMapper.js.map +1 -1
  5. package/lib/esm/components/SymbolMapper.js.map +1 -1
  6. package/lib/esm/decorators/jsonMapper.js.map +1 -1
  7. package/lib/esm/decorators/onDeserialize.js.map +1 -1
  8. package/lib/esm/domain/JsonDeserializer.js.map +1 -1
  9. package/lib/esm/domain/JsonMapperCompiler.js.map +1 -1
  10. package/lib/esm/domain/JsonMapperTypesContainer.js.map +1 -1
  11. package/lib/esm/domain/JsonSerializer.js.map +1 -1
  12. package/lib/esm/domain/Writer.js +1 -2
  13. package/lib/esm/domain/Writer.js.map +1 -1
  14. package/lib/esm/utils/deserialize.js.map +1 -1
  15. package/lib/esm/utils/serialize.js.map +1 -1
  16. package/lib/types/utils/deserialize.d.ts +3 -3
  17. package/lib/types/utils/serialize.d.ts +3 -3
  18. package/package.json +19 -16
  19. package/lib/cjs/components/DateMapper.js +0 -30
  20. package/lib/cjs/components/DateMapper.js.map +0 -1
  21. package/lib/cjs/components/PrimitiveMapper.js +0 -64
  22. package/lib/cjs/components/PrimitiveMapper.js.map +0 -1
  23. package/lib/cjs/components/SymbolMapper.js +0 -24
  24. package/lib/cjs/components/SymbolMapper.js.map +0 -1
  25. package/lib/cjs/decorators/afterDeserialize.js +0 -39
  26. package/lib/cjs/decorators/afterDeserialize.js.map +0 -1
  27. package/lib/cjs/decorators/beforeDeserialize.js +0 -39
  28. package/lib/cjs/decorators/beforeDeserialize.js.map +0 -1
  29. package/lib/cjs/decorators/jsonMapper.js +0 -18
  30. package/lib/cjs/decorators/jsonMapper.js.map +0 -1
  31. package/lib/cjs/decorators/onDeserialize.js +0 -29
  32. package/lib/cjs/decorators/onDeserialize.js.map +0 -1
  33. package/lib/cjs/decorators/onSerialize.js +0 -29
  34. package/lib/cjs/decorators/onSerialize.js.map +0 -1
  35. package/lib/cjs/domain/JsonDeserializer.js +0 -295
  36. package/lib/cjs/domain/JsonDeserializer.js.map +0 -1
  37. package/lib/cjs/domain/JsonDeserializerOptions.js +0 -3
  38. package/lib/cjs/domain/JsonDeserializerOptions.js.map +0 -1
  39. package/lib/cjs/domain/JsonMapperCompiler.js +0 -167
  40. package/lib/cjs/domain/JsonMapperCompiler.js.map +0 -1
  41. package/lib/cjs/domain/JsonMapperGlobalOptions.js +0 -3
  42. package/lib/cjs/domain/JsonMapperGlobalOptions.js.map +0 -1
  43. package/lib/cjs/domain/JsonMapperSettings.js +0 -9
  44. package/lib/cjs/domain/JsonMapperSettings.js.map +0 -1
  45. package/lib/cjs/domain/JsonMapperTypesContainer.js +0 -23
  46. package/lib/cjs/domain/JsonMapperTypesContainer.js.map +0 -1
  47. package/lib/cjs/domain/JsonSerializer.js +0 -273
  48. package/lib/cjs/domain/JsonSerializer.js.map +0 -1
  49. package/lib/cjs/domain/JsonSerializerOptions.js +0 -3
  50. package/lib/cjs/domain/JsonSerializerOptions.js.map +0 -1
  51. package/lib/cjs/domain/Writer.js +0 -137
  52. package/lib/cjs/domain/Writer.js.map +0 -1
  53. package/lib/cjs/hooks/alterAfterDeserialize.js +0 -8
  54. package/lib/cjs/hooks/alterAfterDeserialize.js.map +0 -1
  55. package/lib/cjs/hooks/alterBeforeDeserialize.js +0 -8
  56. package/lib/cjs/hooks/alterBeforeDeserialize.js.map +0 -1
  57. package/lib/cjs/hooks/alterOnDeserialize.js +0 -8
  58. package/lib/cjs/hooks/alterOnDeserialize.js.map +0 -1
  59. package/lib/cjs/hooks/alterOnSerialize.js +0 -8
  60. package/lib/cjs/hooks/alterOnSerialize.js.map +0 -1
  61. package/lib/cjs/index.js +0 -32
  62. package/lib/cjs/index.js.map +0 -1
  63. package/lib/cjs/interfaces/JsonMapperMethods.js +0 -3
  64. package/lib/cjs/interfaces/JsonMapperMethods.js.map +0 -1
  65. package/lib/cjs/package.json +0 -3
  66. package/lib/cjs/utils/deserialize.js +0 -13
  67. package/lib/cjs/utils/deserialize.js.map +0 -1
  68. package/lib/cjs/utils/getObjectProperties.js +0 -9
  69. package/lib/cjs/utils/getObjectProperties.js.map +0 -1
  70. package/lib/cjs/utils/serialize.js +0 -13
  71. package/lib/cjs/utils/serialize.js.map +0 -1
  72. package/lib/esm/package.json +0 -3
  73. package/lib/types-esm/components/DateMapper.d.ts +0 -11
  74. package/lib/types-esm/components/PrimitiveMapper.d.ts +0 -18
  75. package/lib/types-esm/components/SymbolMapper.d.ts +0 -11
  76. package/lib/types-esm/decorators/afterDeserialize.d.ts +0 -33
  77. package/lib/types-esm/decorators/beforeDeserialize.d.ts +0 -33
  78. package/lib/types-esm/decorators/jsonMapper.d.ts +0 -7
  79. package/lib/types-esm/decorators/onDeserialize.d.ts +0 -23
  80. package/lib/types-esm/decorators/onSerialize.d.ts +0 -23
  81. package/lib/types-esm/domain/JsonDeserializer.d.ts +0 -33
  82. package/lib/types-esm/domain/JsonDeserializerOptions.d.ts +0 -28
  83. package/lib/types-esm/domain/JsonMapperCompiler.d.ts +0 -60
  84. package/lib/types-esm/domain/JsonMapperGlobalOptions.d.ts +0 -14
  85. package/lib/types-esm/domain/JsonMapperSettings.d.ts +0 -2
  86. package/lib/types-esm/domain/JsonMapperTypesContainer.d.ts +0 -10
  87. package/lib/types-esm/domain/JsonSerializer.d.ts +0 -22
  88. package/lib/types-esm/domain/JsonSerializerOptions.d.ts +0 -14
  89. package/lib/types-esm/domain/Writer.d.ts +0 -43
  90. package/lib/types-esm/hooks/alterAfterDeserialize.d.ts +0 -4
  91. package/lib/types-esm/hooks/alterBeforeDeserialize.d.ts +0 -4
  92. package/lib/types-esm/hooks/alterOnDeserialize.d.ts +0 -2
  93. package/lib/types-esm/hooks/alterOnSerialize.d.ts +0 -2
  94. package/lib/types-esm/index.d.ts +0 -28
  95. package/lib/types-esm/interfaces/JsonMapperMethods.d.ts +0 -28
  96. package/lib/types-esm/utils/deserialize.d.ts +0 -5
  97. package/lib/types-esm/utils/getObjectProperties.d.ts +0 -1
  98. package/lib/types-esm/utils/serialize.d.ts +0 -5
  99. /package/{webpack.config.js → webpack.config.cjs} +0 -0
@@ -1,273 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonSerializer = void 0;
4
- const core_1 = require("@tsed/core");
5
- const schema_1 = require("@tsed/schema");
6
- const alterOnSerialize_js_1 = require("../hooks/alterOnSerialize.js");
7
- const getObjectProperties_js_1 = require("../utils/getObjectProperties.js");
8
- const JsonMapperCompiler_js_1 = require("./JsonMapperCompiler.js");
9
- const JsonMapperSettings_js_1 = require("./JsonMapperSettings.js");
10
- const JsonMapperTypesContainer_js_1 = require("./JsonMapperTypesContainer.js");
11
- const Writer_js_1 = require("./Writer.js");
12
- const getCollectionType = (input) => {
13
- return (0, core_1.isArray)(input) ? "Array" : input instanceof Set ? "Set" : input instanceof Map ? "Map" : undefined;
14
- };
15
- function getBestType(type, obj) {
16
- const dataType = (0, core_1.classOf)(obj);
17
- if (dataType && !(0, core_1.isClassObject)(dataType) && !(0, core_1.isCollection)(obj)) {
18
- return dataType;
19
- }
20
- return type || Object;
21
- }
22
- function varKey(k) {
23
- return `__${k}`;
24
- }
25
- class JsonSerializer extends JsonMapperCompiler_js_1.JsonMapperCompiler {
26
- constructor() {
27
- super();
28
- this.addTypeMapper(Object, this.mapObject.bind(this));
29
- this.addTypeMapper(Array, this.mapArray.bind(this));
30
- this.addTypeMapper(Map, this.mapMap.bind(this));
31
- this.addTypeMapper(Set, this.mapSet.bind(this));
32
- this.addGlobal("mapJSON", this.mapJSON.bind(this));
33
- this.addTypeMapper("ObjectId", (value) => String(value));
34
- }
35
- map(input, options = {}) {
36
- if ((0, core_1.isNil)(input)) {
37
- return input;
38
- }
39
- options = this.mapOptions(options);
40
- const model = getBestType(options.type, input);
41
- const mapper = this.compile(model, options.groups);
42
- return mapper.fn(input, this.createContext(options));
43
- }
44
- alterValue(schemaId, value, options) {
45
- return (0, alterOnSerialize_js_1.alterOnSerialize)(this.schemes[schemaId], value, options);
46
- }
47
- createMapper(model, id, groups) {
48
- const entity = schema_1.JsonEntityStore.from(model);
49
- const properties = new Set();
50
- const schemaProperties = [...(0, schema_1.getPropertiesStores)(entity).values()];
51
- const writer = new Writer_js_1.Writer().arrow("input", "options");
52
- writer.if("isNil(input)").return("input");
53
- // prepare options
54
- writer.const("obj", "{}");
55
- writer.set("options", "{...options, self: input}");
56
- // detect some special case
57
- writer.add(this.mapPrecondition(id));
58
- if (!schemaProperties.length) {
59
- return writer.return("isObject(input) ? {...input} : input").root().toString();
60
- }
61
- // properties
62
- writer.add(...schemaProperties.flatMap((propertyStore) => {
63
- properties.add(propertyStore.propertyKey);
64
- if ((propertyStore.schema?.$ignore && (0, core_1.isBoolean)(propertyStore.schema?.$ignore)) ||
65
- (propertyStore.schema?.$hooks?.has("groups") && this.alterGroups(propertyStore.schema, groups))) {
66
- return;
67
- }
68
- return this.mapProperty(propertyStore, id, groups);
69
- }));
70
- // discriminator
71
- writer.add(this.mapDiscriminatorKeyValue(entity));
72
- // additional properties
73
- writer.add(this.mapAdditionalProperties(entity, properties));
74
- return writer.return("obj").root().toString();
75
- }
76
- mapOptions({ groups, useAlias = true, types, ...options }) {
77
- const customMappers = {};
78
- types = types || (0, JsonMapperTypesContainer_js_1.getJsonMapperTypes)();
79
- types.forEach((mapper, model) => {
80
- if (![Array, Set, Map].includes(model)) {
81
- this.addTypeMapper(model, (value, options) => mapper.serialize(value, {
82
- ...options,
83
- type: model
84
- }));
85
- }
86
- });
87
- const strictGroups = options.strictGroups ?? JsonMapperSettings_js_1.JsonMapperSettings.strictGroups;
88
- return {
89
- ...options,
90
- groups: groups === undefined ? (strictGroups ? [] : false) : groups || false,
91
- useAlias,
92
- customMappers
93
- };
94
- }
95
- mapProperty(propertyStore, id, groups) {
96
- const key = String(propertyStore.propertyKey);
97
- const aliasKey = String(propertyStore.parent.schema.getAliasOf(key) || key);
98
- const schemaId = this.getSchemaId(id, key);
99
- const format = propertyStore.itemSchema.get("format");
100
- const formatOpts = format && `options: {format: '${format}'}`;
101
- let writer = new Writer_js_1.Writer().add(`// Map ${key} ${id} ${groups || ""}`);
102
- // ignore hook (deprecated)
103
- if (propertyStore.schema?.$hooks?.has("ignore")) {
104
- this.schemes[schemaId] = propertyStore.schema;
105
- writer = writer.if(`!alterIgnore('${schemaId}', {...options, self: input})`);
106
- }
107
- // pre hook
108
- const hasSerializer = propertyStore.schema?.$hooks?.has("onSerialize");
109
- let getter = `input.${key}`;
110
- if (hasSerializer) {
111
- this.schemes[schemaId] = propertyStore.schema;
112
- const opts = Writer_js_1.Writer.options(formatOpts);
113
- getter = `alterValue('${schemaId}', input.${key}, ${opts})`;
114
- }
115
- writer = writer.set(`let ${varKey(key)}`, getter).if(`${varKey(key)} !== undefined`);
116
- const fill = this.getPropertyFiller(propertyStore, key, groups, formatOpts);
117
- if (hasSerializer) {
118
- fill(writer.if(`${varKey(key)} === input.${key}`));
119
- }
120
- else {
121
- fill(writer);
122
- }
123
- if (aliasKey !== key) {
124
- writer.set(`obj[options.useAlias ? '${aliasKey}' : '${key}']`, varKey(key));
125
- }
126
- else {
127
- writer.set(`obj.${key}`, varKey(key));
128
- }
129
- return writer.root();
130
- }
131
- getPropertyFiller(propertyStore, key, groups, formatOpts) {
132
- const isGeneric = propertyStore.itemSchema.isGeneric;
133
- const hasDiscriminator = propertyStore.itemSchema.hasDiscriminator;
134
- if (propertyStore.isCollection) {
135
- const type = propertyStore.getBestType();
136
- let nestedMapper;
137
- if (hasDiscriminator) {
138
- const targetName = propertyStore.parent.targetName;
139
- nestedMapper = this.compile(`Discriminator:${targetName}:${key}`, groups, {
140
- mapper: () => this.createDiscriminatorMapper(propertyStore, groups)
141
- });
142
- }
143
- else {
144
- nestedMapper = isGeneric ? { id: "" } : this.compile(type, groups);
145
- }
146
- return (writer) => writer.callMapper((0, core_1.nameOf)(propertyStore.collectionType), varKey(key), `id: '${nestedMapper.id}'`, formatOpts);
147
- }
148
- if (isGeneric) {
149
- return (writer) => writer.set(varKey(key), `compileAndMap(${varKey(key)}, options)`);
150
- }
151
- let nestedMapper;
152
- if (hasDiscriminator) {
153
- const targetName = propertyStore.parent.targetName;
154
- nestedMapper = this.compile(`Discriminator:${targetName}:${key}`, groups, {
155
- mapper: () => this.createDiscriminatorMapper(propertyStore, groups)
156
- });
157
- }
158
- else {
159
- nestedMapper = this.compile(propertyStore.getBestType(), groups);
160
- }
161
- return (writer) => writer.callMapper(nestedMapper.id, varKey(key), formatOpts);
162
- }
163
- createDiscriminatorMapper(propertyStore, groups) {
164
- const discriminator = propertyStore.itemSchema.discriminator();
165
- const writer = new Writer_js_1.Writer().arrow("input", "options");
166
- const sw = writer.switch(`nameOf(classOf(input))`);
167
- discriminator.values.forEach((value, kind) => {
168
- const nestedMapper = this.compile(value, groups);
169
- sw.case(`'${(0, core_1.nameOf)(value)}'`).returnCallMapper(nestedMapper.id, "input");
170
- });
171
- return writer.root().toString();
172
- }
173
- mapPrecondition(id) {
174
- const writer = new Writer_js_1.Writer();
175
- writer.if("input && isCollection(input)").return(Writer_js_1.Writer.mapperFrom("input", `{...options, id: '${id}'}`));
176
- writer.if("hasJsonMethod(input)").return(`mapJSON(input, {...options, id: '${id}'})`);
177
- return writer;
178
- }
179
- mapDiscriminatorKeyValue(entity) {
180
- if (entity.discriminatorAncestor) {
181
- const discriminator = entity.discriminatorAncestor.schema.discriminator();
182
- const type = discriminator.getDefaultValue(entity.target);
183
- if (type) {
184
- const writer = new Writer_js_1.Writer();
185
- writer.if(`!obj.${discriminator.propertyName}`).set(`obj.${discriminator.propertyName}`, `'${type}'`);
186
- return writer;
187
- }
188
- }
189
- }
190
- mapAdditionalProperties(entity, properties) {
191
- const additionalProperties = !!entity.schema.get("additionalProperties");
192
- if (additionalProperties) {
193
- const exclude = [...properties.values()].map((key) => `'${key}'`).join(", ");
194
- const writer = new Writer_js_1.Writer();
195
- writer.add("// add additional properties");
196
- writer.each("objectKeys(input)", ["key"]).if(`![${exclude}].includes(key)`).set("obj[key]", "input[key]");
197
- return writer;
198
- }
199
- }
200
- mapObject(input, { type, ...options }) {
201
- if ((input && (0, core_1.isPrimitive)(input)) || !input) {
202
- // prevent mongoose mapping error
203
- return input;
204
- }
205
- if (input && (0, core_1.isCollection)(input)) {
206
- return this.execMapper(getCollectionType(input), input, options);
207
- }
208
- if ((0, core_1.hasJsonMethod)(input)) {
209
- return this.mapJSON(input, options);
210
- }
211
- return (0, getObjectProperties_js_1.getObjectProperties)(input)
212
- .filter(([, value]) => value !== undefined)
213
- .reduce((obj, [key, value]) => {
214
- if ((0, core_1.isNil)(value)) {
215
- return {
216
- ...obj,
217
- [key]: value
218
- };
219
- }
220
- const mapper = this.compile((0, core_1.classOf)(value), options.groups);
221
- return {
222
- ...obj,
223
- [key]: mapper.fn(value, options)
224
- };
225
- }, {});
226
- }
227
- mapSet(input, options) {
228
- if ((0, core_1.isNil)(input)) {
229
- return input;
230
- }
231
- return [...input.values()].map((item) => {
232
- return this.mapItem(item, options);
233
- });
234
- }
235
- mapArray(input, options) {
236
- if ((0, core_1.isNil)(input)) {
237
- return input;
238
- }
239
- return [].concat(input).map((item) => {
240
- return this.mapItem(item, options);
241
- });
242
- }
243
- mapMap(input, options) {
244
- if ((0, core_1.isNil)(input)) {
245
- return input;
246
- }
247
- return [...input.entries()].reduce((obj, [key, item]) => {
248
- return {
249
- ...obj,
250
- [key]: this.mapItem(item, options)
251
- };
252
- }, {});
253
- }
254
- mapItem(input, { id, ...options }) {
255
- if (!id && input) {
256
- return this.compile((0, core_1.classOf)(input), options.groups).fn(input, options);
257
- }
258
- return id ? this.execMapper(id, input, options) : input;
259
- }
260
- mapJSON(input, { id, ...options }) {
261
- if ((0, core_1.isMongooseObject)(input)) {
262
- return input.toJSON({ ...options, id });
263
- }
264
- id = id || (0, core_1.nameOf)((0, core_1.classOf)(input));
265
- if (this.mappers[id] && ((0, core_1.isDate)(input) || (0, core_1.isMomentObject)(input))) {
266
- return this.execMapper(id, input, options);
267
- }
268
- input = input.toJSON();
269
- return (0, core_1.isObject)(input) ? this.execMapper(id, input, options) : input;
270
- }
271
- }
272
- exports.JsonSerializer = JsonSerializer;
273
- //# sourceMappingURL=JsonSerializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonSerializer.js","sourceRoot":"","sources":["../../../src/domain/JsonSerializer.ts"],"names":[],"mappings":";;;AAAA,qCAeoB;AACpB,yCAAqG;AACrG,sEAA8D;AAC9D,4EAAoE;AACpE,mEAA2D;AAC3D,mEAA2D;AAC3D,+EAAiE;AAEjE,2CAAmC;AAEnC,MAAM,iBAAiB,GAAG,CAAC,KAAU,EAAE,EAAE;IACvC,OAAO,IAAA,cAAO,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5G,CAAC,CAAC;AAEF,SAAS,WAAW,CAAC,IAAe,EAAE,GAAQ;IAC5C,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,CAAC;IAE9B,IAAI,QAAQ,IAAI,CAAC,IAAA,oBAAa,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAA,mBAAY,EAAC,GAAG,CAAC,EAAE;QAC9D,OAAO,QAAQ,CAAC;KACjB;IAED,OAAO,IAAI,IAAI,MAAM,CAAC;AACxB,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,KAAK,CAAC,EAAE,CAAC;AAClB,CAAC;AAED,MAAa,cAAe,SAAQ,0CAAyC;IAC3E;QACE,KAAK,EAAE,CAAC;QAER,I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AAC,KAAK,CAAC,EAAE;YAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,EAAC,GAAG,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;SACvC;QAED,EAAE,GAAG,EAAE,IAAI,IAAA,aAAM,EAAC,IAAA,cAAO,EAAC,KAAK,CAAC,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,IAAA,aAAM,EAAC,KAAK,CAAC,IAAI,IAAA,qBAAc,EAAC,KAAK,CAAC,CAAC,EAAE;YAChE,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;SAC5C;QAED,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAEvB,OAAO,IAAA,eAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvE,CAAC;CACF;AAtUD,wCAsUC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=JsonSerializerOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonSerializerOptions.js","sourceRoot":"","sources":["../../../src/domain/JsonSerializerOptions.ts"],"names":[],"mappings":""}
@@ -1,137 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Writer = void 0;
4
- class Writer {
5
- static { this.object = {
6
- assign(...args) {
7
- return `{ ${args.filter(Boolean).join(", ")} }`;
8
- }
9
- }; }
10
- constructor(root) {
11
- this.body = [];
12
- this._root = root;
13
- }
14
- static indent(lines) {
15
- return lines.map((p) => `\t${p}`);
16
- }
17
- static mapper(mapperId, key, options) {
18
- return `execMapper('${mapperId}', ${key}, ${options})`;
19
- }
20
- static mapperFrom(key, options) {
21
- return `execMapper(nameOf(classOf(${key})), ${key}, ${options})`;
22
- }
23
- static options(...args) {
24
- args = args.filter(Boolean);
25
- return !args.length ? "options" : Writer.object.assign("...options", ...args);
26
- }
27
- add(...lines) {
28
- lines = lines.filter((line) => line !== undefined);
29
- lines.length && this.body.push(...lines);
30
- return this;
31
- }
32
- arrow(...args) {
33
- this.add(`(${args}) => {`);
34
- const writer = this.new();
35
- this.add("}");
36
- return writer;
37
- }
38
- build() {
39
- const result = this.body.flatMap((line) => {
40
- return line instanceof Writer ? line.build() : line;
41
- });
42
- return this._indent ? result.map((item) => "\t" + item) : result;
43
- }
44
- callMapper(id, key, ...options) {
45
- return this.set(key, Writer.mapper(id, key, Writer.options(...options)));
46
- }
47
- returnCallMapper(id, key, ...options) {
48
- return this.return(Writer.mapper(id, key, Writer.options(...options)));
49
- }
50
- const(name, line) {
51
- this.add(`const ${name} = ${line};`);
52
- return this;
53
- }
54
- each(iterable, args = []) {
55
- const writer = this.add(iterable + ".forEach((" + args.join(", ") + ") => {").new();
56
- this.add("});");
57
- return writer;
58
- }
59
- if(condition) {
60
- const writer = new IfWriter(condition, this);
61
- this.add(writer);
62
- return writer;
63
- }
64
- switch(input) {
65
- const sw = new SwitchWriter(input);
66
- this.add(sw);
67
- return sw;
68
- }
69
- indent(indent) {
70
- this._indent = indent;
71
- return this;
72
- }
73
- new(indent = true) {
74
- const writer = new Writer(this.root());
75
- writer.indent(indent);
76
- this.add(writer);
77
- return writer;
78
- }
79
- return(line) {
80
- this.add(`return ${line};`);
81
- return this.root();
82
- }
83
- root() {
84
- return this._root || this;
85
- }
86
- set(left, right) {
87
- this.add(`${left} = ${right};`);
88
- return this;
89
- }
90
- toString() {
91
- return this.build().join("\n");
92
- }
93
- }
94
- exports.Writer = Writer;
95
- class IfWriter extends Writer {
96
- constructor(condition, root) {
97
- super();
98
- this.condition = condition;
99
- this._root = root;
100
- }
101
- else() {
102
- const writer = new Writer(this._root);
103
- this.elseWriter = writer;
104
- return writer;
105
- }
106
- build() {
107
- return [
108
- `if (${this.condition}) {`,
109
- ...Writer.indent(super.build()),
110
- "}",
111
- this.elseWriter ? [`else {`, ...Writer.indent(this.elseWriter.build()), "}"] : []
112
- ].flat();
113
- }
114
- }
115
- class SwitchWriter extends Writer {
116
- #map;
117
- constructor(input) {
118
- super();
119
- this.input = input;
120
- this.#map = new Map();
121
- }
122
- case(condition) {
123
- const writer = new Writer();
124
- this.#map.set(condition, writer);
125
- return writer;
126
- }
127
- build() {
128
- return [
129
- `switch (${this.input}) {`,
130
- ...Writer.indent(Array.from(this.#map.entries()).flatMap(([condition, writer]) => {
131
- return [condition === "default" ? `${condition}:` : `case ${condition}:`, ...Writer.indent(writer.build())];
132
- })),
133
- "}"
134
- ].flat();
135
- }
136
- }
137
- //# sourceMappingURL=Writer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Writer.js","sourceRoot":"","sources":["../../../src/domain/Writer.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;aACV,WAAM,GAAG;QACd,MAAM,CAAC,GAAG,IAAc;YACtB,OAAO,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,CAAC;KACF,CAAC;IAMF,YAAY,IAAa;QAHf,SAAI,GAAwB,EAAE,CAAC;QAIvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAe;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,QAAgB,EAAE,GAAW,EAAE,OAAe;QAC1D,OAAO,eAAe,QAAQ,MAAM,GAAG,KAAK,OAAO,GAAG,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAW,EAAE,OAAe;QAC5C,OAAO,6BAA6B,GAAG,OAAO,GAAG,KAAK,OA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CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;SAClF,CAAC,IAAI,EAAE,CAAC;IACX,CAAC;CACF;AAED,MAAM,YAAa,SAAQ,MAAM;IAC/B,IAAI,CAA6B;IAEjC,YAAoB,KAAa;QAC/B,KAAK,EAAE,CAAC;QADU,UAAK,GAAL,KAAK,CAAQ;QAFjC,SAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IAIjC,CAAC;IAED,IAAI,CAAC,SAAiB;QACpB,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK;QACH,OAAO;YACL,WAAW,IAAI,CAAC,KAAK,KAAK;YAC1B,GAAG,MAAM,CAAC,MAAM,CACd,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE;gBAC9D,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC9G,CAAC,CAAC,CACH;YACD,GAAG;SACJ,CAAC,IAAI,EAAE,CAAC;IACX,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alterAfterDeserialize = void 0;
4
- function alterAfterDeserialize(data, schema, options) {
5
- return schema?.$hooks?.alter("afterDeserialize", data, [options]);
6
- }
7
- exports.alterAfterDeserialize = alterAfterDeserialize;
8
- //# sourceMappingURL=alterAfterDeserialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alterAfterDeserialize.js","sourceRoot":"","sources":["../../../src/hooks/alterAfterDeserialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,qBAAqB,CAAC,IAAS,EAAE,MAAuB,EAAE,OAAY;IACpF,OAAO,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,sDAEC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alterBeforeDeserialize = void 0;
4
- function alterBeforeDeserialize(data, schema, options) {
5
- return schema?.$hooks?.alter("beforeDeserialize", data, [options]);
6
- }
7
- exports.alterBeforeDeserialize = alterBeforeDeserialize;
8
- //# sourceMappingURL=alterBeforeDeserialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alterBeforeDeserialize.js","sourceRoot":"","sources":["../../../src/hooks/alterBeforeDeserialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,sBAAsB,CAAC,IAAS,EAAE,MAAuB,EAAE,OAAY;IACrF,OAAO,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,wDAEC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alterOnDeserialize = void 0;
4
- function alterOnDeserialize(schema, value, options) {
5
- return schema.$hooks.alter("onDeserialize", value, [options]);
6
- }
7
- exports.alterOnDeserialize = alterOnDeserialize;
8
- //# sourceMappingURL=alterOnDeserialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alterOnDeserialize.js","sourceRoot":"","sources":["../../../src/hooks/alterOnDeserialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,kBAAkB,CAAC,MAAkB,EAAE,KAAU,EAAE,OAAwB;IACzF,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,gDAEC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alterOnSerialize = void 0;
4
- function alterOnSerialize(schema, value, options) {
5
- return schema.$hooks.alter("onSerialize", value, [options]);
6
- }
7
- exports.alterOnSerialize = alterOnSerialize;
8
- //# sourceMappingURL=alterOnSerialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alterOnSerialize.js","sourceRoot":"","sources":["../../../src/hooks/alterOnSerialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB,CAAC,MAAkB,EAAE,KAAU,EAAE,OAAwB;IACvF,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,4CAEC"}
package/lib/cjs/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /**
5
- * @file Automatically generated by @tsed/barrels.
6
- */
7
- tslib_1.__exportStar(require("./components/DateMapper.js"), exports);
8
- tslib_1.__exportStar(require("./components/PrimitiveMapper.js"), exports);
9
- tslib_1.__exportStar(require("./components/SymbolMapper.js"), exports);
10
- tslib_1.__exportStar(require("./decorators/afterDeserialize.js"), exports);
11
- tslib_1.__exportStar(require("./decorators/beforeDeserialize.js"), exports);
12
- tslib_1.__exportStar(require("./decorators/jsonMapper.js"), exports);
13
- tslib_1.__exportStar(require("./decorators/onDeserialize.js"), exports);
14
- tslib_1.__exportStar(require("./decorators/onSerialize.js"), exports);
15
- tslib_1.__exportStar(require("./domain/JsonDeserializer.js"), exports);
16
- tslib_1.__exportStar(require("./domain/JsonDeserializerOptions.js"), exports);
17
- tslib_1.__exportStar(require("./domain/JsonMapperCompiler.js"), exports);
18
- tslib_1.__exportStar(require("./domain/JsonMapperGlobalOptions.js"), exports);
19
- tslib_1.__exportStar(require("./domain/JsonMapperSettings.js"), exports);
20
- tslib_1.__exportStar(require("./domain/JsonMapperTypesContainer.js"), exports);
21
- tslib_1.__exportStar(require("./domain/JsonSerializer.js"), exports);
22
- tslib_1.__exportStar(require("./domain/JsonSerializerOptions.js"), exports);
23
- tslib_1.__exportStar(require("./domain/Writer.js"), exports);
24
- tslib_1.__exportStar(require("./hooks/alterAfterDeserialize.js"), exports);
25
- tslib_1.__exportStar(require("./hooks/alterBeforeDeserialize.js"), exports);
26
- tslib_1.__exportStar(require("./hooks/alterOnDeserialize.js"), exports);
27
- tslib_1.__exportStar(require("./hooks/alterOnSerialize.js"), exports);
28
- tslib_1.__exportStar(require("./interfaces/JsonMapperMethods.js"), exports);
29
- tslib_1.__exportStar(require("./utils/deserialize.js"), exports);
30
- tslib_1.__exportStar(require("./utils/getObjectProperties.js"), exports);
31
- tslib_1.__exportStar(require("./utils/serialize.js"), exports);
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,qEAA2C;AAC3C,0EAAgD;AAChD,uEAA6C;AAC7C,2EAAiD;AACjD,4EAAkD;AAClD,qEAA2C;AAC3C,wEAA8C;AAC9C,sEAA4C;AAC5C,uEAA6C;AAC7C,8EAAoD;AACpD,yEAA+C;AAC/C,8EAAoD;AACpD,yEAA+C;AAC/C,+EAAqD;AACrD,qEAA2C;AAC3C,4EAAkD;AAClD,6DAAmC;AACnC,2EAAiD;AACjD,4EAAkD;AAClD,wEAA8C;AAC9C,sEAA4C;AAC5C,4EAAkD;AAClD,iEAAuC;AACvC,yEAA+C;AAC/C,+DAAqC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=JsonMapperMethods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonMapperMethods.js","sourceRoot":"","sources":["../../../src/interfaces/JsonMapperMethods.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserialize = void 0;
4
- require("../components/DateMapper");
5
- require("../components/PrimitiveMapper");
6
- require("../components/SymbolMapper");
7
- const JsonDeserializer_js_1 = require("../domain/JsonDeserializer.js");
8
- const deserializer = new JsonDeserializer_js_1.JsonDeserializer();
9
- function deserialize(input, options) {
10
- return deserializer.map(input, options);
11
- }
12
- exports.deserialize = deserialize;
13
- //# sourceMappingURL=deserialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deserialize.js","sourceRoot":"","sources":["../../../src/utils/deserialize.ts"],"names":[],"mappings":";;;AAAA,oCAAkC;AAClC,yCAAuC;AACvC,sCAAoC;AAEpC,uEAA+D;AAG/D,MAAM,YAAY,GAAG,IAAI,sCAAgB,EAAE,CAAC;AAE5C,SAAgB,WAAW,CAAc,KAAU,EAAE,OAAiC;IACpF,OAAO,YAAY,CAAC,GAAG,CAAQ,KAAK,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAFD,kCAEC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getObjectProperties = void 0;
4
- const core_1 = require("@tsed/core");
5
- function getObjectProperties(obj) {
6
- return Object.entries(obj).filter(([, value]) => !(0, core_1.isFunction)(value));
7
- }
8
- exports.getObjectProperties = getObjectProperties;
9
- //# sourceMappingURL=getObjectProperties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getObjectProperties.js","sourceRoot":"","sources":["../../../src/utils/getObjectProperties.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AAEtC,SAAgB,mBAAmB,CAAC,GAAQ;IAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,iBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,kDAEC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serialize = void 0;
4
- require("../components/DateMapper");
5
- require("../components/PrimitiveMapper");
6
- require("../components/SymbolMapper");
7
- const JsonSerializer_js_1 = require("../domain/JsonSerializer.js");
8
- const serializer = new JsonSerializer_js_1.JsonSerializer();
9
- function serialize(input, options) {
10
- return serializer.map(input, options);
11
- }
12
- exports.serialize = serialize;
13
- //# sourceMappingURL=serialize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/utils/serialize.ts"],"names":[],"mappings":";;;AAAA,oCAAkC;AAClC,yCAAuC;AACvC,sCAAoC;AAEpC,mEAA2D;AAG3D,MAAM,UAAU,GAAG,IAAI,kCAAc,EAAE,CAAC;AAExC,SAAgB,SAAS,CAAC,KAAU,EAAE,OAA+B;IACnE,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAFD,8BAEC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,11 +0,0 @@
1
- import { JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
2
- /**
3
- * Mapper for `Date` type.
4
- * @jsonmapper
5
- * @component
6
- */
7
- export declare class DateMapper implements JsonMapperMethods {
8
- deserialize(data: string | number): Date;
9
- deserialize(data: boolean | null | undefined): boolean | null | undefined;
10
- serialize(object: Date): any;
11
- }
@@ -1,18 +0,0 @@
1
- import { JsonMapperCtx, JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
2
- export declare class CastError extends Error {
3
- name: string;
4
- constructor(message: string);
5
- }
6
- /**
7
- * Mapper for the `String`, `Number`, `BigInt` and `Boolean` types.
8
- * @jsonmapper
9
- * @component
10
- */
11
- export declare class PrimitiveMapper implements JsonMapperMethods {
12
- deserialize<T>(data: any, ctx: JsonMapperCtx): string | number | boolean | void | null | BigInt;
13
- serialize(object: string | number | boolean | BigInt, ctx: JsonMapperCtx): string | number | boolean | BigInt;
14
- protected String(data: any): string | null;
15
- protected Boolean(data: any): boolean | null | undefined;
16
- protected Number(data: any): any;
17
- protected BigInt(data: any): bigint | null;
18
- }