nicot 1.1.37 → 1.1.38
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 +12 -8
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -135,14 +135,18 @@ NICOT 提供了一系列 `***Column()` 装饰器,统一处理字段的:
|
|
|
135
135
|
|
|
136
136
|
### 字段类型装饰器(`***Column()`)
|
|
137
137
|
|
|
138
|
-
| 装饰器名
|
|
139
|
-
|
|
140
|
-
| `@StringColumn(len)`
|
|
141
|
-
| `@
|
|
142
|
-
| `@
|
|
143
|
-
| `@
|
|
144
|
-
| `@
|
|
145
|
-
| `@
|
|
138
|
+
| 装饰器名 | 数据类型 | 自动添加的验证与文档 |
|
|
139
|
+
|------------------------|-----------------|---------------------------------------|
|
|
140
|
+
| `@StringColumn(len)` | varchar | `@IsString()` + `@Length()` |
|
|
141
|
+
| `@TextColumn()` | text | `@IsString()` |
|
|
142
|
+
| `@UuidColumn()` | uuid | `@IsUUID()` |
|
|
143
|
+
| `@IntColumn(type)` | int/bigint/... | `@IsInt()` + Swagger number 类型 |
|
|
144
|
+
| `@FloatColumn(type)` | float/decimal | `@IsNumber()` |
|
|
145
|
+
| `@BoolColumn()` | boolean | `@IsBoolean()` |
|
|
146
|
+
| `@DateColumn()` | Date | `@IsDate()` |
|
|
147
|
+
| `@JsonColumn(T)` | 任意对象/数组 (jsonb) | `@IsObject()` / `@ValidateNested()` 等 |
|
|
148
|
+
| `@SimpleJsonColumn(T)` | 任意对象/数组 (json) | `@IsObject()` / `@ValidateNested()` 等 |
|
|
149
|
+
| `@StringJsonColumn(T)` | 任意对象/数组 (text) | `@IsObject()` / `@ValidateNested()` 等 |
|
|
146
150
|
|
|
147
151
|
所有字段装饰器都支持第二个参数 `options`:
|
|
148
152
|
|
package/dist/index.cjs
CHANGED
|
@@ -1370,7 +1370,7 @@ var CrudBase = class {
|
|
|
1370
1370
|
delete o[field];
|
|
1371
1371
|
}
|
|
1372
1372
|
visited.add(o);
|
|
1373
|
-
for (const relation of
|
|
1373
|
+
for (const relation of getTypeormRelations(cl)) {
|
|
1374
1374
|
const propertyName = relation.propertyName;
|
|
1375
1375
|
if (o[propertyName]) {
|
|
1376
1376
|
if (Array.isArray(o[propertyName])) {
|