How can you determine if the lastinput is a link or a node?

I have my own context menu handler and I am trying to figure out how to determine the lastinput object is a link or a node. Do I just interrogate for a link only property?

What do you mean by lastinput? Diagram.lastInput is an InputEvent.

If you have a reference to an object and want to query its type you can do:

if (obj instanceof go.Link) {
  ...
}

if (obj instanceof go.Node) {
  ...
}

if (obj instanceof go.Part) { // is it a Link or Part or Node or Group?
  ...
}

etc