Skip to content

Instantly share code, notes, and snippets.

@yhaskell
Last active September 25, 2015 13:47
Show Gist options
  • Save yhaskell/fed34bd621ee9359e60e to your computer and use it in GitHub Desktop.
Save yhaskell/fed34bd621ee9359e60e to your computer and use it in GitHub Desktop.
function genStructuredValue(name: string, parent: hl.IHighLevelNode, pr: hl.IProperty) : string | hlimpl.StructuredValue {
if (pr.range() instanceof defs.ReferenceType){
var t=<defs.ReferenceType>pr.range();
var mockNode=jsyaml.createNode(name);
return new hlimpl.StructuredValue(mockNode, parent, pr);
// var hn = stv.toHighlevel()
// return hn;
} else return name;
}
var value = this.genStructuredValue(v, node, typeProperty);
var typeNode = (<any>value) instanceof hlimpl.StructuredValue ? (<hlimpl.StructuredValue>value).toHighlevel() : null;
typeNode.attr("objectType").setValue("blablabla");
node.attr("type").setValue(value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment