MCPcopy
hub / github.com/jsdoc/jsdoc / unwrap

Function unwrap

lib/jsdoc/doclet.js:85–103  ·  view source on GitHub ↗
(docletSrc)

Source from the content-addressed store, hash-verified

83}
84
85function unwrap(docletSrc) {
86 if (!docletSrc) { return ''; }
87
88 // note: keep trailing whitespace for @examples
89 // extra opening/closing stars are ignored
90 // left margin is considered a star and a space
91 // use the /m flag on regex to avoid having to guess what this platform's newline is
92 docletSrc =
93 // remove opening slash+stars
94 docletSrc.replace(/^\/\*\*+/, '')
95 // replace closing star slash with end-marker
96 .replace(/\**\*\/$/, '\\Z')
97 // remove left margin like: spaces+star or spaces+end-marker
98 .replace(/^\s*(\* ?|\\Z)/gm, '')
99 // remove end-marker
100 .replace(/\s*\\Z$/g, '');
101
102 return docletSrc;
103}
104
105/**
106 * Convert the raw source of the doclet comment into an array of pseudo-Tag objects.

Callers 1

constructorMethod · 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…