This commit is contained in:
Elysia
2024-02-14 08:14:01 +07:00
parent 077f087ca0
commit 08f822e48a
3 changed files with 25 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
'use strict';
const { Agent } = require('node:http');
const { parse } = require('node:path');
const process = require('node:process');
const { Collection } = require('@discordjs/collection');
@@ -808,6 +809,15 @@ class Util extends null {
let defaultValue;
return () => (defaultValue ??= cb());
}
/**
* Hacking check object instanceof Proxy-agent
* @param {Object} object any
* @returns {boolean}
*/
static verifyProxyAgent(object) {
return typeof object == 'object' && object.httpAgent instanceof Agent && object.httpsAgent instanceof Agent;
}
}
module.exports = Util;