{"version":3,"sources":["../../src/rules/checkAccess.js"],"names":["accessLevels","report","utils","forEachPreferredTag","jsdocParameter","targetTagName","desc","description","name","includes","trim","accessLength","getTags","length","individualTagLength","getPresentTags","checkPrivate","iterateAllJsdocs","meta","type"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,YAAY,GAAG,CAAC,SAAD,EAAY,SAAZ,EAAuB,WAAvB,EAAoC,QAApC,CAArB;;eAEe,2BAAa,CAAC;AAC3BC,EAAAA,MAD2B;AAE3BC,EAAAA;AAF2B,CAAD,KAGtB;AACJA,EAAAA,KAAK,CAACC,mBAAN,CAA0B,QAA1B,EAAoC,CAACC,cAAD,EAAiBC,aAAjB,KAAmC;AACrE,UAAMC,IAAI,GAAGD,aAAa,KAAK,QAAlB,GACXD,cAAc,CAACG,WADJ,GAEXH,cAAc,CAACI,IAAf,GAAsB,GAAtB,GAA4BJ,cAAc,CAACG,WAF7C;;AAIA,QAAI,CAACP,YAAY,CAACS,QAAb,CAAsBH,IAAI,CAACI,IAAL,EAAtB,CAAL,EAAyC;AACvCT,MAAAA,MAAM,CACH,wBAAuBI,aAAc,SADlC,EAEJ,IAFI,EAGJD,cAHI,CAAN;AAKD;AACF,GAZD;AAaA,QAAMO,YAAY,GAAGT,KAAK,CAACU,OAAN,CAAc,QAAd,EAAwBC,MAA7C;AACA,QAAMC,mBAAmB,GAAGZ,KAAK,CAACa,cAAN,CAAqBf,YAArB,EAAmCa,MAA/D;;AACA,MAAIF,YAAY,IAAIG,mBAApB,EAAyC;AACvCb,IAAAA,MAAM,CACJ,iHADI,CAAN;AAGD;;AACD,MAAIU,YAAY,GAAG,CAAf,IAAoBG,mBAAmB,GAAG,CAA9C,EAAiD;AAC/Cb,IAAAA,MAAM,CACJ,iEADI,CAAN;AAGD;AACF,CA7Bc,EA6BZ;AACDe,EAAAA,YAAY,EAAE,IADb;AAEDC,EAAAA,gBAAgB,EAAE,IAFjB;AAGDC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAE;AADF;AAHL,CA7BY,C","sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nconst accessLevels = ['package', 'private', 'protected', 'public'];\n\nexport default iterateJsdoc(({\n report,\n utils,\n}) => {\n utils.forEachPreferredTag('access', (jsdocParameter, targetTagName) => {\n const desc = targetTagName === 'access' ?\n jsdocParameter.description :\n jsdocParameter.name + ' ' + jsdocParameter.description;\n\n if (!accessLevels.includes(desc.trim())) {\n report(\n `Missing valid JSDoc @${targetTagName} level.`,\n null,\n jsdocParameter,\n );\n }\n });\n const accessLength = utils.getTags('access').length;\n const individualTagLength = utils.getPresentTags(accessLevels).length;\n if (accessLength && individualTagLength) {\n report(\n 'The @access tag may not be used with specific access-control tags (@package, @private, @protected, or @public).',\n );\n }\n if (accessLength > 1 || individualTagLength > 1) {\n report(\n 'At most one access-control tag may be present on a jsdoc block.',\n );\n }\n}, {\n checkPrivate: true,\n iterateAllJsdocs: true,\n meta: {\n type: 'suggestion',\n },\n});\n"],"file":"checkAccess.js"}