@voxgig/system 1.1.0 → 1.3.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/lib/structure.ts DELETED
@@ -1,60 +0,0 @@
1
-
2
- import { dive, get, pinify, camelify } from '@voxgig/model'
3
-
4
-
5
-
6
- function entity(model: any) {
7
- let entries = dive(model.main.ent)
8
- let entMap: any = {}
9
- for (let i = 0; i < entries.length; i++) {
10
- const entry = entries[i]
11
-
12
- let path = entry[0]
13
-
14
- // TODO: move EntShape to @voxgig/model
15
- // let ent = EntShape(entry[1])
16
- let ent = entry[1]
17
-
18
- // console.log('ENT', path, ent)
19
-
20
- let valid = ent.valid || {}
21
-
22
- Object.entries(ent.field).map((n: any[]) => {
23
- let name = n[0]
24
- let field = n[1]
25
-
26
- // console.log('FV', name, field)
27
-
28
- let fv = field.kind
29
- if (field.valid) {
30
- let vt = typeof field.valid
31
- if ('string' === vt) {
32
- fv += '.' + field.valid
33
- }
34
- else {
35
- fv = field.valid
36
- }
37
- }
38
- valid[name] = fv
39
- })
40
-
41
- // console.log(path, valid)
42
-
43
- entMap[path[0] + '/' + path[1]] = {
44
- valid_json: valid
45
- }
46
- }
47
- return entMap
48
- }
49
-
50
-
51
-
52
- const Structure = {
53
- entity
54
- }
55
-
56
-
57
-
58
- export {
59
- Structure
60
- }