{"version":3,"file":"expected-files.mjs","sourceRoot":"","sources":["../../../src/manifest/validators/expected-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAoB;AAG/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAE/E,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;IACnC,WAAW,EAAE,gBAAgB,CAAC,WAAW;IACzC,UAAU,EAAE,oBAAoB;CACxB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,QAAQ,EAAE,OAAO;IACjB,cAAc,CAAC,KAAK,EAAE,OAAO;QAC3B,KAAK,MAAM,YAAY,IAAI,mBAAmB,EAAE,CAAC;YAC/C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,MAAM,CACZ,kBAAkB,YAAY,EAAE,EAChC,iBAAiB,mBAAmB,CAAC,YAAY,CAAC,IAAI,CACvD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\nconst EXPECTED_SNAP_FILES = ['manifest', 'packageJson', 'sourceCode'] as const;\n\nconst SnapFileNameFromKey = {\n  manifest: NpmSnapFileNames.Manifest,\n  packageJson: NpmSnapFileNames.PackageJson,\n  sourceCode: 'source code bundle',\n} as const;\n\n/**\n * Check if all the required files are included.\n */\nexport const expectedFiles: ValidatorMeta = {\n  severity: 'error',\n  structureCheck(files, context) {\n    for (const expectedFile of EXPECTED_SNAP_FILES) {\n      if (!files[expectedFile]) {\n        context.report(\n          `expected-files-${expectedFile}`,\n          `Missing file \"${SnapFileNameFromKey[expectedFile]}\".`,\n        );\n      }\n    }\n  },\n};\n"]}