MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / Checker

Method Checker

framework/framework/server.ts:743–767  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

741 this.registrationCount[name]++;
742
743 const Checker = (args) => {
744 let perm: bigint;
745 let priv: number;
746 let checker = () => { };
747 for (const item of args) {
748 if (typeof item === 'object') {
749 if (typeof item.call !== 'undefined') {
750 checker = item;
751 } else if (typeof item[0] === 'number') {
752 priv = item;
753 } else if (typeof item[0] === 'bigint') {
754 perm = item;
755 }
756 } else if (typeof item === 'number') {
757 priv = item;
758 } else if (typeof item === 'bigint') {
759 perm = item;
760 }
761 }
762 return function check(this: Handler) {
763 checker();
764 if (perm) this.checkPerm(perm);
765 if (priv) this.checkPriv(priv);
766 };
767 };
768
769 // We hope to use parent context for handler (the context that calls register)
770 // So that handler can use services injected before calling register

Callers

nothing calls this directly

Calls 2

checkPermMethod · 0.80
checkPrivMethod · 0.80

Tested by

no test coverage detected