@k3000/store 0.6.0 → 0.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/generator.mjs +24 -0
- package/package.json +1 -1
- package/test/1/index +0 -0
- package/test/2/index +0 -0
- package/test/2/type.ts +32 -0
- package/test/3/data +0 -0
- package/test/3/index +0 -0
- package/test/3/type.ts +32 -0
- package/test/4/data +0 -0
- package/test/4/index +0 -0
- package/test/4/type.ts +32 -0
- package/test/5/data +0 -0
- package/test/5/index +0 -0
- package/test/5/type.ts +32 -0
- package/test/6/data +0 -0
- package/test/6/index +0 -0
- package/test/6/type.ts +24 -0
- package/test/7/data +0 -0
- package/test/7/index +0 -0
- package/test/7/type.ts +24 -0
- package/test.mjs +3 -1
package/generator.mjs
CHANGED
|
@@ -761,6 +761,22 @@ const commentRemark = (remark = '') => remark.replace(/\n/g, '\n\t * ')
|
|
|
761
761
|
|
|
762
762
|
function submit() {
|
|
763
763
|
|
|
764
|
+
if (this.updateSet.size) {
|
|
765
|
+
|
|
766
|
+
this.curr.record.pointer = 0
|
|
767
|
+
|
|
768
|
+
for (const key of Object.keys(this.curr.record.idle)) {
|
|
769
|
+
|
|
770
|
+
this.curr.record.idle[key] = []
|
|
771
|
+
this.curr.record.record[key] = []
|
|
772
|
+
|
|
773
|
+
for (const k of Object.keys(this.curr.record.index[key])) {
|
|
774
|
+
|
|
775
|
+
this.curr.record.index[key][k] = []
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
764
780
|
this.curr.updateStruct(this.curr.struct)
|
|
765
781
|
this.curr.updateRecord(this.curr.record)
|
|
766
782
|
|
|
@@ -1181,6 +1197,14 @@ interface ${key}Set extends Array<${key}> {
|
|
|
1181
1197
|
indexBy${Key}({after, before}): Array<${key}>` : `
|
|
1182
1198
|
indexBy${Key}(${k}: ${gen.type[value.type]}): Array<${key}>`
|
|
1183
1199
|
}).join('')}
|
|
1200
|
+
/**
|
|
1201
|
+
* 重写push方法
|
|
1202
|
+
*/
|
|
1203
|
+
push(...item: Array<${key}>): Array<${key}>
|
|
1204
|
+
/**
|
|
1205
|
+
* 重写unshift方法
|
|
1206
|
+
*/
|
|
1207
|
+
unshift(...item: Array<${key}>): Array<${key}>
|
|
1184
1208
|
/**
|
|
1185
1209
|
* 分页查询
|
|
1186
1210
|
*/
|
package/package.json
CHANGED
package/test/1/index
CHANGED
|
Binary file
|
package/test/2/index
CHANGED
|
Binary file
|
package/test/2/type.ts
CHANGED
|
@@ -29,6 +29,14 @@ interface AdminSet extends Array<Admin> {
|
|
|
29
29
|
indexByUid(uid: String): Array<Admin>
|
|
30
30
|
indexByValid(valid: Number): Array<Admin>
|
|
31
31
|
indexByTime({after, before}): Array<Admin>
|
|
32
|
+
/**
|
|
33
|
+
* 重写push方法
|
|
34
|
+
*/
|
|
35
|
+
push(...item: Array<Admin>): Array<Admin>
|
|
36
|
+
/**
|
|
37
|
+
* 重写unshift方法
|
|
38
|
+
*/
|
|
39
|
+
unshift(...item: Array<Admin>): Array<Admin>
|
|
32
40
|
/**
|
|
33
41
|
* 分页查询
|
|
34
42
|
*/
|
|
@@ -76,6 +84,14 @@ interface LogSet extends Array<Log> {
|
|
|
76
84
|
indexById(id: Number): Array<Log>
|
|
77
85
|
indexByUid(uid: String): Array<Log>
|
|
78
86
|
indexByTime({after, before}): Array<Log>
|
|
87
|
+
/**
|
|
88
|
+
* 重写push方法
|
|
89
|
+
*/
|
|
90
|
+
push(...item: Array<Log>): Array<Log>
|
|
91
|
+
/**
|
|
92
|
+
* 重写unshift方法
|
|
93
|
+
*/
|
|
94
|
+
unshift(...item: Array<Log>): Array<Log>
|
|
79
95
|
/**
|
|
80
96
|
* 分页查询
|
|
81
97
|
*/
|
|
@@ -141,6 +157,14 @@ interface Test {
|
|
|
141
157
|
interface TestSet extends Array<Test> {
|
|
142
158
|
|
|
143
159
|
indexById(id: Number): Array<Test>
|
|
160
|
+
/**
|
|
161
|
+
* 重写push方法
|
|
162
|
+
*/
|
|
163
|
+
push(...item: Array<Test>): Array<Test>
|
|
164
|
+
/**
|
|
165
|
+
* 重写unshift方法
|
|
166
|
+
*/
|
|
167
|
+
unshift(...item: Array<Test>): Array<Test>
|
|
144
168
|
/**
|
|
145
169
|
* 分页查询
|
|
146
170
|
*/
|
|
@@ -182,6 +206,14 @@ interface Test2 {
|
|
|
182
206
|
|
|
183
207
|
interface Test2Set extends Array<Test2> {
|
|
184
208
|
|
|
209
|
+
/**
|
|
210
|
+
* 重写push方法
|
|
211
|
+
*/
|
|
212
|
+
push(...item: Array<Test2>): Array<Test2>
|
|
213
|
+
/**
|
|
214
|
+
* 重写unshift方法
|
|
215
|
+
*/
|
|
216
|
+
unshift(...item: Array<Test2>): Array<Test2>
|
|
185
217
|
/**
|
|
186
218
|
* 分页查询
|
|
187
219
|
*/
|
package/test/3/data
CHANGED
|
Binary file
|
package/test/3/index
CHANGED
|
Binary file
|
package/test/3/type.ts
CHANGED
|
@@ -29,6 +29,14 @@ interface AdminSet extends Array<Admin> {
|
|
|
29
29
|
indexByUid(uid: String): Array<Admin>
|
|
30
30
|
indexByValid(valid: Number): Array<Admin>
|
|
31
31
|
indexByTime({after, before}): Array<Admin>
|
|
32
|
+
/**
|
|
33
|
+
* 重写push方法
|
|
34
|
+
*/
|
|
35
|
+
push(...item: Array<Admin>): Array<Admin>
|
|
36
|
+
/**
|
|
37
|
+
* 重写unshift方法
|
|
38
|
+
*/
|
|
39
|
+
unshift(...item: Array<Admin>): Array<Admin>
|
|
32
40
|
/**
|
|
33
41
|
* 分页查询
|
|
34
42
|
*/
|
|
@@ -76,6 +84,14 @@ interface LogSet extends Array<Log> {
|
|
|
76
84
|
indexById(id: Number): Array<Log>
|
|
77
85
|
indexByUid(uid: String): Array<Log>
|
|
78
86
|
indexByTime({after, before}): Array<Log>
|
|
87
|
+
/**
|
|
88
|
+
* 重写push方法
|
|
89
|
+
*/
|
|
90
|
+
push(...item: Array<Log>): Array<Log>
|
|
91
|
+
/**
|
|
92
|
+
* 重写unshift方法
|
|
93
|
+
*/
|
|
94
|
+
unshift(...item: Array<Log>): Array<Log>
|
|
79
95
|
/**
|
|
80
96
|
* 分页查询
|
|
81
97
|
*/
|
|
@@ -141,6 +157,14 @@ interface Test {
|
|
|
141
157
|
interface TestSet extends Array<Test> {
|
|
142
158
|
|
|
143
159
|
indexById(id: Number): Array<Test>
|
|
160
|
+
/**
|
|
161
|
+
* 重写push方法
|
|
162
|
+
*/
|
|
163
|
+
push(...item: Array<Test>): Array<Test>
|
|
164
|
+
/**
|
|
165
|
+
* 重写unshift方法
|
|
166
|
+
*/
|
|
167
|
+
unshift(...item: Array<Test>): Array<Test>
|
|
144
168
|
/**
|
|
145
169
|
* 分页查询
|
|
146
170
|
*/
|
|
@@ -186,6 +210,14 @@ interface Test2 {
|
|
|
186
210
|
|
|
187
211
|
interface Test2Set extends Array<Test2> {
|
|
188
212
|
|
|
213
|
+
/**
|
|
214
|
+
* 重写push方法
|
|
215
|
+
*/
|
|
216
|
+
push(...item: Array<Test2>): Array<Test2>
|
|
217
|
+
/**
|
|
218
|
+
* 重写unshift方法
|
|
219
|
+
*/
|
|
220
|
+
unshift(...item: Array<Test2>): Array<Test2>
|
|
189
221
|
/**
|
|
190
222
|
* 分页查询
|
|
191
223
|
*/
|
package/test/4/data
CHANGED
|
Binary file
|
package/test/4/index
CHANGED
|
Binary file
|
package/test/4/type.ts
CHANGED
|
@@ -29,6 +29,14 @@ interface AdminSet extends Array<Admin> {
|
|
|
29
29
|
indexByUid(uid: String): Array<Admin>
|
|
30
30
|
indexByValid(valid: Number): Array<Admin>
|
|
31
31
|
indexByTime({after, before}): Array<Admin>
|
|
32
|
+
/**
|
|
33
|
+
* 重写push方法
|
|
34
|
+
*/
|
|
35
|
+
push(...item: Array<Admin>): Array<Admin>
|
|
36
|
+
/**
|
|
37
|
+
* 重写unshift方法
|
|
38
|
+
*/
|
|
39
|
+
unshift(...item: Array<Admin>): Array<Admin>
|
|
32
40
|
/**
|
|
33
41
|
* 分页查询
|
|
34
42
|
*/
|
|
@@ -76,6 +84,14 @@ interface LogSet extends Array<Log> {
|
|
|
76
84
|
indexById(id: Number): Array<Log>
|
|
77
85
|
indexByUid(uid: String): Array<Log>
|
|
78
86
|
indexByTime({after, before}): Array<Log>
|
|
87
|
+
/**
|
|
88
|
+
* 重写push方法
|
|
89
|
+
*/
|
|
90
|
+
push(...item: Array<Log>): Array<Log>
|
|
91
|
+
/**
|
|
92
|
+
* 重写unshift方法
|
|
93
|
+
*/
|
|
94
|
+
unshift(...item: Array<Log>): Array<Log>
|
|
79
95
|
/**
|
|
80
96
|
* 分页查询
|
|
81
97
|
*/
|
|
@@ -141,6 +157,14 @@ interface Test {
|
|
|
141
157
|
interface TestSet extends Array<Test> {
|
|
142
158
|
|
|
143
159
|
indexById(id: Number): Array<Test>
|
|
160
|
+
/**
|
|
161
|
+
* 重写push方法
|
|
162
|
+
*/
|
|
163
|
+
push(...item: Array<Test>): Array<Test>
|
|
164
|
+
/**
|
|
165
|
+
* 重写unshift方法
|
|
166
|
+
*/
|
|
167
|
+
unshift(...item: Array<Test>): Array<Test>
|
|
144
168
|
/**
|
|
145
169
|
* 分页查询
|
|
146
170
|
*/
|
|
@@ -186,6 +210,14 @@ interface Test3 {
|
|
|
186
210
|
|
|
187
211
|
interface Test3Set extends Array<Test3> {
|
|
188
212
|
|
|
213
|
+
/**
|
|
214
|
+
* 重写push方法
|
|
215
|
+
*/
|
|
216
|
+
push(...item: Array<Test3>): Array<Test3>
|
|
217
|
+
/**
|
|
218
|
+
* 重写unshift方法
|
|
219
|
+
*/
|
|
220
|
+
unshift(...item: Array<Test3>): Array<Test3>
|
|
189
221
|
/**
|
|
190
222
|
* 分页查询
|
|
191
223
|
*/
|
package/test/5/data
CHANGED
|
Binary file
|
package/test/5/index
CHANGED
|
Binary file
|
package/test/5/type.ts
CHANGED
|
@@ -29,6 +29,14 @@ interface AdminSet extends Array<Admin> {
|
|
|
29
29
|
indexByUid(uid: String): Array<Admin>
|
|
30
30
|
indexByValid(valid: Number): Array<Admin>
|
|
31
31
|
indexByTime({after, before}): Array<Admin>
|
|
32
|
+
/**
|
|
33
|
+
* 重写push方法
|
|
34
|
+
*/
|
|
35
|
+
push(...item: Array<Admin>): Array<Admin>
|
|
36
|
+
/**
|
|
37
|
+
* 重写unshift方法
|
|
38
|
+
*/
|
|
39
|
+
unshift(...item: Array<Admin>): Array<Admin>
|
|
32
40
|
/**
|
|
33
41
|
* 分页查询
|
|
34
42
|
*/
|
|
@@ -76,6 +84,14 @@ interface LogSet extends Array<Log> {
|
|
|
76
84
|
indexById(id: Number): Array<Log>
|
|
77
85
|
indexByUid(uid: String): Array<Log>
|
|
78
86
|
indexByTime({after, before}): Array<Log>
|
|
87
|
+
/**
|
|
88
|
+
* 重写push方法
|
|
89
|
+
*/
|
|
90
|
+
push(...item: Array<Log>): Array<Log>
|
|
91
|
+
/**
|
|
92
|
+
* 重写unshift方法
|
|
93
|
+
*/
|
|
94
|
+
unshift(...item: Array<Log>): Array<Log>
|
|
79
95
|
/**
|
|
80
96
|
* 分页查询
|
|
81
97
|
*/
|
|
@@ -141,6 +157,14 @@ interface Test {
|
|
|
141
157
|
interface TestSet extends Array<Test> {
|
|
142
158
|
|
|
143
159
|
indexById(id: Number): Array<Test>
|
|
160
|
+
/**
|
|
161
|
+
* 重写push方法
|
|
162
|
+
*/
|
|
163
|
+
push(...item: Array<Test>): Array<Test>
|
|
164
|
+
/**
|
|
165
|
+
* 重写unshift方法
|
|
166
|
+
*/
|
|
167
|
+
unshift(...item: Array<Test>): Array<Test>
|
|
144
168
|
/**
|
|
145
169
|
* 分页查询
|
|
146
170
|
*/
|
|
@@ -186,6 +210,14 @@ interface Test3 {
|
|
|
186
210
|
|
|
187
211
|
interface Test3Set extends Array<Test3> {
|
|
188
212
|
|
|
213
|
+
/**
|
|
214
|
+
* 重写push方法
|
|
215
|
+
*/
|
|
216
|
+
push(...item: Array<Test3>): Array<Test3>
|
|
217
|
+
/**
|
|
218
|
+
* 重写unshift方法
|
|
219
|
+
*/
|
|
220
|
+
unshift(...item: Array<Test3>): Array<Test3>
|
|
189
221
|
/**
|
|
190
222
|
* 分页查询
|
|
191
223
|
*/
|
package/test/6/data
CHANGED
|
Binary file
|
package/test/6/index
CHANGED
|
Binary file
|
package/test/6/type.ts
CHANGED
|
@@ -29,6 +29,14 @@ interface AdminSet extends Array<Admin> {
|
|
|
29
29
|
indexByUid(uid: String): Array<Admin>
|
|
30
30
|
indexByValid(valid: Number): Array<Admin>
|
|
31
31
|
indexByTime({after, before}): Array<Admin>
|
|
32
|
+
/**
|
|
33
|
+
* 重写push方法
|
|
34
|
+
*/
|
|
35
|
+
push(...item: Array<Admin>): Array<Admin>
|
|
36
|
+
/**
|
|
37
|
+
* 重写unshift方法
|
|
38
|
+
*/
|
|
39
|
+
unshift(...item: Array<Admin>): Array<Admin>
|
|
32
40
|
/**
|
|
33
41
|
* 分页查询
|
|
34
42
|
*/
|
|
@@ -76,6 +84,14 @@ interface LogSet extends Array<Log> {
|
|
|
76
84
|
indexById(id: Number): Array<Log>
|
|
77
85
|
indexByUid(uid: String): Array<Log>
|
|
78
86
|
indexByTime({after, before}): Array<Log>
|
|
87
|
+
/**
|
|
88
|
+
* 重写push方法
|
|
89
|
+
*/
|
|
90
|
+
push(...item: Array<Log>): Array<Log>
|
|
91
|
+
/**
|
|
92
|
+
* 重写unshift方法
|
|
93
|
+
*/
|
|
94
|
+
unshift(...item: Array<Log>): Array<Log>
|
|
79
95
|
/**
|
|
80
96
|
* 分页查询
|
|
81
97
|
*/
|
|
@@ -117,6 +133,14 @@ interface Test3 {
|
|
|
117
133
|
|
|
118
134
|
interface Test3Set extends Array<Test3> {
|
|
119
135
|
|
|
136
|
+
/**
|
|
137
|
+
* 重写push方法
|
|
138
|
+
*/
|
|
139
|
+
push(...item: Array<Test3>): Array<Test3>
|
|
140
|
+
/**
|
|
141
|
+
* 重写unshift方法
|
|
142
|
+
*/
|
|
143
|
+
unshift(...item: Array<Test3>): Array<Test3>
|
|
120
144
|
/**
|
|
121
145
|
* 分页查询
|
|
122
146
|
*/
|
package/test/7/data
CHANGED
|
Binary file
|
package/test/7/index
CHANGED
|
Binary file
|
package/test/7/type.ts
CHANGED
|
@@ -29,6 +29,14 @@ interface AdminSet extends Array<Admin> {
|
|
|
29
29
|
indexByUid(uid: String): Array<Admin>
|
|
30
30
|
indexByValid(valid: Number): Array<Admin>
|
|
31
31
|
indexByTime({after, before}): Array<Admin>
|
|
32
|
+
/**
|
|
33
|
+
* 重写push方法
|
|
34
|
+
*/
|
|
35
|
+
push(...item: Array<Admin>): Array<Admin>
|
|
36
|
+
/**
|
|
37
|
+
* 重写unshift方法
|
|
38
|
+
*/
|
|
39
|
+
unshift(...item: Array<Admin>): Array<Admin>
|
|
32
40
|
/**
|
|
33
41
|
* 分页查询
|
|
34
42
|
*/
|
|
@@ -76,6 +84,14 @@ interface LogSet extends Array<Log> {
|
|
|
76
84
|
indexById(id: Number): Array<Log>
|
|
77
85
|
indexByUid(uid: String): Array<Log>
|
|
78
86
|
indexByTime({after, before}): Array<Log>
|
|
87
|
+
/**
|
|
88
|
+
* 重写push方法
|
|
89
|
+
*/
|
|
90
|
+
push(...item: Array<Log>): Array<Log>
|
|
91
|
+
/**
|
|
92
|
+
* 重写unshift方法
|
|
93
|
+
*/
|
|
94
|
+
unshift(...item: Array<Log>): Array<Log>
|
|
79
95
|
/**
|
|
80
96
|
* 分页查询
|
|
81
97
|
*/
|
|
@@ -117,6 +133,14 @@ interface Test3 {
|
|
|
117
133
|
|
|
118
134
|
interface Test3Set extends Array<Test3> {
|
|
119
135
|
|
|
136
|
+
/**
|
|
137
|
+
* 重写push方法
|
|
138
|
+
*/
|
|
139
|
+
push(...item: Array<Test3>): Array<Test3>
|
|
140
|
+
/**
|
|
141
|
+
* 重写unshift方法
|
|
142
|
+
*/
|
|
143
|
+
unshift(...item: Array<Test3>): Array<Test3>
|
|
120
144
|
/**
|
|
121
145
|
* 分页查询
|
|
122
146
|
*/
|
package/test.mjs
CHANGED
|
@@ -639,6 +639,8 @@ test('测试结构操作', async t => {
|
|
|
639
639
|
const {updateCol, submit} = upgrade('test', {version: 3})
|
|
640
640
|
|
|
641
641
|
updateCol('test2', {
|
|
642
|
+
uid: String(`账
|
|
643
|
+
户`).length(32),
|
|
642
644
|
test: String,
|
|
643
645
|
test2: String(),
|
|
644
646
|
test3: Int(3)
|
|
@@ -741,7 +743,7 @@ test('测试结构操作', async t => {
|
|
|
741
743
|
|
|
742
744
|
await new Promise(resolve => {
|
|
743
745
|
|
|
744
|
-
t.test('
|
|
746
|
+
t.test('测试压缩操作', _ => {
|
|
745
747
|
|
|
746
748
|
const {submit} = upgrade('test', {
|
|
747
749
|
version: 7,
|