refactor the whole damn thing

This commit is contained in:
Kevin Jahns
2017-10-11 03:41:54 +02:00
parent d9ee67d2f3
commit 82015d5a37
43 changed files with 2194 additions and 4848 deletions

View File

@@ -0,0 +1,30 @@
import YArray from '../Type/YArray'
import YMap from '../Type/YMap'
import YText from '../Type/YText'
import YXml from '../Type/YXml'
import ItemJSON from '../Struct/ItemJSON'
import ItemString from '../Struct/ItemString'
const structs = new Map()
const references = new Map()
function addStruct (reference, structConstructor) {
structs.set(reference, structConstructor)
references.set(structConstructor, reference)
}
export function getStruct (reference) {
return structs.get(reference)
}
export function getReference (typeConstructor) {
return references.get(typeConstructor)
}
addStruct(0, YArray)
addStruct(1, YMap)
addStruct(2, YText)
addStruct(3, YXml)
addStruct(4, ItemJSON)
addStruct(5, ItemString)