{"version":3,"file":"requireParamDescription.cjs","names":["iterateJsdoc"],"sources":["../../src/rules/requireParamDescription.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\n\nexport default iterateJsdoc(({\n  context,\n  report,\n  settings,\n  utils,\n}) => {\n  const {\n    defaultDestructuredRootDescription = 'The root object',\n    setDefaultDestructuredRootDescription = false,\n  } = context.options[0] || {};\n\n  const functionParameterNames = utils.getFunctionParameterNames();\n\n  let rootCount = -1;\n  utils.forEachPreferredTag('param', (jsdocParameter, targetTagName) => {\n    rootCount += jsdocParameter.name.includes('.') ? 0 : 1;\n    if (!jsdocParameter.description.trim()) {\n      if (Array.isArray(functionParameterNames[rootCount])) {\n        if (settings.exemptDestructuredRootsFromChecks) {\n          return;\n        }\n\n        if (setDefaultDestructuredRootDescription) {\n          utils.reportJSDoc(`Missing root description for @${targetTagName}.`, jsdocParameter, () => {\n            utils.changeTag(jsdocParameter, {\n              description: defaultDestructuredRootDescription,\n              postName: ' ',\n            });\n          });\n          return;\n        }\n      }\n\n      report(\n        `Missing JSDoc @${targetTagName} \"${jsdocParameter.name}\" description.`,\n        null,\n        jsdocParameter,\n      );\n    }\n  });\n}, {\n  contextDefaults: true,\n  meta: {\n    docs: {\n      description: 'Requires that each `@param` tag has a `description` value.',\n      url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md#repos-sticky-header',\n    },\n    fixable: 'code',\n    schema: [\n      {\n        additionalProperties: false,\n        properties: {\n          contexts: {\n            description: `Set this to an array of strings representing the AST context (or an object with\noptional \\`context\\` and \\`comment\\` properties) where you wish the rule to be applied.\n\n\\`context\\` defaults to \\`any\\` and \\`comment\\` defaults to no specific comment context.\n\nOverrides the default contexts (\\`ArrowFunctionExpression\\`, \\`FunctionDeclaration\\`,\n\\`FunctionExpression\\`). Set to \\`\"any\"\\` if you want\nthe rule to apply to any JSDoc block throughout your files (as is necessary\nfor finding function blocks not attached to a function declaration or\nexpression, i.e., \\`@callback\\` or \\`@function\\` (or its aliases \\`@func\\` or\n\\`@method\\`) (including those associated with an \\`@interface\\`).\n\nSee the [\"AST and Selectors\"](../advanced.md#ast-and-selectors)\nsection of our Advanced docs for more on the expected format.`,\n            items: {\n              anyOf: [\n                {\n                  type: 'string',\n                },\n                {\n                  additionalProperties: false,\n                  properties: {\n                    comment: {\n                      type: 'string',\n                    },\n                    context: {\n                      type: 'string',\n                    },\n                  },\n                  type: 'object',\n                },\n              ],\n            },\n            type: 'array',\n          },\n          defaultDestructuredRootDescription: {\n            description: `The description string to set by default for destructured roots. Defaults to\n\"The root object\".`,\n            type: 'string',\n          },\n          setDefaultDestructuredRootDescription: {\n            description: `Whether to set a default destructured root description. For example, you may\nwish to avoid manually having to set the description for a \\`@param\\`\ncorresponding to a destructured root object as it should always be the same\ntype of object. Uses \\`defaultDestructuredRootDescription\\` for the description\nstring. Defaults to \\`false\\`.`,\n            type: 'boolean',\n          },\n        },\n        type: 'object',\n      },\n    ],\n    type: 'suggestion',\n  },\n});\n"],"mappings":";;;;;;AAAA;AAA8C;AAAA,iCAE/B,IAAAA,qBAAY,EAAC,CAAC;EAC3B,OAAO;EACP,MAAM;EACN,QAAQ;EACR;AACF,CAAC,KAAK;EACJ,MAAM;IACJ,kCAAkC,GAAG,iBAAiB;IACtD,qCAAqC,GAAG;EAC1C,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;EAE5B,MAAM,sBAAsB,GAAG,KAAK,CAAC,yBAAyB,CAAC,CAAC;EAEhE,IAAI,SAAS,GAAG,CAAC,CAAC;EAClB,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,aAAa,KAAK;IACpE,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACtD,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE;MACtC,IAAI,KAAK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