GoJS creating new node key with a negative value

Is there a simple way to make sure a positive number is generated for the node key? I am adding new nodes from a palette.

Set the Model.makeUniqueKeyFunction property, Model | GoJS API, to be a function that returns whatever key you like, as long as it is unique within the Model.

Remember that functions cannot be saved in JSON-formatted text, so if you are using Model.fromJson, you’ll need to reset this property (and any other properties that you want to be functions) on the new Model that is returned.