MCPcopy Create free account
hub / github.com/SoftwareBrothers/better-docs / needsSignature

Function needsSignature

publish.js:56–81  ·  view source on GitHub ↗
(doclet)

Source from the content-addressed store, hash-verified

54}
55
56function needsSignature(doclet) {
57 var needsSig = false
58
59 // function and class definitions always get a signature
60 if (doclet.kind === 'function' || doclet.kind === 'class') {
61 needsSig = true
62 }
63 // typedefs that contain functions get a signature, too
64 else if (doclet.kind === 'typedef' && doclet.type && doclet.type.names &&
65 doclet.type.names.length) {
66 for (var i = 0, l = doclet.type.names.length; i < l; i++) {
67 if (doclet.type.names[i].toLowerCase() === 'function') {
68 needsSig = true
69 break
70 }
71 }
72 }
73 // and namespaces that are functions get a signature (but finding them is a
74 // bit messy)
75 else if (doclet.kind === 'namespace' && doclet.meta && doclet.meta.code &&
76 doclet.meta.code.type && doclet.meta.code.type.match(/[Ff]unction/)) {
77 needsSig = true
78 }
79
80 return needsSig
81}
82
83function getSignatureAttributes(item) {
84 var attributes = []

Callers 1

publish.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…