Use functionIds from jsdoc if available
bugfix: type spec generation now works with undefined and null