Skip to content

Commit dabf8a2

Browse files
committed
refactor: replace indexOf method
1 parent ce498e8 commit dabf8a2

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/common/cache/interfaces/cache-module.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface CacheModuleAsyncOptions
1414
useExisting?: Type<CacheOptionsFactory>;
1515
useClass?: Type<CacheOptionsFactory>;
1616
useFactory?: (
17-
...args: any[]
17+
...args: any[],
1818
) => Promise<CacheModuleOptions> | CacheModuleOptions;
1919
inject?: any[];
2020
}

packages/core/injector/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export class Module {
315315
.filter(metatype => metatype)
316316
.map(({ name }) => name);
317317

318-
if (importedRefNames.indexOf(token) < 0) {
318+
if (!importedRefNames.includes(token)) {
319319
const { name } = this.metatype;
320320
throw new UnknownExportException(name);
321321
}

packages/core/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class DependenciesScanner {
271271
const providersKeys = Object.keys(applyProvidersMap);
272272
const type = component.provide;
273273

274-
if (providersKeys.indexOf(type) < 0) {
274+
if (!providersKeys.includes(type)) {
275275
return this.container.addComponent(component, token);
276276
}
277277
const providerToken = randomStringGenerator();

packages/websockets/socket-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class SocketModule {
5858
return;
5959
}
6060
const metadataKeys = Reflect.getMetadataKeys(metatype);
61-
if (metadataKeys.indexOf(GATEWAY_METADATA) < 0) {
61+
if (!metadataKeys.includes(GATEWAY_METADATA)) {
6262
return;
6363
}
6464
this.webSocketsController.hookGatewayIntoServer(

0 commit comments

Comments
 (0)