(props)
| 371 | } |
| 372 | |
| 373 | function processFile(props) { |
| 374 | const { docName: name, docFileName } = processName(props.file); |
| 375 | /** @type {DocsObj} */ |
| 376 | const data = { |
| 377 | title: name, |
| 378 | fileName: docFileName, |
| 379 | props: [] |
| 380 | }; |
| 381 | |
| 382 | for (const prop of props) { |
| 383 | if (prop.ignore || prop.isPrivate) { |
| 384 | continue; |
| 385 | } |
| 386 | |
| 387 | /** @type {PropContext} */ |
| 388 | const ctx = prop.ctx || {}; |
| 389 | |
| 390 | // somehow in "dox", it is named "receiver" sometimes, not "constructor" |
| 391 | // this is used as a fall-back if the handling below does not overwrite it |
| 392 | if ('receiver' in ctx) { |
| 393 | ctx.constructor = ctx.receiver; |
| 394 | delete ctx.receiver; |
| 395 | } |
| 396 | |
| 397 | // in some cases "dox" has "ctx.constructor" defined but set to "undefined", which will later be used for setting "ctx.string" |
| 398 | if ('constructor' in ctx && ctx.constructor === undefined) { |
| 399 | ctx.constructorWasUndefined = true; |
| 400 | } |
| 401 | if (!prop.tags) continue; |
| 402 | for (const __tag of prop.tags) { |
| 403 | // the following has been done, because otherwise no type could be applied for intellisense |
| 404 | /** @type {TagObject} */ |
| 405 | const tag = __tag; |
| 406 | switch (tag.type) { |
| 407 | case 'see': |
| 408 | if (!Array.isArray(ctx.see)) { |
| 409 | ctx.see = []; |
| 410 | } |
| 411 | |
| 412 | // for this type, it needs to be parsed from the string itself to support more than 1 word |
| 413 | // this is required because "@see" is kinda badly defined and mongoose uses a slightly customized way (longer text and different kinds of links) |
| 414 | |
| 415 | ctx.see.push(extractTextUrlFromTag(tag, ctx, true)); |
| 416 | break; |
| 417 | case 'receiver': |
| 418 | console.warn(`Found "@receiver" tag in ${ctx.constructor} ${ctx.name}`); |
| 419 | break; |
| 420 | case 'property': |
| 421 | ctx.type = 'property'; |
| 422 | |
| 423 | // using "name" over "string" because "string" also contains the type and maybe other stuff |
| 424 | ctx.name = tag.name; |
| 425 | // only assign "type" if there are types |
| 426 | if (tag.types.length > 0) { |
| 427 | ctx.type = convertTypesToString(tag.types, tag.typesDescription); |
| 428 | } |
| 429 | |
| 430 | break; |
no test coverage detected