Files
Xen-Orchestra-xen-orchestra…/packages/xen-api/_isReadOnlyCall.mjs
2023-11-20 14:32:44 +01:00

7 lines
190 B
JavaScript

const RE = /^[^.]+\.get_/
export default function isReadOnlyCall(method, args) {
const n = args.length
return (n === 0 || (n === 1 && typeof args[0] === 'string')) && RE.test(method)
}