mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-04 19:41:26 -05:00
c91b8146dc
This fixes the package refs in NewPackage and makes the serializer know about these refs when a Package is encoded.
11 lines
415 B
Cheetah
11 lines
415 B
Cheetah
{{if .HasTypes}}
|
|
const _pkg = new {{importJS "Package"}}([{{range $i, $t := .Types}}
|
|
{{toTypeValueJS $t true 2}},{{end}}
|
|
], [{{range $deps := .Dependencies}}
|
|
{{importJS "Ref"}}.parse('{{$deps}}'),{{end}}
|
|
]);
|
|
{{importJS "registerPackage"}}(_pkg);{{range $i, $t := .Types}}
|
|
const {{userType $t}}$type = {{importJS "makeType"}}(_pkg.ref, {{$i}});
|
|
const {{userType $t}}$typeDef = _pkg.types[{{$i}}];{{end}}
|
|
{{end}}
|