@k3000/store 1.0.0 → 1.0.2

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 CHANGED
@@ -761,22 +761,6 @@ 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
-
780
764
  this.curr.updateStruct(this.curr.struct)
781
765
  this.curr.updateRecord(this.curr.record)
782
766
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k3000/store",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "storage",
5
5
  "main": "generator.mjs",
6
6
  "scripts": {
package/test/1/data CHANGED
Binary file
package/test/1/index CHANGED
Binary file
package/test/2/data CHANGED
Binary file
package/test/2/index CHANGED
Binary file
package/test/2/index.mjs CHANGED
@@ -21,6 +21,7 @@ const $string = 'string'
21
21
  const $buffer = 'buffer'
22
22
  const $text = 'text'
23
23
  const $test = 'test'
24
+ const $str = 'str'
24
25
  const $test3 = 'test3'
25
26
 
26
27
  class Admin extends Entity {
@@ -261,6 +262,12 @@ class Test2 extends Entity {
261
262
  get: () => b2s(super.get($pwd)),
262
263
  set: value => super.set($pwd, super.s2b(value, $pwd)),
263
264
  },
265
+ str: {
266
+ enumerable: true,
267
+ configurable: false,
268
+ get: () => b2s(super.get($str)),
269
+ set: value => super.set($str, super.s2b(value, $str)),
270
+ },
264
271
  test: {
265
272
  enumerable: true,
266
273
  configurable: false,
package/test/2/type.ts CHANGED
@@ -198,6 +198,10 @@ interface Test2 {
198
198
  *
199
199
  */
200
200
  test: Number | BigInt
201
+ /**
202
+ *
203
+ */
204
+ str: String
201
205
  /**
202
206
  *
203
207
  */
package/test/3/data CHANGED
Binary file
package/test/3/index CHANGED
Binary file
package/test/3/index.mjs CHANGED
@@ -21,6 +21,7 @@ const $string = 'string'
21
21
  const $buffer = 'buffer'
22
22
  const $text = 'text'
23
23
  const $test = 'test'
24
+ const $str = 'str'
24
25
  const $test3 = 'test3'
25
26
  const $test2 = 'test2'
26
27
 
@@ -262,6 +263,12 @@ class Test2 extends Entity {
262
263
  get: () => b2s(super.get($pwd)),
263
264
  set: value => super.set($pwd, super.s2b(value, $pwd)),
264
265
  },
266
+ str: {
267
+ enumerable: true,
268
+ configurable: false,
269
+ get: () => b2s(super.get($str)),
270
+ set: value => super.set($str, super.s2b(value, $str)),
271
+ },
265
272
  test: {
266
273
  enumerable: true,
267
274
  configurable: false,
package/test/3/type.ts CHANGED
@@ -198,6 +198,10 @@ interface Test2 {
198
198
  *
199
199
  */
200
200
  test: String
201
+ /**
202
+ *
203
+ */
204
+ str: String
201
205
  /**
202
206
  *
203
207
  */
package/test/4/data CHANGED
Binary file
package/test/4/index CHANGED
Binary file
package/test/4/index.mjs CHANGED
@@ -21,6 +21,7 @@ const $string = 'string'
21
21
  const $buffer = 'buffer'
22
22
  const $text = 'text'
23
23
  const $test = 'test'
24
+ const $str = 'str'
24
25
  const $test3 = 'test3'
25
26
  const $test2 = 'test2'
26
27
 
@@ -262,6 +263,12 @@ class Test3 extends Entity {
262
263
  get: () => b2s(super.get($pwd)),
263
264
  set: value => super.set($pwd, super.s2b(value, $pwd)),
264
265
  },
266
+ str: {
267
+ enumerable: true,
268
+ configurable: false,
269
+ get: () => b2s(super.get($str)),
270
+ set: value => super.set($str, super.s2b(value, $str)),
271
+ },
265
272
  test: {
266
273
  enumerable: true,
267
274
  configurable: false,
package/test/4/type.ts CHANGED
@@ -198,6 +198,10 @@ interface Test3 {
198
198
  *
199
199
  */
200
200
  test: String
201
+ /**
202
+ *
203
+ */
204
+ str: String
201
205
  /**
202
206
  *
203
207
  */
package/test/5/data CHANGED
Binary file
package/test/5/index CHANGED
Binary file
package/test/5/index.mjs CHANGED
@@ -21,6 +21,7 @@ const $string = 'string'
21
21
  const $buffer = 'buffer'
22
22
  const $text = 'text'
23
23
  const $test = 'test'
24
+ const $str = 'str'
24
25
  const $test3 = 'test3'
25
26
  const $test2 = 'test2'
26
27
 
@@ -262,6 +263,12 @@ class Test3 extends Entity {
262
263
  get: () => b2s(super.get($pwd)),
263
264
  set: value => super.set($pwd, super.s2b(value, $pwd)),
264
265
  },
266
+ str: {
267
+ enumerable: true,
268
+ configurable: false,
269
+ get: () => b2s(super.get($str)),
270
+ set: value => super.set($str, super.s2b(value, $str)),
271
+ },
265
272
  test: {
266
273
  enumerable: true,
267
274
  configurable: false,
package/test/5/type.ts CHANGED
@@ -198,6 +198,10 @@ interface Test3 {
198
198
  *
199
199
  */
200
200
  test: String
201
+ /**
202
+ *
203
+ */
204
+ str: String
201
205
  /**
202
206
  *
203
207
  */
package/test/6/data CHANGED
Binary file
package/test/6/index CHANGED
Binary file
package/test/6/index.mjs CHANGED
@@ -13,6 +13,7 @@ const $time = 'time'
13
13
  const $type = 'type'
14
14
  const $content = 'content'
15
15
  const $test = 'test'
16
+ const $str = 'str'
16
17
  const $test2 = 'test2'
17
18
 
18
19
  class Admin extends Entity {
@@ -169,6 +170,12 @@ class Test3 extends Entity {
169
170
  get: () => b2s(super.get($pwd)),
170
171
  set: value => super.set($pwd, super.s2b(value, $pwd)),
171
172
  },
173
+ str: {
174
+ enumerable: true,
175
+ configurable: false,
176
+ get: () => b2s(super.get($str)),
177
+ set: value => super.set($str, super.s2b(value, $str)),
178
+ },
172
179
  test: {
173
180
  enumerable: true,
174
181
  configurable: false,
package/test/6/type.ts CHANGED
@@ -125,6 +125,10 @@ interface Test3 {
125
125
  *
126
126
  */
127
127
  test: String
128
+ /**
129
+ *
130
+ */
131
+ str: String
128
132
  /**
129
133
  *
130
134
  */
package/test/7/data CHANGED
Binary file
package/test/7/index CHANGED
Binary file
package/test/7/index.mjs CHANGED
@@ -13,6 +13,7 @@ const $time = 'time'
13
13
  const $type = 'type'
14
14
  const $content = 'content'
15
15
  const $test = 'test'
16
+ const $str = 'str'
16
17
  const $test2 = 'test2'
17
18
 
18
19
  class Admin extends Entity {
@@ -169,6 +170,12 @@ class Test3 extends Entity {
169
170
  get: () => b2s(super.get($pwd)),
170
171
  set: value => super.set($pwd, super.s2b(value, $pwd)),
171
172
  },
173
+ str: {
174
+ enumerable: true,
175
+ configurable: false,
176
+ get: () => b2s(super.get($str)),
177
+ set: value => super.set($str, super.s2b(value, $str)),
178
+ },
172
179
  test: {
173
180
  enumerable: true,
174
181
  configurable: false,
package/test/7/type.ts CHANGED
@@ -125,6 +125,10 @@ interface Test3 {
125
125
  *
126
126
  */
127
127
  test: String
128
+ /**
129
+ *
130
+ */
131
+ str: String
128
132
  /**
129
133
  *
130
134
  */
package/test.mjs CHANGED
@@ -606,6 +606,7 @@ test('测试结构操作', async t => {
606
606
  户`),
607
607
  pwd: String(),
608
608
  test: Bigint,
609
+ str: String(6),
609
610
  test3: Int(2)
610
611
  }, '账号表')
611
612
 
@@ -617,12 +618,13 @@ test('测试结构操作', async t => {
617
618
  uid: 'test',
618
619
  pwd: '123456',
619
620
  test: 123123n,
621
+ str: '00000000',
620
622
  test3: 111
621
623
  })
622
624
 
623
625
  assert.strictEqual(
624
626
  JSON.stringify(storage.test2, bigintSerialize),
625
- '[{"pwd":"123456","test":"123123","test3":111,"uid":"test"}]')
627
+ '[{"pwd":"123456","str":"000000","test":"123123","test3":111,"uid":"test"}]')
626
628
 
627
629
  m.close()
628
630
 
@@ -642,6 +644,7 @@ test('测试结构操作', async t => {
642
644
  uid: String(`账
643
645
  户`).length(32),
644
646
  test: String,
647
+ str: String(8),
645
648
  test2: String(),
646
649
  test3: Int(3)
647
650
  })
@@ -654,7 +657,7 @@ test('测试结构操作', async t => {
654
657
 
655
658
  assert.strictEqual(
656
659
  JSON.stringify(storage.test2),
657
- '[{"pwd":"123456","test":"123123","test2":"456456","test3":111,"uid":"test"}]')
660
+ '[{"pwd":"123456","str":"000000","test":"123123","test2":"456456","test3":111,"uid":"test"}]')
658
661
 
659
662
  m.close()
660
663
 
@@ -682,7 +685,7 @@ test('测试结构操作', async t => {
682
685
 
683
686
  assert.strictEqual(
684
687
  JSON.stringify(storage.test3),
685
- '[{"pwd":"123456","test":"123123","test2":"456456","test3":111,"uid":"test"}]')
688
+ '[{"pwd":"123456","str":"000000","test":"123123","test2":"456456","test3":111,"uid":"test"}]')
686
689
 
687
690
  m.close()
688
691
 
@@ -730,7 +733,7 @@ test('测试结构操作', async t => {
730
733
  const storage = m.default
731
734
 
732
735
  assert.strictEqual(
733
- JSON.stringify(storage.test3) === '[{"pwd":"123456","test":"123123","test2":"456456","uid":"test"}]',
736
+ JSON.stringify(storage.test3) === '[{"pwd":"123456","str":"000000","test":"123123","test2":"456456","uid":"test"}]',
734
737
  storage.test === undefined)
735
738
 
736
739
  m.close()