26 lines
688 B
Plaintext
26 lines
688 B
Plaintext
import "typeLib" as typeLib;
|
|
|
|
def ensureExperience:
|
|
. as $experience |
|
|
typeLib::ensureObject |
|
|
|
|
$experience |
|
|
typeLib::ensureKey("experience"; "title") |
|
|
.title | typeLib::ensureString |
|
|
|
|
$experience |
|
|
typeLib::ensureKey("experience"; "text") |
|
|
.text | typeLib::ensureString
|
|
|
|
;
|
|
|
|
def ensureExportData:
|
|
. as $exportData |
|
|
if typeLib::typecheckingEnabled then
|
|
typeLib::ensureObject |
|
|
typeLib::ensureKey("exportData"; "customSubstances") |
|
|
typeLib::ensureKey("exportData"; "customUnits") |
|
|
typeLib::ensureKey("exportData"; "experiences") |
|
|
typeLib::ensureKey("exportData"; "substanceCompanions") |
|
|
(.experiences[] | ensureExperience)
|
|
end; |