@zenorm/generate 1.6.0 → 1.7.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/CHANGELOG.md +3 -0
- package/dist/generate.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/generate.js
CHANGED
|
@@ -68,7 +68,8 @@ async function generate(tables, cfg) {
|
|
|
68
68
|
structs.push(...props);
|
|
69
69
|
structs.push('');
|
|
70
70
|
// 使用构造器提前初始化对象的属性,用于优化 v8 对象缓存机制
|
|
71
|
-
structs.push(` constructor(data: Partial<${className}Table> = {}) {`);
|
|
71
|
+
structs.push(` constructor(pkval?: ${pkType}, data: Partial<${className}Table> = {}) {`);
|
|
72
|
+
structs.push(` this.__pk = pkval;`);
|
|
72
73
|
for (const c of columns) {
|
|
73
74
|
structs.push(` this.${c} = data.${c};`);
|
|
74
75
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenorm/generate",
|
|
3
3
|
"description": "Easy ORM, easy query. easy typing! Auto generate typescript declaration.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"homepage": "https://zenorm.node.ltd",
|