mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-11-25 17:06:52 +01:00
1 line
No EOL
1.5 KiB
Text
1 line
No EOL
1.5 KiB
Text
{"version":3,"sources":["../src/validateConfig.js"],"names":["schemaId","config","validate","validators","errors","map","error","dataPath","message","params","schemaPath","console","log","Error"],"mappings":";;;;;;;AACA;;;;AADA;;AAGA;AACA;AACA;AACA;AACA;wBACgBA,Q,EAAUC,MAAM,GAAG,E,KAAO;AACxC,QAAMC,QAAQ,GAAGC,oBAAWH,QAAX,CAAjB;;AACA,MAAI,CAACE,QAAQ,CAACD,MAAD,CAAb,EAAuB;AACrB,UAAMG,MAAM,GAAGF,QAAQ,CAACE,MAAT,CAAgBC,GAAhB,CAAqBC,KAAD,IAAW;AAC5C,aAAO;AACLC,QAAAA,QAAQ,EAAED,KAAK,CAACC,QADX;AAELC,QAAAA,OAAO,EAAEF,KAAK,CAACE,OAFV;AAGLC,QAAAA,MAAM,EAAEH,KAAK,CAACG,MAHT;AAILC,QAAAA,UAAU,EAAEJ,KAAK,CAACI;AAJb,OAAP;AAMD,KAPc,CAAf;AASA;;AACAC,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBX,MAAtB;AACAU,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBR,MAAtB;AACA;;AAEA,UAAM,IAAIS,KAAJ,CAAU,iBAAV,CAAN;AACD;AACF,C","sourcesContent":["// eslint-disable-next-line import/default\nimport validators from '../dist/validators';\n\n/**\n * @param {string} schemaId\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (schemaId, config = {}) => {\n const validate = validators[schemaId];\n if (!validate(config)) {\n const errors = validate.errors.map((error) => {\n return {\n dataPath: error.dataPath,\n message: error.message,\n params: error.params,\n schemaPath: error.schemaPath,\n };\n });\n\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('errors', errors);\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"file":"validateConfig.js"} |