@k3000/store 1.1.1 → 1.1.3

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
@@ -579,6 +579,21 @@ function appendSet(name, set, remark = '') {
579
579
  } else if (this.types.includes(value)) {
580
580
 
581
581
  value = value().toJSON()
582
+
583
+ } else if (typeof value.type === "string" || value.type instanceof String) {
584
+
585
+ value.length = value.length || TypeLen[value.type]
586
+
587
+ value.type = typeMap[value.type]
588
+
589
+ if (value.index) {
590
+
591
+ value.index = []
592
+
593
+ } else if (Reflect.has(value, 'index')) {
594
+
595
+ delete value.index
596
+ }
582
597
  }
583
598
 
584
599
  console.log(' append col:', key)
@@ -615,6 +630,21 @@ function updateCol(name, set) {
615
630
  } else if (this.types.includes(value)) {
616
631
 
617
632
  value = value().toJSON()
633
+
634
+ } else if (typeof value.type === "string" || value.type instanceof String) {
635
+
636
+ value.length = value.length || TypeLen[value.type]
637
+
638
+ value.type = typeMap[value.type]
639
+
640
+ if (value.index) {
641
+
642
+ value.index = []
643
+
644
+ } else if (Reflect.has(value, 'index')) {
645
+
646
+ delete value.index
647
+ }
618
648
  }
619
649
 
620
650
  console.log(` ${Reflect.has(this.curr.struct.base[name], key) ? 'update' : 'append'} col:`, key)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k3000/store",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "storage",
5
5
  "main": "generator.mjs",
6
6
  "scripts": {
package/test/1/index CHANGED
Binary file
package/test/2/data CHANGED
Binary file
package/test/2/index CHANGED
Binary file
package/test/3/data CHANGED
Binary file
package/test/3/index CHANGED
Binary file
package/test/4/data CHANGED
Binary file
package/test/4/index CHANGED
Binary file
package/test/5/data CHANGED
Binary file
package/test/5/index CHANGED
Binary file
package/test/6/data CHANGED
Binary file
package/test/6/index CHANGED
Binary file
package/test/7/data CHANGED
Binary file
package/test/7/index CHANGED
Binary file
package/test/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
 
2
2
  const index = import.meta.url.indexOf('?')
3
3
 
4
- export const modules = await import(`./7/index.mjs${index > -1 ? import.meta.url.substring(index) : ''}`)
4
+ export const modules = await import(`./2/index.mjs${index > -1 ? import.meta.url.substring(index) : ''}`)
5
5
 
6
6
  export const close = modules.close
7
7
  export const remark = modules.remark
8
- export const version = 7
8
+ export const version = 2
9
9
  export const getStruct = modules.getStruct
10
10
 
11
11
  /**
12
- * @type {import('./7/type').Storage}
12
+ * @type {import('./2/type').Storage}
13
13
  */
14
14
  export const storage = modules.default
15
15