mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
eslint-config: add de-morgan
This commit is contained in:
10 files changed
+19
-19
No files matched your search
@@ -123,8 +123,7 @@ export class ConnectionHandler extends ConnectionHandlerOriginal {
|
||||
}
|
||||
|
||||
onerror(err: HydroError) {
|
||||
if (!(err instanceof NotFoundError)
|
||||
&& !((err instanceof PrivilegeError || err instanceof PermissionError) && this.user?._id === 0)) {
|
||||
if (![NotFoundError, PrivilegeError, PermissionError].some((i) => err instanceof i) || this.user?._id !== 0) {
|
||||
logger.error(`Path:${this.request.path}, User:${this.user?._id}(${this.user?.uname})`);
|
||||
logger.error(err);
|
||||
}
|
||||
|
||||
@@ -154,11 +154,11 @@ export default class Watcher extends Service {
|
||||
for (const filename in require.cache) {
|
||||
const module = require.cache[filename];
|
||||
const plugin = unwrapExports(module.exports);
|
||||
if (!(typeof plugin === 'object' && plugin && 'apply' in plugin)) continue;
|
||||
if (typeof plugin !== 'object' || !plugin || !('apply' in plugin)) continue;
|
||||
const runtime = this.ctx.registry.get(plugin);
|
||||
if (!runtime || this.declined.has(filename)) continue;
|
||||
pending.set(filename, runtime);
|
||||
if (!(plugin && 'sideEffect' in plugin && plugin['sideEffect'])) this.declined.add(filename);
|
||||
if (!plugin || !('sideEffect' in plugin) || !plugin['sideEffect']) this.declined.add(filename);
|
||||
}
|
||||
|
||||
for (const [filename, runtime] of pending) {
|
||||
|
||||
Reference in new issue
Block a user