mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +00:00
api/api-keys: replace .find() with .some() in allowedServices
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run tests / check lockfile correctness (push) Waiting to run
& also a little refactor
This commit is contained in:
parent
dce9eb30c1
commit
8feaf5c636
@ -80,10 +80,10 @@ const validateKeys = (input) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (details.allowedServices) {
|
if (details.allowedServices) {
|
||||||
const isArray = Array.isArray(details.allowedServices);
|
if (Array.isArray(details.allowedServices)) {
|
||||||
|
const invalid_services = details.allowedServices.some(
|
||||||
if (isArray) {
|
service => !env.allServices.has(service)
|
||||||
const invalid_services = details.allowedServices.find(service => !env.allServices.has(service));
|
);
|
||||||
if (invalid_services) {
|
if (invalid_services) {
|
||||||
throw "`allowedServices` in details contains an invalid service";
|
throw "`allowedServices` in details contains an invalid service";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user