node.js - JavaScript documentation rules? Need a way to specify the expected structure of an input object -


i find myself using lot of functions similar following in nodejs:

socket.on('view:create', function (data) {     //data = { structure of data object here }     .... }) 

i adding comment remember data object.

is there way specify structure of object receiving input, when inside function write data.key recognises key valid?

i use commenting style advised google closure.

it similar style of different languages, helps autocompletion in modern ides, , jsdoc generating documentation easy


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -