🚨 Fixed DeepSource issues
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
// skipcq: JS-C1003
|
||||
import * as yup from 'yup';
|
||||
|
||||
export const ABCDQuestionSchema = yup
|
||||
@@ -69,23 +70,17 @@ export const dataSchema = yup.object({
|
||||
answers: yup.lazy((v) => {
|
||||
if (Array.isArray(v)) {
|
||||
if (typeof v[0].right === 'boolean') {
|
||||
console.log('ABCDQuestionSchema');
|
||||
return ABCDQuestionSchema;
|
||||
} else if (typeof v[0].case_sensitive === 'boolean') {
|
||||
console.log('TextQuestionSchema');
|
||||
return TextQuestionSchema;
|
||||
} else if (v[0].id !== undefined) {
|
||||
console.log('OrderQuestionSchema');
|
||||
return VotingQuestionSchema;
|
||||
} else if (v[0].answer !== undefined) {
|
||||
console.log('VotingQuestionSchema');
|
||||
return VotingQuestionSchema;
|
||||
}
|
||||
} else if (typeof v === 'string' || v instanceof String) {
|
||||
console.log('StringQuestionSchema');
|
||||
return yup.string().required("The slide mustn't be empty").nullable();
|
||||
} else {
|
||||
console.log('RangeQuestionSchema');
|
||||
return RangeQuestionSchema;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user