Add unit tests for role middleware
Some checks are pending
Docker Test / test (push) Waiting to run

This commit is contained in:
BibaBot 2026-03-17 07:07:36 +00:00
parent 7a9bf3199a
commit c294e2e9ae
5702 changed files with 465039 additions and 34 deletions

19
node_modules/formidable/src/helpers/firstValues.js generated vendored Normal file
View file

@ -0,0 +1,19 @@
import { multipartType } from '../plugins/multipart.js';
import { querystringType } from '../plugins/querystring.js';
const firstValues = (form, fields, exceptions = []) => {
if (form.type !== querystringType && form.type !== multipartType) {
return fields;
}
return Object.fromEntries(
Object.entries(fields).map(([key, value]) => {
if (exceptions.includes(key)) {
return [key, value];
}
return [key, value[0]];
}),
);
};
export { firstValues };

10
node_modules/formidable/src/helpers/readBooleans.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
const readBooleans = (fields, listOfBooleans) => {
// html forms do not send off at all
const fieldsWithBooleans = { ...fields };
listOfBooleans.forEach((key) => {
fieldsWithBooleans[key] = fields[key] === `on` || fields[key] === true;
});
return fieldsWithBooleans;
};
export { readBooleans };