update filter
This commit is contained in:
parent
2060cc5671
commit
bd2fc454d6
|
@ -4,16 +4,22 @@ function isBarcode(toFilter) {
|
|||
}
|
||||
let n = true;
|
||||
function isShelving(toFilter) {
|
||||
if (!Array.isArray(toFilter)) {
|
||||
let s = toFilter;
|
||||
toFilter = Array;
|
||||
toFilter[0] = s;
|
||||
}
|
||||
const exp = /^[A-Z][A-Z][A-Z]$/;
|
||||
toFilter.forEach(element => {
|
||||
let state = exp.test(element);
|
||||
for (let i = 0; i < toFilter.length; i++) {
|
||||
let state = exp.test(toFilter[i]);
|
||||
if (state == false)
|
||||
n = false;
|
||||
});
|
||||
}
|
||||
if (n == false)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
exports.isBarcode = isBarcode;
|
||||
exports.isShelving = isShelving;
|
||||
|
|
Reference in New Issue