Skip to content
Snippets Groups Projects
Commit 9f26e261 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Add missing auditor auditQuerySingleton.

parent e9800889
No related branches found
No related tags found
No related merge requests found
import type { Auditor } from "@auditors/core"
import {
auditArray,
auditChain,
auditFunction,
auditTest,
} from "@auditors/core"
export function auditQuerySingleton(...auditors: Auditor[]) {
return auditChain(
auditArray(),
auditTest(
(values) => values.length <= 1,
"Parameter must be present only once in query",
),
auditFunction((value) => value[0]),
...auditors,
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment