MCPcopy Create free account
hub / github.com/Automattic/mongoose / convertTypesToString

Function convertTypesToString

docs/source/api.js:217–227  ·  view source on GitHub ↗
(types, typesDescription)

Source from the content-addressed store, hash-verified

215// typesDescription is used as fallback when types contains '[object Object]'
216// (happens with string literal types like 'before'|'after' due to dox/jsdoctypeparser bug)
217function convertTypesToString(types, typesDescription) {
218 if (!Array.isArray(types)) {
219 return types;
220 }
221 const result = types.join('|');
222 if (result.includes('[object Object]') && typesDescription) {
223 // Strip HTML code tags from typesDescription: <code>foo</code> -> foo
224 return typesDescription.replace(/<\/?code>/g, '');
225 }
226 return result;
227}
228
229/**
230 * Convert API doc HTML links in a string to their equivalent Markdown file paths.

Callers 1

processFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected