mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-08-21 10:33:37 +00:00
fix lint errors in mock-resolver.ts and activitypub.ts
This commit is contained in:
parent
3958b71f4e
commit
27e8289126
3 changed files with 9 additions and 2 deletions
|
@ -8,7 +8,7 @@ import type { ApDbResolverService } from '@/core/activitypub/ApDbResolverService
|
||||||
import type { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
import type { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
||||||
import type { ApRequestService } from '@/core/activitypub/ApRequestService.js';
|
import type { ApRequestService } from '@/core/activitypub/ApRequestService.js';
|
||||||
import { Resolver } from '@/core/activitypub/ApResolverService.js';
|
import { Resolver } from '@/core/activitypub/ApResolverService.js';
|
||||||
import type { IObject } from '@/core/activitypub/type.js';
|
import type { IObject, IObjectWithId } from '@/core/activitypub/type.js';
|
||||||
import type { HttpRequestService } from '@/core/HttpRequestService.js';
|
import type { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||||
import type { InstanceActorService } from '@/core/InstanceActorService.js';
|
import type { InstanceActorService } from '@/core/InstanceActorService.js';
|
||||||
import type { LoggerService } from '@/core/LoggerService.js';
|
import type { LoggerService } from '@/core/LoggerService.js';
|
||||||
|
@ -25,6 +25,7 @@ import type {
|
||||||
} from '@/models/_.js';
|
} from '@/models/_.js';
|
||||||
import { ApLogService } from '@/core/ApLogService.js';
|
import { ApLogService } from '@/core/ApLogService.js';
|
||||||
import { ApUtilityService } from '@/core/activitypub/ApUtilityService.js';
|
import { ApUtilityService } from '@/core/activitypub/ApUtilityService.js';
|
||||||
|
import { fromTuple } from '@/misc/from-tuple.js';
|
||||||
|
|
||||||
type MockResponse = {
|
type MockResponse = {
|
||||||
type: string;
|
type: string;
|
||||||
|
@ -72,8 +73,11 @@ export class MockResolver extends Resolver {
|
||||||
return this.#remoteGetTrials;
|
return this.#remoteGetTrials;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async resolve(value: string | [string]): Promise<IObjectWithId>;
|
||||||
|
public async resolve(value: string | IObject | [string | IObject]): Promise<IObject>;
|
||||||
@bindThis
|
@bindThis
|
||||||
public async resolve(value: string | IObject): Promise<IObject> {
|
public async resolve(value: string | IObject | [string | IObject]): Promise<IObject> {
|
||||||
|
value = fromTuple(value);
|
||||||
if (typeof value !== 'string') return value;
|
if (typeof value !== 'string') return value;
|
||||||
|
|
||||||
this.#remoteGetTrials.push(value);
|
this.#remoteGetTrials.push(value);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
@ -27,6 +28,7 @@ import { DI } from '@/di-symbols.js';
|
||||||
import { secureRndstr } from '@/misc/secure-rndstr.js';
|
import { secureRndstr } from '@/misc/secure-rndstr.js';
|
||||||
import { DownloadService } from '@/core/DownloadService.js';
|
import { DownloadService } from '@/core/DownloadService.js';
|
||||||
import { genAidx } from '@/misc/id/aidx.js';
|
import { genAidx } from '@/misc/id/aidx.js';
|
||||||
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { MockResolver } from '../misc/mock-resolver.js';
|
import { MockResolver } from '../misc/mock-resolver.js';
|
||||||
import { UserKeypairService } from '@/core/UserKeypairService.js';
|
import { UserKeypairService } from '@/core/UserKeypairService.js';
|
||||||
import { MemoryKVCache, RedisKVCache } from '@/misc/cache.js';
|
import { MemoryKVCache, RedisKVCache } from '@/misc/cache.js';
|
||||||
|
|
|
@ -41,6 +41,7 @@ export default [
|
||||||
'@typescript-eslint/prefer-nullish-coalescing': ['warn', {
|
'@typescript-eslint/prefer-nullish-coalescing': ['warn', {
|
||||||
ignorePrimitives: true,
|
ignorePrimitives: true,
|
||||||
}],
|
}],
|
||||||
|
'no-param-reassign': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Reference in a new issue