typemold 1.0.1 → 2.0.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 +72 -59
- package/dist/cjs/decorators.js +1 -1
- package/dist/cjs/index.js +5 -8
- package/dist/cjs/mapper.js +1 -1
- package/dist/cjs/nestjs/index.js +1 -1
- package/dist/cjs/nestjs/mapper.module.js +2 -2
- package/dist/cjs/nestjs/mapper.service.js +2 -2
- package/dist/cjs/registry.js +1 -1
- package/dist/cjs/types.js +1 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/esm/decorators.js +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/mapper.js +1 -1
- package/dist/esm/nestjs/index.js +1 -1
- package/dist/esm/nestjs/mapper.module.js +2 -2
- package/dist/esm/nestjs/mapper.service.js +2 -2
- package/dist/esm/registry.js +1 -1
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/types/decorators.d.ts +1 -1
- package/dist/types/index.d.ts +2 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mapper.d.ts +1 -1
- package/dist/types/nestjs/index.d.ts +1 -1
- package/dist/types/nestjs/mapper.module.d.ts +2 -2
- package/dist/types/nestjs/mapper.service.d.ts +1 -1
- package/dist/types/registry.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ A **lightweight**, **high-performance** object mapper for TypeScript & Node.js w
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/typemold)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.npmjs.com/package/typemold)
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
10
|
|
|
@@ -11,20 +12,46 @@ A **lightweight**, **high-performance** object mapper for TypeScript & Node.js w
|
|
|
11
12
|
- 🎯 **Runtime Field Projection** - Pick/omit fields without creating multiple DTOs
|
|
12
13
|
- 📦 **Lightweight** - ~3KB gzipped, zero runtime dependencies
|
|
13
14
|
- 🏷️ **Field Groups** - Define reusable field sets with decorators
|
|
14
|
-
- 🔧 **NestJS Integration** - Full module support with DI
|
|
15
|
+
- 🔧 **NestJS Integration** - Full module support with DI (separate import)
|
|
15
16
|
- ✅ **TypeScript First** - Full strict mode support
|
|
16
17
|
- 🔄 **Hybrid Validation** - Optional class-validator integration
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📦 Installation
|
|
22
|
+
|
|
23
|
+
### Node.js / Express / Fastify
|
|
19
24
|
|
|
20
25
|
```bash
|
|
21
|
-
npm install typemold
|
|
26
|
+
npm install typemold reflect-metadata
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// Usage
|
|
31
|
+
import { Mapper, AutoMap, MapFrom } from "typemold";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### NestJS
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install typemold reflect-metadata
|
|
40
|
+
```
|
|
22
41
|
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
```typescript
|
|
43
|
+
// Core decorators & Mapper
|
|
44
|
+
import { Mapper, AutoMap, MapFrom } from "typemold";
|
|
45
|
+
|
|
46
|
+
// NestJS module & service (separate subpath)
|
|
47
|
+
import { MapperModule, MapperService } from "typemold/nestjs";
|
|
25
48
|
```
|
|
26
49
|
|
|
27
|
-
|
|
50
|
+
> **Note:** NestJS integration requires `@nestjs/common` and `@nestjs/core` (usually already installed in NestJS projects).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🚀 Quick Start
|
|
28
55
|
|
|
29
56
|
### 1. Define Your DTO
|
|
30
57
|
|
|
@@ -58,7 +85,9 @@ const userDto = Mapper.map(userEntity, UserDto);
|
|
|
58
85
|
const userDtos = Mapper.mapArray(users, UserDto);
|
|
59
86
|
```
|
|
60
87
|
|
|
61
|
-
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ⭐ Runtime Field Projection
|
|
62
91
|
|
|
63
92
|
**The killer feature** - reuse a single DTO across multiple endpoints:
|
|
64
93
|
|
|
@@ -67,7 +96,7 @@ const userDtos = Mapper.mapArray(users, UserDto);
|
|
|
67
96
|
Mapper.map(user, UserDto);
|
|
68
97
|
// Result: { username, avatarUrl, isAdult, email }
|
|
69
98
|
|
|
70
|
-
// Only username and avatar
|
|
99
|
+
// Only username and avatar
|
|
71
100
|
Mapper.pick(user, UserDto, ["username", "avatarUrl"]);
|
|
72
101
|
// Result: { username, avatarUrl }
|
|
73
102
|
|
|
@@ -80,7 +109,9 @@ Mapper.map(user, UserDto, { pick: ["username", "avatarUrl"] });
|
|
|
80
109
|
Mapper.map(user, UserDto, { omit: ["email"] });
|
|
81
110
|
```
|
|
82
111
|
|
|
83
|
-
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 🏷️ Field Groups
|
|
84
115
|
|
|
85
116
|
Define reusable field sets:
|
|
86
117
|
|
|
@@ -107,12 +138,11 @@ class UserDto {
|
|
|
107
138
|
Mapper.group(user, UserDto, "minimal"); // { username, avatar }
|
|
108
139
|
Mapper.group(user, UserDto, "public"); // { username, avatar, bio }
|
|
109
140
|
Mapper.group(user, UserDto, "full"); // { bio, email }
|
|
110
|
-
|
|
111
|
-
// Or via options
|
|
112
|
-
Mapper.map(user, UserDto, { group: "minimal" });
|
|
113
141
|
```
|
|
114
142
|
|
|
115
|
-
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 🎨 Decorators
|
|
116
146
|
|
|
117
147
|
| Decorator | Description | Example |
|
|
118
148
|
| ------------------------- | ---------------------------- | ------------------------------------------------ |
|
|
@@ -123,46 +153,20 @@ Mapper.map(user, UserDto, { group: "minimal" });
|
|
|
123
153
|
| `@Ignore()` | Skips property | `@Ignore() internalId: string` |
|
|
124
154
|
| `@NestedType(() => Type)` | Nested object mapping | `@NestedType(() => AddressDto)` |
|
|
125
155
|
|
|
126
|
-
|
|
156
|
+
---
|
|
127
157
|
|
|
128
|
-
|
|
158
|
+
## 🔧 NestJS Integration
|
|
129
159
|
|
|
130
|
-
|
|
131
|
-
import { Module } from "@nestjs/common";
|
|
132
|
-
import { MapperModule } from "typemold";
|
|
160
|
+
> Import from `typemold/nestjs`
|
|
133
161
|
|
|
134
|
-
|
|
135
|
-
imports: [MapperModule.forRoot()], // Global by default
|
|
136
|
-
})
|
|
137
|
-
export class AppModule {}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### With Validation
|
|
162
|
+
### Setup
|
|
141
163
|
|
|
142
164
|
```typescript
|
|
143
|
-
@
|
|
144
|
-
|
|
145
|
-
MapperModule.forRoot({
|
|
146
|
-
enableValidation: true, // Uses class-validator if installed
|
|
147
|
-
}),
|
|
148
|
-
],
|
|
149
|
-
})
|
|
150
|
-
export class AppModule {}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Async Configuration
|
|
165
|
+
import { Module } from "@nestjs/common";
|
|
166
|
+
import { MapperModule } from "typemold/nestjs";
|
|
154
167
|
|
|
155
|
-
```typescript
|
|
156
168
|
@Module({
|
|
157
|
-
imports: [
|
|
158
|
-
MapperModule.forRootAsync({
|
|
159
|
-
imports: [ConfigModule],
|
|
160
|
-
useFactory: (config: ConfigService) => ({
|
|
161
|
-
enableValidation: config.get("ENABLE_VALIDATION"),
|
|
162
|
-
}),
|
|
163
|
-
inject: [ConfigService],
|
|
164
|
-
}),
|
|
165
|
-
],
|
|
169
|
+
imports: [MapperModule.forRoot()],
|
|
166
170
|
})
|
|
167
171
|
export class AppModule {}
|
|
168
172
|
```
|
|
@@ -171,7 +175,7 @@ export class AppModule {}
|
|
|
171
175
|
|
|
172
176
|
```typescript
|
|
173
177
|
import { Injectable } from "@nestjs/common";
|
|
174
|
-
import { MapperService } from "typemold";
|
|
178
|
+
import { MapperService } from "typemold/nestjs";
|
|
175
179
|
|
|
176
180
|
@Injectable()
|
|
177
181
|
export class UserService {
|
|
@@ -182,23 +186,28 @@ export class UserService {
|
|
|
182
186
|
return this.mapper.map(user, UserDto);
|
|
183
187
|
}
|
|
184
188
|
|
|
185
|
-
async getUserMinimal(id: string)
|
|
189
|
+
async getUserMinimal(id: string) {
|
|
186
190
|
const user = await this.userRepo.findOne(id);
|
|
187
191
|
return this.mapper.group(user, UserDto, "minimal");
|
|
188
192
|
}
|
|
189
|
-
|
|
190
|
-
async getPostAuthor(
|
|
191
|
-
postId: string
|
|
192
|
-
): Promise<Pick<UserDto, "username" | "avatar">> {
|
|
193
|
-
const user = await this.getPostUser(postId);
|
|
194
|
-
return this.mapper.pick(user, UserDto, ["username", "avatar"]);
|
|
195
|
-
}
|
|
196
193
|
}
|
|
197
194
|
```
|
|
198
195
|
|
|
199
|
-
|
|
196
|
+
### Async Configuration
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
MapperModule.forRootAsync({
|
|
200
|
+
imports: [ConfigModule],
|
|
201
|
+
useFactory: (config: ConfigService) => ({
|
|
202
|
+
enableValidation: config.get("ENABLE_VALIDATION"),
|
|
203
|
+
}),
|
|
204
|
+
inject: [ConfigService],
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
200
209
|
|
|
201
|
-
|
|
210
|
+
## ⚡ Performance
|
|
202
211
|
|
|
203
212
|
| Operation | typemold | @automapper/nestjs | Manual |
|
|
204
213
|
| ------------ | ---------- | ------------------ | -------- |
|
|
@@ -206,7 +215,9 @@ Thanks to compiled & cached mappers, performance is near-identical to hand-writt
|
|
|
206
215
|
| Array (1000) | ~1.5ms | ~40ms | ~1ms |
|
|
207
216
|
| Memory | O(1) cache | O(n) profiles | None |
|
|
208
217
|
|
|
209
|
-
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 📚 API Reference
|
|
210
221
|
|
|
211
222
|
### Mapper (Static)
|
|
212
223
|
|
|
@@ -216,7 +227,7 @@ Mapper.mapArray(sources, TargetDto, options?)
|
|
|
216
227
|
Mapper.pick(source, TargetDto, ['field1', 'field2'])
|
|
217
228
|
Mapper.omit(source, TargetDto, ['field1'])
|
|
218
229
|
Mapper.group(source, TargetDto, 'groupName')
|
|
219
|
-
Mapper.createMapper(TargetDto, options?)
|
|
230
|
+
Mapper.createMapper(TargetDto, options?)
|
|
220
231
|
```
|
|
221
232
|
|
|
222
233
|
### MapOptions
|
|
@@ -230,6 +241,8 @@ interface MapOptions<T> {
|
|
|
230
241
|
}
|
|
231
242
|
```
|
|
232
243
|
|
|
244
|
+
---
|
|
245
|
+
|
|
233
246
|
## License
|
|
234
247
|
|
|
235
248
|
MIT © [Chetan Joshi](https://github.com/ErrorX407)
|
package/dist/cjs/decorators.js
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
* const public = Mapper.map(user, UserDto, { group: 'public' });
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
|
-
* // NestJS integration (
|
|
34
|
-
* import { MapperModule, MapperService } from 'typemold';
|
|
33
|
+
* // NestJS integration (import from 'typemold/nestjs')
|
|
34
|
+
* import { MapperModule, MapperService } from 'typemold/nestjs';
|
|
35
35
|
*
|
|
36
36
|
* @Module({
|
|
37
37
|
* imports: [MapperModule.forRoot()],
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* export class AppModule {}
|
|
40
40
|
*/
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
42
|
+
exports.isClassInstance = exports.isPlainObject = exports.omitKeys = exports.pickKeys = exports.getNestedValue = exports.MapperFactory = exports.MappingRegistry = exports.METADATA_KEYS = exports.NestedType = exports.Ignore = exports.Groups = exports.createFieldGroups = exports.FieldGroup = exports.AutoMap = exports.createMapping = exports.MapFrom = exports.Mapper = void 0;
|
|
43
43
|
// Core Mapper
|
|
44
44
|
var mapper_1 = require("./mapper");
|
|
45
45
|
Object.defineProperty(exports, "Mapper", { enumerable: true, get: function () { return mapper_1.Mapper; } });
|
|
@@ -67,8 +67,5 @@ Object.defineProperty(exports, "pickKeys", { enumerable: true, get: function ()
|
|
|
67
67
|
Object.defineProperty(exports, "omitKeys", { enumerable: true, get: function () { return utils_1.omitKeys; } });
|
|
68
68
|
Object.defineProperty(exports, "isPlainObject", { enumerable: true, get: function () { return utils_1.isPlainObject; } });
|
|
69
69
|
Object.defineProperty(exports, "isClassInstance", { enumerable: true, get: function () { return utils_1.isClassInstance; } });
|
|
70
|
-
// NestJS
|
|
71
|
-
|
|
72
|
-
Object.defineProperty(exports, "MapperModule", { enumerable: true, get: function () { return nestjs_1.MapperModule; } });
|
|
73
|
-
Object.defineProperty(exports, "MapperService", { enumerable: true, get: function () { return nestjs_1.MapperService; } });
|
|
74
|
-
Object.defineProperty(exports, "MAPPER_OPTIONS", { enumerable: true, get: function () { return nestjs_1.MAPPER_OPTIONS; } });
|
|
70
|
+
// NOTE: NestJS integration is available via 'typemold/nestjs' subpath
|
|
71
|
+
// import { MapperModule, MapperService } from 'typemold/nestjs';
|
package/dist/cjs/mapper.js
CHANGED
package/dist/cjs/nestjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* typemold - NestJS MapperModule
|
|
4
4
|
* Dynamic module for NestJS integration
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -15,7 +15,7 @@ exports.MapperModule = void 0;
|
|
|
15
15
|
const common_1 = require("@nestjs/common");
|
|
16
16
|
const mapper_service_1 = require("./mapper.service");
|
|
17
17
|
/**
|
|
18
|
-
* NestJS Module for
|
|
18
|
+
* NestJS Module for typemold
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* // Basic usage (global by default)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* typemold - NestJS MapperService
|
|
4
4
|
* Injectable service for NestJS dependency injection
|
|
5
5
|
*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -97,7 +97,7 @@ let MapperService = class MapperService {
|
|
|
97
97
|
this.validator = await Promise.resolve().then(() => __importStar(require("class-validator")));
|
|
98
98
|
}
|
|
99
99
|
catch {
|
|
100
|
-
console.warn("[
|
|
100
|
+
console.warn("[typemold] class-validator not found. Validation will be skipped.");
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
/**
|
package/dist/cjs/registry.js
CHANGED
package/dist/cjs/types.js
CHANGED
package/dist/cjs/utils.js
CHANGED
package/dist/esm/decorators.js
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
* const public = Mapper.map(user, UserDto, { group: 'public' });
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
|
-
* // NestJS integration (
|
|
33
|
-
* import { MapperModule, MapperService } from 'typemold';
|
|
32
|
+
* // NestJS integration (import from 'typemold/nestjs')
|
|
33
|
+
* import { MapperModule, MapperService } from 'typemold/nestjs';
|
|
34
34
|
*
|
|
35
35
|
* @Module({
|
|
36
36
|
* imports: [MapperModule.forRoot()],
|
|
@@ -47,5 +47,5 @@ export { METADATA_KEYS, } from "./types";
|
|
|
47
47
|
export { MappingRegistry, MapperFactory } from "./registry";
|
|
48
48
|
// Utilities
|
|
49
49
|
export { getNestedValue, pickKeys, omitKeys, isPlainObject, isClassInstance, } from "./utils";
|
|
50
|
-
// NestJS
|
|
51
|
-
|
|
50
|
+
// NOTE: NestJS integration is available via 'typemold/nestjs' subpath
|
|
51
|
+
// import { MapperModule, MapperService } from 'typemold/nestjs';
|
package/dist/esm/mapper.js
CHANGED
package/dist/esm/nestjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* typemold - NestJS MapperModule
|
|
3
3
|
* Dynamic module for NestJS integration
|
|
4
4
|
*/
|
|
5
5
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -12,7 +12,7 @@ var MapperModule_1;
|
|
|
12
12
|
import { Module, } from "@nestjs/common";
|
|
13
13
|
import { MapperService, MAPPER_OPTIONS, } from "./mapper.service";
|
|
14
14
|
/**
|
|
15
|
-
* NestJS Module for
|
|
15
|
+
* NestJS Module for typemold
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* // Basic usage (global by default)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* typemold - NestJS MapperService
|
|
3
3
|
* Injectable service for NestJS dependency injection
|
|
4
4
|
*/
|
|
5
5
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -61,7 +61,7 @@ let MapperService = class MapperService {
|
|
|
61
61
|
this.validator = await import("class-validator");
|
|
62
62
|
}
|
|
63
63
|
catch {
|
|
64
|
-
console.warn("[
|
|
64
|
+
console.warn("[typemold] class-validator not found. Validation will be skipped.");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
/**
|
package/dist/esm/registry.js
CHANGED
package/dist/esm/types.js
CHANGED
package/dist/esm/utils.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
* const public = Mapper.map(user, UserDto, { group: 'public' });
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
|
-
* // NestJS integration (
|
|
33
|
-
* import { MapperModule, MapperService } from 'typemold';
|
|
32
|
+
* // NestJS integration (import from 'typemold/nestjs')
|
|
33
|
+
* import { MapperModule, MapperService } from 'typemold/nestjs';
|
|
34
34
|
*
|
|
35
35
|
* @Module({
|
|
36
36
|
* imports: [MapperModule.forRoot()],
|
|
@@ -42,5 +42,4 @@ export { MapFrom, createMapping, TypedMappingConfig, PathsOf, AutoMap, FieldGrou
|
|
|
42
42
|
export { Constructor, TransformFn, PropertyPath, MapOptions, MappingContext, TypeConverter, PropertyMappingConfig, CompiledMapper, METADATA_KEYS, } from "./types";
|
|
43
43
|
export { MappingRegistry, MapperFactory } from "./registry";
|
|
44
44
|
export { getNestedValue, pickKeys, omitKeys, isPlainObject, isClassInstance, } from "./utils";
|
|
45
|
-
export { MapperModule, MapperModuleOptions, MapperModuleAsyncOptions, MapperService, MapperServiceOptions, MAPPER_OPTIONS, } from "./nestjs";
|
|
46
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EACL,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,MAAM,EACN,UAAU,GACX,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,eAAe,GAChB,MAAM,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EACL,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,MAAM,EACN,UAAU,GACX,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
package/dist/types/mapper.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* typemold - NestJS MapperModule
|
|
3
3
|
* Dynamic module for NestJS integration
|
|
4
4
|
*/
|
|
5
5
|
import { DynamicModule, Type, InjectionToken, OptionalFactoryDependency } from "@nestjs/common";
|
|
@@ -36,7 +36,7 @@ export interface MapperModuleAsyncOptions {
|
|
|
36
36
|
inject?: Array<InjectionToken | OptionalFactoryDependency>;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* NestJS Module for
|
|
39
|
+
* NestJS Module for typemold
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* // Basic usage (global by default)
|
package/dist/types/registry.d.ts
CHANGED
package/dist/types/types.d.ts
CHANGED
package/dist/types/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typemold",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A lightweight, high-performance object mapper for TypeScript and Node.js with runtime field projection",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Chetan Joshi",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"require": "./dist/cjs/index.js",
|
|
17
17
|
"import": "./dist/esm/index.js",
|
|
18
18
|
"types": "./dist/types/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./nestjs": {
|
|
21
|
+
"require": "./dist/cjs/nestjs/index.js",
|
|
22
|
+
"import": "./dist/esm/nestjs/index.js",
|
|
23
|
+
"types": "./dist/types/nestjs/index.d.ts"
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
26
|
"files": [
|
|
@@ -55,9 +60,9 @@
|
|
|
55
60
|
},
|
|
56
61
|
"homepage": "https://github.com/ErrorX407/typemold#readme",
|
|
57
62
|
"peerDependencies": {
|
|
58
|
-
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
59
63
|
"@nestjs/common": ">=9.0.0",
|
|
60
|
-
"@nestjs/core": ">=9.0.0"
|
|
64
|
+
"@nestjs/core": ">=9.0.0",
|
|
65
|
+
"reflect-metadata": "^0.1.13 || ^0.2.0"
|
|
61
66
|
},
|
|
62
67
|
"peerDependenciesMeta": {
|
|
63
68
|
"@nestjs/common": {
|