Conditional adornment

This is probably fairly simple, but perhaps I’ve been staring at this for too long! What I’d like to do is something like this:

 var node = $(go.Node, "Spot", 

 // If the node is the root node, add a small adornment to denote that
 node.addAdornment???($(go.Shape, "FivePointedStar", ...);

 myDiagram.nodeTemplateMap.add( categoryName, node );

In other words, I want to define the node template, but depending on certain conditions, add an optional adornment to it. My node templates are created in a function, so I don’t want to add it to all of them :) Any thoughts on how best to achieve this? Thanks in advance!

var node = ...
var node2 = node.copy();
node2.add(... new Shape ...);
... add both nodes to template map ...

Make sure the original node has not been used in a template map before copying or modifying it.

You’re a champ!