fix once of example module

This commit is contained in:
fullgream 2025-02-24 18:07:38 +03:00
parent daa38cdeab
commit 0f0626dc57

View File

@ -1,7 +1,7 @@
const express = require("express");
const { NetHelperModule } = global.moduleApi;
const HTTPReverse = require("../components/http-reverse");
const HTTPServer = require("../components/_http");
module.exports = class CustomAuthPage extends NetHelperModule {
constructor () {
@ -11,7 +11,7 @@ module.exports = class CustomAuthPage extends NetHelperModule {
this.cauth = new this.statics.Operator("cauth", (argv) => {
return argv.length === 2;
}, (argv, self, syntaxTree) => {
if (![HTTPReverse].includes(syntaxTree.Type)) {
if (!(syntaxTree.Type.prototype instanceof HTTPServer)) {
throw new SyntaxError("Unsupported type of server");
}
const [ login, password ] = argv;