Skip to content

Commit

Permalink
Rename resolveArgs -> resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
zajrik committed Jun 7, 2017
1 parent e49c0ee commit cd2a2e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/command/base/blacklist/Blacklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class extends Command<Client>
});
}

@using(Middleware.resolveArgs({ '<user>': 'User' }))
@using(Middleware.resolve({ '<user>': 'User' }))
@using(Middleware.expect({ '<user>': 'User' }))
public async action(message: Message, [user, global]: [User, string]): Promise<Message | Message[]>
{
Expand Down
2 changes: 1 addition & 1 deletion src/command/base/blacklist/Whitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class extends Command<Client>
});
}

@using(Middleware.resolveArgs({ '<user>': 'User' }))
@using(Middleware.resolve({ '<user>': 'User' }))
@using(Middleware.expect({ '<user>': 'User' }))
public async action(message: Message, [user, global]: [User, string]): Promise<Message | Message[]>
{
Expand Down
8 changes: 4 additions & 4 deletions src/command/middleware/Middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Client } from '../../client/Client';
import { Command } from '../Command';
import { expect } from './Expect';
import { resolveArgs } from './ResolveArgs';
import { resolve } from './ResolveArgs';
import { MiddlewareFunction } from '../../types/MiddlewareFunction';
import { ResolveArgType } from '../../types/ResolveArgType';
import { ExpectArgType } from '../../types/ExpectArgType';
Expand Down Expand Up @@ -29,15 +29,15 @@ export class Middleware
* Supports `'...'` in the argument name as the final argument to gather
* all remaining words into one string and attempt to resolve them to
* the provided argument type
* @method resolveArgs
* @method resolve
* @param {object} argTypes An object of argument names mapped to argument types<br>
* See: {@link ResolveArgType}
* @returns {MiddlewareFunction} ```
* (message: Message, args: any[]) => [Message, any[]]
* ```
*/
public static resolveArgs: <T extends Client, U extends Command<T>>(argTypes: { [name: string]: ResolveArgType }) =>
MiddlewareFunction = resolveArgs;
public static resolve: <T extends Client, U extends Command<T>>(argTypes: { [name: string]: ResolveArgType }) =>
MiddlewareFunction = resolve;

/**
* Takes an object mapping argument names to argument types that
Expand Down
2 changes: 1 addition & 1 deletion src/command/middleware/ResolveArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Util } from '../../util/Util';
import { Time } from '../../util/Time';
import { Command } from '../Command';

export function resolveArgs<T extends Client, U extends Command<T>>(argTypes: { [name: string]: ResolveArgType }): MiddlewareFunction
export function resolve<T extends Client, U extends Command<T>>(argTypes: { [name: string]: ResolveArgType }): MiddlewareFunction
{
return async function(this: U, message: Message, args: any[]): Promise<[Message, any[]]>
{
Expand Down

0 comments on commit cd2a2e3

Please sign in to comment.