Ajout du choix des utilisateurs sur un événement. Ajout de fichiers dans un événement. (dropzone cassée)
This commit is contained in:
23
em2rp/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParser.js
generated
vendored
Normal file
23
em2rp/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParser.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
class boolParser{
|
||||
constructor(trueList, falseList){
|
||||
if(trueList)
|
||||
this.trueList = trueList;
|
||||
else
|
||||
this.trueList = ["true"];
|
||||
|
||||
if(falseList)
|
||||
this.falseList = falseList;
|
||||
else
|
||||
this.falseList = ["false"];
|
||||
}
|
||||
parse(val){
|
||||
if (typeof val === 'string') {
|
||||
//TODO: performance: don't convert
|
||||
const temp = val.toLowerCase();
|
||||
if(this.trueList.indexOf(temp) !== -1) return true;
|
||||
else if(this.falseList.indexOf(temp) !== -1 ) return false;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
module.exports = boolParser;
|
Reference in New Issue
Block a user