1
0
Fork 0
mirror of https://github.com/engineer-man/piston.git synced 2025-04-21 04:26:28 +02:00

Use some() instead of filter() in v2.js

This commit is contained in:
Brikaa 2021-10-15 16:57:11 +02:00
parent 821d5496e4
commit 19252467cb

View file

@ -99,8 +99,7 @@ function get_job(body) {
if (
rt.language !== 'file' &&
files.filter(file => !file.encoding || file.encoding === 'utf8')
.length === 0
!files.some(file => !file.encoding || file.encoding === 'utf8')
) {
return reject({
message: 'files must include at least one utf8 encoded file',