This module offers dynamic type guards for the for the JSON schema of marlowe-objects.
import * as G from "@marlowe/marlowe-objects/guards"const jsonObject = JSON.parse(fileContents)if (G.ContractBundleMap.is(jsonObject)) { // console.log("Object is a bundle") // console.log("entry contract is ", jsonObject.main) //...} else { // console.error(...)} Copy
import * as G from "@marlowe/marlowe-objects/guards"const jsonObject = JSON.parse(fileContents)if (G.ContractBundleMap.is(jsonObject)) { // console.log("Object is a bundle") // console.log("entry contract is ", jsonObject.main) //...} else { // console.error(...)}
This module offers dynamic type guards for the for the JSON schema of marlowe-objects.