Socket
Socket
Sign inDemoInstall

@notenoughupdates/discord-akairo

Package Overview
Dependencies
1
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.0.10-dev.1639356088.96444cd to 9.0.10-dev.1639522490.0ef60dc

2

dist/package.json
{
"name": "@notenoughupdates/discord-akairo",
"version": "9.0.10-dev.1639356088.96444cd",
"version": "9.0.10-dev.1639522490.0ef60dc",
"description": "A highly customizable bot framework for Discord.js.",

@@ -5,0 +5,0 @@ "main": "./dist/src/index.js",

@@ -6,3 +6,3 @@ import "source-map-support/register";

import ClientUtil from "./struct/ClientUtil";
import Argument, { ArgumentMatch, ArgumentOptions, ArgumentPromptData, ArgumentPromptOptions, ArgumentType, ArgumentTypeCaster, ArgumentTypeCaster_, BaseArgumentType, DefaultArgumentOptions, DefaultValueSupplier, FailureData, OtherwiseContentModifier, OtherwiseContentSupplier, ParsedValuePredicate, PromptContentModifier, PromptContentSupplier } from "./struct/commands/arguments/Argument";
import Argument, { ArgumentMatch, ArgumentOptions, ArgumentPromptData, ArgumentPromptOptions, ArgumentType, ArgumentTypeCaster, BaseArgumentType, DefaultArgumentOptions, DefaultValueSupplier, FailureData, OtherwiseContentModifier, OtherwiseContentSupplier, ParsedValuePredicate, PromptContentModifier, PromptContentSupplier } from "./struct/commands/arguments/Argument";
import ArgumentRunner, { ArgumentRunnerState } from "./struct/commands/arguments/ArgumentRunner";

@@ -43,3 +43,3 @@ import TypeResolver from "./struct/commands/arguments/TypeResolver";

export { AkairoClient, AkairoError, AkairoHandler, AkairoMessage, AkairoModule, Argument, ArgumentRunner, ArgumentRunnerState, Category, ClientUtil, Command, CommandHandler, CommandUtil, Constants, ContentParser, ContentParserResult, ContextMenuCommand, ContextMenuCommandHandler, Flag, Inhibitor, InhibitorHandler, Listener, ListenerHandler, PromptContentModifier, RegisterInteractionCommandError, Task, TaskHandler, TypeResolver, Util, version };
export type { AkairoApplicationCommandAutocompleteOption, AkairoApplicationCommandChannelOptionData, AkairoApplicationCommandChoicesData, AkairoApplicationCommandNonOptionsData, AkairoApplicationCommandNumericOptionData, AkairoApplicationCommandOptionData, AkairoApplicationCommandSubCommandData, AkairoApplicationCommandSubGroupData, AkairoClientEvents, AkairoHandlerEvents, AkairoHandlerOptions, AkairoModuleOptions, AkairoOptions, ArgumentGenerator, ArgumentMatch, ArgumentOptions, ArgumentPromptData, ArgumentPromptOptions, ArgumentType, ArgumentTypeCaster_, ArgumentTypeCaster, BaseArgumentType, BeforeAction, CommandHandlerEvents, CommandHandlerOptions, CommandOptions, ContentParserOptions, ContextMenuCommandHandlerEvents, ContextMenuCommandOptions, CooldownData, DefaultArgumentOptions, DefaultValueSupplier, ExecutionPredicate, ExtractedFlags, FailureData, GuildTextBasedChannels, IgnoreCheckPredicate, InhibitorHandlerEvents, InhibitorOptions, InteractionArgs, KeySupplier, ListenerHandlerEvents, ListenerOptions, ListenerType, LoadPredicate, MentionPrefixPredicate, MissingPermissionSupplier, OtherwiseContentModifier, OtherwiseContentSupplier, ParsedComponentData, ParsedValuePredicate, PrefixSupplier, PromptContentSupplier, RegexSupplier, SlashOption, SlashPermissionsSupplier, SlashResolveTypes, StringData, TaskHandlerEvents, TaskOptions };
export type { AkairoApplicationCommandAutocompleteOption, AkairoApplicationCommandChannelOptionData, AkairoApplicationCommandChoicesData, AkairoApplicationCommandNonOptionsData, AkairoApplicationCommandNumericOptionData, AkairoApplicationCommandOptionData, AkairoApplicationCommandSubCommandData, AkairoApplicationCommandSubGroupData, AkairoClientEvents, AkairoHandlerEvents, AkairoHandlerOptions, AkairoModuleOptions, AkairoOptions, ArgumentGenerator, ArgumentMatch, ArgumentOptions, ArgumentPromptData, ArgumentPromptOptions, ArgumentType, ArgumentTypeCaster, BaseArgumentType, BeforeAction, CommandHandlerEvents, CommandHandlerOptions, CommandOptions, ContentParserOptions, ContextMenuCommandHandlerEvents, ContextMenuCommandOptions, CooldownData, DefaultArgumentOptions, DefaultValueSupplier, ExecutionPredicate, ExtractedFlags, FailureData, GuildTextBasedChannels, IgnoreCheckPredicate, InhibitorHandlerEvents, InhibitorOptions, InteractionArgs, KeySupplier, ListenerHandlerEvents, ListenerOptions, ListenerType, LoadPredicate, MentionPrefixPredicate, MissingPermissionSupplier, OtherwiseContentModifier, OtherwiseContentSupplier, ParsedComponentData, ParsedValuePredicate, PrefixSupplier, PromptContentSupplier, RegexSupplier, SlashOption, SlashPermissionsSupplier, SlashResolveTypes, StringData, TaskHandlerEvents, TaskOptions };
//# sourceMappingURL=index.d.ts.map
/// <reference types="node" />
import { BaseGuildVoiceChannel, BufferResolvable, Collection, Emoji, Guild, GuildMember, MessageAttachment, MessageEmbed, MessageEmbedOptions, PermissionString, Role, Snowflake, User } from "discord.js";
import { BufferResolvable, Collection, Emoji, Guild, GuildChannel, GuildMember, MessageAttachment, MessageEmbed, MessageEmbedOptions, PermissionString, Role, Snowflake, ThreadChannel, User } from "discord.js";
import type { Stream } from "stream";
import type { GuildTextBasedChannels } from "../typings/guildTextBasedChannels.js";
import type AkairoClient from "./AkairoClient.js";

@@ -31,3 +30,3 @@ /**

*/
checkChannel(text: string, channel: GuildTextBasedChannels | BaseGuildVoiceChannel, caseSensitive?: boolean, wholeWord?: boolean): boolean;
checkChannel<C extends ThreadChannel | GuildChannel>(text: string, channel: C, caseSensitive?: boolean, wholeWord?: boolean): boolean;
/**

@@ -108,3 +107,3 @@ * Checks if a string could be referring to a emoji.

*/
resolveChannel(text: string, channels: Collection<Snowflake, GuildTextBasedChannels | BaseGuildVoiceChannel>, caseSensitive?: boolean, wholeWord?: boolean): GuildTextBasedChannels | BaseGuildVoiceChannel | undefined;
resolveChannel<C extends ThreadChannel | GuildChannel>(text: string, channels: Collection<Snowflake, C>, caseSensitive?: boolean, wholeWord?: boolean): C | null;
/**

@@ -117,3 +116,3 @@ * Resolves multiple channels from a string, such as an ID, a name, or a mention.

*/
resolveChannels(text: string, channels: Collection<Snowflake, GuildTextBasedChannels | BaseGuildVoiceChannel>, caseSensitive?: boolean, wholeWord?: boolean): Collection<Snowflake, GuildTextBasedChannels | BaseGuildVoiceChannel>;
resolveChannels<C extends ThreadChannel | GuildChannel>(text: string, channels: Collection<Snowflake, C>, caseSensitive?: boolean, wholeWord?: boolean): Collection<Snowflake, C>;
/**

@@ -126,3 +125,3 @@ * Resolves a custom emoji from a string, such as a name or a mention.

*/
resolveEmoji(text: string, emojis: Collection<Snowflake, Emoji>, caseSensitive?: boolean, wholeWord?: boolean): Emoji | undefined;
resolveEmoji(text: string, emojis: Collection<Snowflake, Emoji>, caseSensitive?: boolean, wholeWord?: boolean): Emoji | null;
/**

@@ -143,3 +142,3 @@ * Resolves multiple custom emojis from a string, such as a name or a mention.

*/
resolveGuild(text: string, guilds: Collection<Snowflake, Guild>, caseSensitive?: boolean, wholeWord?: boolean): Guild | undefined;
resolveGuild(text: string, guilds: Collection<Snowflake, Guild>, caseSensitive?: boolean, wholeWord?: boolean): Guild | null;
/**

@@ -160,3 +159,3 @@ * Resolves multiple guilds from a string, such as an ID or a name.

*/
resolveMember(text: string, members: Collection<Snowflake, GuildMember>, caseSensitive?: boolean, wholeWord?: boolean): GuildMember | undefined;
resolveMember(text: string, members: Collection<Snowflake, GuildMember>, caseSensitive?: boolean, wholeWord?: boolean): GuildMember | null;
/**

@@ -182,3 +181,3 @@ * Resolves multiple members from a string, such as an ID, a name, or a mention.

*/
resolveRole(text: string, roles: Collection<Snowflake, Role>, caseSensitive?: boolean, wholeWord?: boolean): Role | undefined;
resolveRole(text: string, roles: Collection<Snowflake, Role>, caseSensitive?: boolean, wholeWord?: boolean): Role | null;
/**

@@ -199,3 +198,3 @@ * Resolves multiple roles from a string, such as an ID, a name, or a mention.

*/
resolveUser(text: Snowflake | string, users: Collection<Snowflake, User>, caseSensitive?: boolean, wholeWord?: boolean): User | undefined;
resolveUser(text: Snowflake | string, users: Collection<Snowflake, User>, caseSensitive?: boolean, wholeWord?: boolean): User | null;
/**

@@ -202,0 +201,0 @@ * Resolves multiple users from a string, such as an ID, a name, or a mention.

@@ -206,4 +206,3 @@ "use strict";

resolveChannel(text, channels, caseSensitive = false, wholeWord = false) {
return (channels.get(text) ||
channels.find(channel => this.checkChannel(text, channel, caseSensitive, wholeWord)));
return (channels.get(text) ?? channels.find(channel => this.checkChannel(text, channel, caseSensitive, wholeWord)) ?? null);
}

@@ -228,3 +227,3 @@ /**

resolveEmoji(text, emojis, caseSensitive = false, wholeWord = false) {
return (emojis.get(text) || emojis.find(emoji => this.checkEmoji(text, emoji, caseSensitive, wholeWord)));
return emojis.get(text) ?? emojis.find(emoji => this.checkEmoji(text, emoji, caseSensitive, wholeWord)) ?? null;
}

@@ -249,3 +248,3 @@ /**

resolveGuild(text, guilds, caseSensitive = false, wholeWord = false) {
return (guilds.get(text) || guilds.find(guild => this.checkGuild(text, guild, caseSensitive, wholeWord)));
return guilds.get(text) ?? guilds.find(guild => this.checkGuild(text, guild, caseSensitive, wholeWord)) ?? null;
}

@@ -270,3 +269,3 @@ /**

resolveMember(text, members, caseSensitive = false, wholeWord = false) {
return (members.get(text) || members.find(member => this.checkMember(text, member, caseSensitive, wholeWord)));
return (members.get(text) ?? members.find(member => this.checkMember(text, member, caseSensitive, wholeWord)) ?? null);
}

@@ -303,3 +302,3 @@ /**

resolveRole(text, roles, caseSensitive = false, wholeWord = false) {
return roles.get(text) || roles.find(role => this.checkRole(text, role, caseSensitive, wholeWord));
return roles.get(text) ?? roles.find(role => this.checkRole(text, role, caseSensitive, wholeWord)) ?? null;
}

@@ -324,3 +323,3 @@ /**

resolveUser(text, users, caseSensitive = false, wholeWord = false) {
return users.get(text) || users.find(user => this.checkUser(text, user, caseSensitive, wholeWord));
return users.get(text) ?? users.find(user => this.checkUser(text, user, caseSensitive, wholeWord)) ?? null;
}

@@ -327,0 +326,0 @@ /**

@@ -1,3 +0,10 @@

import type { Message, MessageOptions, MessagePayload } from "discord.js";
/// <reference types="node" />
import type { BaseGuildVoiceChannel, CategoryChannel, Collection, Emoji, Guild, GuildChannel, GuildEmoji, GuildMember, Invite, Message, MessageOptions, MessagePayload, NewsChannel, Role, StageChannel, StoreChannel, TextChannel, ThreadChannel, User, VoiceChannel } from "discord.js";
import type { URL } from "url";
import { GuildTextBasedChannels } from "../../../typings/guildTextBasedChannels.js";
import type AkairoClient from "../../AkairoClient.js";
import ContextMenuCommand from "../../contextMenuCommands/ContextMenuCommand.js";
import Inhibitor from "../../inhibitors/Inhibitor.js";
import Listener from "../../listeners/Listener.js";
import Task from "../../tasks/Task.js";
import type Command from "../Command.js";

@@ -102,3 +109,4 @@ import type CommandHandler from "../CommandHandler.js";

*/
static cast(type: ArgumentType | ArgumentTypeCaster, resolver: TypeResolver, message: Message, phrase: string): Promise<any>;
static cast<T extends ArgumentTypeCaster>(type: T, resolver: TypeResolver, message: Message, phrase: string): Promise<ArgumentTypeCasterReturn<T>>;
static cast<T extends keyof BaseArgumentType>(type: T, resolver: TypeResolver, message: Message, phrase: string): Promise<BaseArgumentType[T]>;
/**

@@ -109,3 +117,5 @@ * Creates a type that is the left-to-right composition of the given types.

*/
static compose(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster;
static compose<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static compose<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
static compose<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
/**

@@ -116,3 +126,5 @@ * Creates a type that is the left-to-right composition of the given types.

*/
static composeWithFailure(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster;
static composeWithFailure<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static composeWithFailure<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
static composeWithFailure<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
/**

@@ -130,3 +142,5 @@ * Checks if something is null, undefined, or a fail flag.

*/
static product(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster;
static product<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static product<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
static product<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
/**

@@ -139,3 +153,5 @@ * Creates a type where the parsed value must be within a range.

*/
static range(type: ArgumentType | ArgumentTypeCaster, min: number, max: number, inclusive?: boolean): ArgumentTypeCaster;
static range<T extends ArgumentTypeCaster>(type: T, min: number, max: number, inclusive?: boolean): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static range<T extends keyof BaseArgumentType>(type: T, min: number, max: number, inclusive?: boolean): ArgumentTypeCaster<BaseArgumentType[T]>;
static range<T extends ArgumentType>(type: T, min: number, max: number, inclusive?: boolean): ArgumentTypeCaster;
/**

@@ -147,3 +163,5 @@ * Creates a type that parses as normal but also tags it with some data.

*/
static tagged(type: ArgumentType | ArgumentTypeCaster, tag?: any): ArgumentTypeCaster;
static tagged<T extends ArgumentTypeCaster>(type: T, tag?: any): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static tagged<T extends keyof BaseArgumentType>(type: T, tag?: any): ArgumentTypeCaster<BaseArgumentType[T]>;
static tagged<T extends ArgumentType>(type: T, tag?: any): ArgumentTypeCaster;
/**

@@ -155,3 +173,5 @@ * Creates a type from multiple types (union type).

*/
static taggedUnion(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster;
static taggedUnion<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static taggedUnion<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
static taggedUnion<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
/**

@@ -163,3 +183,5 @@ * Creates a type that parses as normal but also tags it with some data and carries the original input.

*/
static taggedWithInput(type: ArgumentType | ArgumentTypeCaster, tag?: any): ArgumentTypeCaster;
static taggedWithInput<T extends ArgumentTypeCaster>(type: T, tag?: any): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static taggedWithInput<T extends keyof BaseArgumentType>(type: T, tag?: any): ArgumentTypeCaster<BaseArgumentType[T]>;
static taggedWithInput<T extends ArgumentType>(type: T, tag?: any): ArgumentTypeCaster;
/**

@@ -170,3 +192,5 @@ * Creates a type from multiple types (union type).

*/
static union(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster;
static union<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static union<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
static union<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
/**

@@ -178,3 +202,5 @@ * Creates a type with extra validation.

*/
static validate(type: ArgumentType | ArgumentTypeCaster, predicate: ParsedValuePredicate): ArgumentTypeCaster;
static validate<T extends ArgumentTypeCaster>(type: T, predicate: ParsedValuePredicate): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static validate<T extends keyof BaseArgumentType>(type: T, predicate: ParsedValuePredicate): ArgumentTypeCaster<BaseArgumentType[T]>;
static validate<T extends ArgumentType>(type: T, predicate: ParsedValuePredicate): ArgumentTypeCaster;
/**

@@ -185,3 +211,5 @@ * Creates a type that parses as normal but also carries the original input.

*/
static withInput(type: ArgumentType | ArgumentTypeCaster): ArgumentTypeCaster;
static withInput<T extends ArgumentTypeCaster>(type: T): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
static withInput<T extends keyof BaseArgumentType>(type: T): ArgumentTypeCaster<BaseArgumentType[T]>;
static withInput<T extends ArgumentType>(type: T): ArgumentTypeCaster;
}

@@ -391,3 +419,3 @@ /**

/**
* * - `string` does not cast to any type.
* - `string` does not cast to any type.
* - `lowercase` makes the input lowercase.

@@ -437,3 +465,58 @@ * - `uppercase` makes the input uppercase.

*/
export declare type BaseArgumentType = "string" | "lowercase" | "uppercase" | "charCodes" | "number" | "integer" | "bigint" | "emojint" | "url" | "date" | "color" | "user" | "users" | "member" | "members" | "relevant" | "relevants" | "channel" | "channels" | "textChannel" | "textChannels" | "voiceChannel" | "voiceChannels" | "categoryChannel" | "categoryChannels" | "newsChannel" | "newsChannels" | "storeChannel" | "storeChannels" | "stageChannel" | "stageChannels" | "threadChannel" | "threadChannels" | "role" | "roles" | "emoji" | "emojis" | "guild" | "guilds" | "message" | "guildMessage" | "relevantMessage" | "invite" | "userMention" | "memberMention" | "channelMention" | "roleMention" | "emojiMention" | "commandAlias" | "command" | "inhibitor" | "listener" | "task" | "contextMenuCommand";
export interface BaseArgumentType {
string: string | null;
lowercase: string | null;
uppercase: string | null;
charCodes: number[] | null;
number: number | null;
integer: number | null;
bigint: bigint | null;
emojint: number | null;
url: URL | null;
date: Date | null;
color: number | null;
user: User | null;
users: Collection<string, User> | null;
member: GuildMember | null;
members: Collection<string, GuildMember> | null;
relevant: User | GuildMember | null;
relevants: Collection<string, User> | Collection<string, GuildMember> | null;
channel: GuildTextBasedChannels | BaseGuildVoiceChannel | null;
channels: Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel> | null;
textChannel: TextChannel | null;
textChannels: Collection<string, TextChannel>;
voiceChannel: VoiceChannel;
voiceChannels: Collection<string, VoiceChannel>;
categoryChannel: CategoryChannel;
categoryChannels: Collection<string, CategoryChannel>;
newsChannel: NewsChannel;
newsChannels: Collection<string, NewsChannel>;
storeChannel: StoreChannel;
storeChannels: Collection<string, StoreChannel>;
stageChannel: StageChannel;
stageChannels: Collection<string, StageChannel>;
threadChannel: ThreadChannel;
threadChannels: Collection<string, ThreadChannel>;
role: Role | null;
roles: Collection<string, Role> | null;
emoji: Emoji | null;
emojis: Collection<string, Emoji> | null;
guild: Guild | null;
guilds: Collection<string, Guild> | null;
message: Message | null;
guildMessage: Message | null;
relevantMessage: Message | null;
invite: Invite | null;
userMention: User | null;
memberMention: GuildMember | null;
channelMention: ThreadChannel | GuildChannel | null;
roleMention: Role | null;
emojiMention: GuildEmoji | null;
commandAlias: Command | null;
command: Command | null;
inhibitor: Inhibitor | null;
listener: Listener | null;
task: Task | null;
contextMenuCommand: ContextMenuCommand | null;
}
/**

@@ -449,3 +532,3 @@ * The type that the argument should be cast to.

*/
export declare type ArgumentType = BaseArgumentType | (string | string[])[] | RegExp | string;
export declare type ArgumentType = keyof BaseArgumentType | (string | string[])[] | RegExp | string;
/**

@@ -459,10 +542,7 @@ * A function for processing user input to use as an argument.

*/
export declare type ArgumentTypeCaster = (message: Message, phrase: string) => any;
export declare type ArgumentTypeCaster<R = unknown> = (message: Message, phrase: string) => R;
/**
* A function for processing some value to use as an argument.
* This is mainly used in composing argument types.
* @param message - Message that triggered the command.
* @param value - Some value.
* The return type of an argument.
*/
export declare type ArgumentTypeCaster_ = (message: Message, value: any) => any;
declare type ArgumentTypeCasterReturn<R> = R extends ArgumentTypeCaster<infer S> ? S : R;
/**

@@ -535,2 +615,3 @@ * Data passed to functions that run when things failed.

export declare type PromptContentSupplier = (message: Message, data: ArgumentPromptData) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;
export {};
//# sourceMappingURL=Argument.d.ts.map

@@ -244,9 +244,2 @@ "use strict";

}
/**
* Casts a phrase to this argument's type.
* @param type - The type to cast to.
* @param resolver - The type resolver.
* @param message - Message that called the command.
* @param phrase - Phrase to process.
*/
static async cast(type, resolver, message, phrase) {

@@ -293,7 +286,2 @@ if (Array.isArray(type)) {

}
/**
* Creates a type that is the left-to-right composition of the given types.
* If any of the types fails, the entire composition fails.
* @param types - Types to use.
*/
static compose(...types) {

@@ -312,7 +300,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type that is the left-to-right composition of the given types.
* If any of the types fails, the composition still continues with the failure passed on.
* @param types - Types to use.
*/
static composeWithFailure(...types) {

@@ -336,7 +319,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type from multiple types (product type).
* Only inputs where each type resolves with a non-void value are valid.
* @param types - Types to use.
*/
static product(...types) {

@@ -356,9 +334,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type where the parsed value must be within a range.
* @param type - The type to use.
* @param min - Minimum value.
* @param max - Maximum value.
* @param inclusive - Whether or not to be inclusive on the upper bound.
*/
static range(type, min, max, inclusive = false) {

@@ -370,8 +341,2 @@ return Argument.validate(type, (msg, p, x) => {

}
/**
* Creates a type that parses as normal but also tags it with some data.
* Result is in an object `{ tag, value }` and wrapped in `Flag.fail` when failed.
* @param type - The type to use.
* @param tag - Tag to add. Defaults to the `type` argument, so useful if it is a string.
*/
static tagged(type, tag = type) {

@@ -388,8 +353,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type from multiple types (union type).
* The first type that resolves to a non-void value is used.
* Each type will also be tagged using `tagged` with themselves.
* @param types - Types to use.
*/
static taggedUnion(...types) {

@@ -406,8 +365,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type that parses as normal but also tags it with some data and carries the original input.
* Result is in an object `{ tag, input, value }` and wrapped in `Flag.fail` when failed.
* @param type - The type to use.
* @param tag - Tag to add. Defaults to the `type` argument, so useful if it is a string.
*/
static taggedWithInput(type, tag = type) {

@@ -424,7 +377,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type from multiple types (union type).
* The first type that resolves to a non-void value is used.
* @param types - Types to use.
*/
static union(...types) {

@@ -442,8 +390,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type with extra validation.
* If the predicate is not true, the value is considered invalid.
* @param type - The type to use.
* @param predicate - The predicate function.
*/
static validate(type, predicate) {

@@ -461,7 +403,2 @@ return async function typeFn(message, phrase) {

}
/**
* Creates a type that parses as normal but also carries the original input.
* Result is in an object `{ input, value }` and wrapped in `Flag.fail` when failed.
* @param type - The type to use.
*/
static withInput(type) {

@@ -468,0 +405,0 @@ return async function typeFn(message, phrase) {

@@ -8,3 +8,3 @@ import { Collection } from "discord.js";

import type CommandHandler from "../CommandHandler.js";
import type { ArgumentTypeCaster } from "./Argument.js";
import type { ArgumentTypeCaster, BaseArgumentType } from "./Argument.js";
/**

@@ -55,2 +55,3 @@ * Type resolver for command arguments.

*/
type(name: keyof BaseArgumentType): ArgumentTypeCaster;
type(name: string): ArgumentTypeCaster | undefined;

@@ -57,0 +58,0 @@ /**

@@ -115,3 +115,3 @@ "use strict";

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -123,3 +123,3 @@ return this.client.util.resolveMember(phrase, message.guild.members.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -132,5 +132,3 @@ const members = this.client.util.resolveMembers(phrase, message.guild.members.cache);

return null;
if (!message.guild)
return null;
const person = message.guild
const person = message.inGuild()
? this.client.util.resolveMember(phrase, message.guild.members.cache)

@@ -148,3 +146,3 @@ : this.client.util.resolveUser(phrase, new discord_js_1.Collection([

return null;
const persons = message.guild
const persons = message.inGuild()
? this.client.util.resolveMembers(phrase, message.guild.members.cache)

@@ -157,3 +155,5 @@ : this.client.util.resolveUsers(phrase, new discord_js_1.Collection([

return null;
return message.guild ? persons.map(member => member.user) : persons;
return message.inGuild()
? persons.mapValues(member => member.user)
: persons;
},

@@ -163,3 +163,3 @@ [Constants_js_1.ArgumentTypes.CHANNEL]: (message, phrase) => {

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -171,3 +171,3 @@ return this.client.util.resolveChannel(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -180,3 +180,3 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -191,3 +191,3 @@ const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -203,6 +203,6 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || !channel.isVoice())
if (!channel || channel.type !== "GUILD_VOICE")
return null;

@@ -214,3 +214,3 @@ return channel;

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -226,6 +226,6 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || channel.type !== "GUILD_CATEGORY")
if (channel?.type !== "GUILD_CATEGORY")
return null;

@@ -237,3 +237,3 @@ return channel;

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -249,6 +249,6 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || channel.type !== "GUILD_NEWS")
if (channel?.type !== "GUILD_NEWS")
return null;

@@ -260,3 +260,3 @@ return channel;

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -272,6 +272,6 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || channel.type !== "GUILD_STORE")
if (channel?.type !== "GUILD_STORE")
return null;

@@ -283,3 +283,3 @@ return channel;

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -295,6 +295,6 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || channel.type !== "GUILD_STAGE_VOICE")
if (channel?.type !== "GUILD_STAGE_VOICE")
return null;

@@ -306,3 +306,3 @@ return channel;

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -318,6 +318,6 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || !channel.type.includes("THREAD"))
if (!channel || !channel.isThread())
return null;

@@ -329,3 +329,3 @@ return channel;

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -335,3 +335,3 @@ const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);

return null;
const storeChannels = channels.filter(c => c.type.includes("THREAD"));
const storeChannels = channels.filter(c => c.isThread());
return storeChannels.size ? storeChannels : null;

@@ -342,3 +342,3 @@ },

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -350,3 +350,3 @@ return this.client.util.resolveRole(phrase, message.guild.roles.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -359,3 +359,3 @@ const roles = this.client.util.resolveRoles(phrase, message.guild.roles.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -367,3 +367,3 @@ return this.client.util.resolveEmoji(phrase, message.guild.emojis.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -397,6 +397,6 @@ const emojis = this.client.util.resolveEmojis(phrase, message.guild.emojis.cache);

return null;
if (!message.guild)
if (!message.inGuild())
return null;
for (const channel of message.guild.channels.cache.values()) {
if (channel.type !== "GUILD_TEXT")
if (!channel.isText())
continue;

@@ -420,5 +420,5 @@ try {

}
if (message.guild) {
if (message.inGuild()) {
for (const channel of message.guild.channels.cache.values()) {
if (channel.type !== "GUILD_TEXT")
if (!channel.isText())
continue;

@@ -452,3 +452,3 @@ try {

return null;
return this.client.users.cache.get(id[1]) || null;
return this.client.users.cache.get(id[1]) ?? null;
},

@@ -458,3 +458,3 @@ [Constants_js_1.ArgumentTypes.MEMBER_MENTION]: (message, phrase) => {

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -464,3 +464,3 @@ const id = phrase.match(/<@!?(\d{17,19})>/);

return null;
return message.guild.members.cache.get(id[1]) || null;
return message.guild.members.cache.get(id[1]) ?? null;
},

@@ -470,3 +470,3 @@ [Constants_js_1.ArgumentTypes.CHANNEL_MENTION]: (message, phrase) => {

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -476,3 +476,3 @@ const id = phrase.match(/<#(\d{17,19})>/);

return null;
return message.guild.channels.cache.get(id[1]) || null;
return message.guild.channels.cache.get(id[1]) ?? null;
},

@@ -487,3 +487,3 @@ [Constants_js_1.ArgumentTypes.ROLE_MENTION]: (message, phrase) => {

return null;
return message.guild.roles.cache.get(id[1]) || null;
return message.guild.roles.cache.get(id[1]) ?? null;
},

@@ -493,3 +493,3 @@ [Constants_js_1.ArgumentTypes.EMOJI_MENTION]: (message, phrase) => {

return null;
if (!message.guild)
if (!message.inGuild())
return null;

@@ -499,3 +499,3 @@ const id = phrase.match(/<a?:[a-zA-Z0-9_]+:(\d{17,19})>/);

return null;
return message.guild.emojis.cache.get(id[1]) || null;
return message.guild.emojis.cache.get(id[1]) ?? null;
},

@@ -505,3 +505,3 @@ [Constants_js_1.ArgumentTypes.COMMAND_ALIAS]: (_message, phrase) => {

return null;
return this.commandHandler.findCommand(phrase) || null;
return this.commandHandler.findCommand(phrase) ?? null;
},

@@ -511,3 +511,3 @@ [Constants_js_1.ArgumentTypes.COMMAND]: (_message, phrase) => {

return null;
return this.commandHandler.modules.get(phrase) || null;
return this.commandHandler.modules.get(phrase) ?? null;
},

@@ -517,3 +517,3 @@ [Constants_js_1.ArgumentTypes.INHIBITOR]: (_message, phrase) => {

return null;
return this.inhibitorHandler?.modules.get(phrase) || null;
return this.inhibitorHandler?.modules.get(phrase) ?? null;
},

@@ -523,3 +523,3 @@ [Constants_js_1.ArgumentTypes.LISTENER]: (_message, phrase) => {

return null;
return this.listenerHandler?.modules.get(phrase) || null;
return this.listenerHandler?.modules.get(phrase) ?? null;
},

@@ -529,3 +529,3 @@ [Constants_js_1.ArgumentTypes.TASK]: (_message, phrase) => {

return null;
return this.taskHandler?.modules.get(phrase) || null;
return this.taskHandler?.modules.get(phrase) ?? null;
},

@@ -535,3 +535,3 @@ [Constants_js_1.ArgumentTypes.CONTEXT_MENU_COMMAND]: (_message, phrase) => {

return null;
return this.contextMenuCommandHandler?.modules.get(phrase) || null;
return this.contextMenuCommandHandler?.modules.get(phrase) ?? null;
}

@@ -543,6 +543,2 @@ };

}
/**
* Gets the resolver function for a type.
* @param name - Name of type.
*/
type(name) {

@@ -549,0 +545,0 @@ return this.types.get(name);

@@ -969,9 +969,8 @@ "use strict";

}
let typing;
if (command.typing || this.typing) {
typing = setInterval(() => {
const typing = command.typing || this.typing
? setInterval(() => {
if (command.typing || this.typing)
message.channel.sendTyping();
}, 9000);
}
}, 9000)
: undefined;
try {

@@ -978,0 +977,0 @@ this.emit(Constants_js_1.CommandHandlerEvents.COMMAND_STARTED, message, command, args);

@@ -124,3 +124,3 @@ "use strict";

return str
.toUpperCase()
.toLowerCase()
.split("_")

@@ -127,0 +127,0 @@ .map((word, index) => {

{
"name": "@notenoughupdates/discord-akairo",
"version": "9.0.10-dev.1639356088.96444cd",
"version": "9.0.10-dev.1639522490.0ef60dc",
"description": "A highly customizable bot framework for Discord.js.",

@@ -5,0 +5,0 @@ "main": "./dist/src/index.js",

@@ -14,3 +14,2 @@ import "source-map-support/register";

ArgumentTypeCaster,
ArgumentTypeCaster_,
BaseArgumentType,

@@ -157,3 +156,2 @@ DefaultArgumentOptions,

ArgumentType,
ArgumentTypeCaster_,
ArgumentTypeCaster,

@@ -160,0 +158,0 @@ BaseArgumentType,

import {
BaseGuildVoiceChannel,
BufferResolvable,

@@ -7,2 +6,3 @@ Collection,

Guild,
GuildChannel,
GuildMember,

@@ -16,6 +16,6 @@ MessageAttachment,

Snowflake,
ThreadChannel,
User
} from "discord.js";
import type { Stream } from "stream";
import type { GuildTextBasedChannels } from "../typings/guildTextBasedChannels.js";
import type AkairoClient from "./AkairoClient.js";

@@ -55,5 +55,5 @@

*/
public checkChannel(
public checkChannel<C extends ThreadChannel | GuildChannel>(
text: string,
channel: GuildTextBasedChannels | BaseGuildVoiceChannel,
channel: C,
caseSensitive = false,

@@ -264,11 +264,10 @@ wholeWord = false

*/
public resolveChannel(
public resolveChannel<C extends ThreadChannel | GuildChannel>(
text: string,
channels: Collection<Snowflake, GuildTextBasedChannels | BaseGuildVoiceChannel>,
channels: Collection<Snowflake, C>,
caseSensitive = false,
wholeWord = false
): GuildTextBasedChannels | BaseGuildVoiceChannel | undefined {
): C | null {
return (
channels.get(text as Snowflake) ||
channels.find(channel => this.checkChannel(text, channel, caseSensitive, wholeWord))
channels.get(text) ?? channels.find(channel => this.checkChannel(text, channel, caseSensitive, wholeWord)) ?? null
);

@@ -284,8 +283,8 @@ }

*/
public resolveChannels(
public resolveChannels<C extends ThreadChannel | GuildChannel>(
text: string,
channels: Collection<Snowflake, GuildTextBasedChannels | BaseGuildVoiceChannel>,
channels: Collection<Snowflake, C>,
caseSensitive = false,
wholeWord = false
): Collection<Snowflake, GuildTextBasedChannels | BaseGuildVoiceChannel> {
): Collection<Snowflake, C> {
return channels.filter(channel => this.checkChannel(text, channel, caseSensitive, wholeWord));

@@ -306,6 +305,4 @@ }

wholeWord = false
): Emoji | undefined {
return (
emojis.get(text as Snowflake) || emojis.find(emoji => this.checkEmoji(text, emoji, caseSensitive, wholeWord))
);
): Emoji | null {
return emojis.get(text) ?? emojis.find(emoji => this.checkEmoji(text, emoji, caseSensitive, wholeWord)) ?? null;
}

@@ -341,6 +338,4 @@

wholeWord = false
): Guild | undefined {
return (
guilds.get(text as Snowflake) || guilds.find(guild => this.checkGuild(text, guild, caseSensitive, wholeWord))
);
): Guild | null {
return guilds.get(text) ?? guilds.find(guild => this.checkGuild(text, guild, caseSensitive, wholeWord)) ?? null;
}

@@ -376,5 +371,5 @@

wholeWord = false
): GuildMember | undefined {
): GuildMember | null {
return (
members.get(text as Snowflake) || members.find(member => this.checkMember(text, member, caseSensitive, wholeWord))
members.get(text) ?? members.find(member => this.checkMember(text, member, caseSensitive, wholeWord)) ?? null
);

@@ -425,4 +420,4 @@ }

wholeWord = false
): Role | undefined {
return roles.get(text as Snowflake) || roles.find(role => this.checkRole(text, role, caseSensitive, wholeWord));
): Role | null {
return roles.get(text) ?? roles.find(role => this.checkRole(text, role, caseSensitive, wholeWord)) ?? null;
}

@@ -458,4 +453,4 @@

wholeWord = false
): User | undefined {
return users.get(text as Snowflake) || users.find(user => this.checkUser(text, user, caseSensitive, wholeWord));
): User | null {
return users.get(text) ?? users.find(user => this.checkUser(text, user, caseSensitive, wholeWord)) ?? null;
}

@@ -462,0 +457,0 @@

@@ -1,5 +0,32 @@

import type { Message, MessageOptions, MessagePayload } from "discord.js";
import type {
BaseGuildVoiceChannel,
CategoryChannel,
Collection,
Emoji,
Guild,
GuildChannel,
GuildEmoji,
GuildMember,
Invite,
Message,
MessageOptions,
MessagePayload,
NewsChannel,
Role,
StageChannel,
StoreChannel,
TextChannel,
ThreadChannel,
User,
VoiceChannel
} from "discord.js";
import type { URL } from "url";
import { GuildTextBasedChannels } from "../../../typings/guildTextBasedChannels.js";
import { ArgumentMatches, ArgumentTypes } from "../../../util/Constants.js";
import Util from "../../../util/Util.js";
import type AkairoClient from "../../AkairoClient.js";
import ContextMenuCommand from "../../contextMenuCommands/ContextMenuCommand.js";
import Inhibitor from "../../inhibitors/Inhibitor.js";
import Listener from "../../listeners/Listener.js";
import Task from "../../tasks/Task.js";
import type Command from "../Command.js";

@@ -132,3 +159,3 @@ import type CommandHandler from "../CommandHandler.js";

public cast(message: Message, phrase: string): Promise<any> {
return Argument.cast(this.type, this.handler.resolver, message, phrase);
return Argument.cast(this.type as any, this.handler.resolver, message, phrase);
}

@@ -379,7 +406,19 @@

*/
public static async cast(
type: ArgumentType | ArgumentTypeCaster,
public static cast<T extends ArgumentTypeCaster>(
type: T,
resolver: TypeResolver,
message: Message,
phrase: string
): Promise<ArgumentTypeCasterReturn<T>>;
public static cast<T extends keyof BaseArgumentType>(
type: T,
resolver: TypeResolver,
message: Message,
phrase: string
): Promise<BaseArgumentType[T]>;
public static async cast<T extends ArgumentTypeCaster | keyof BaseArgumentType>(
type: T,
resolver: TypeResolver,
message: Message,
phrase: string
): Promise<any> {

@@ -437,8 +476,11 @@ if (Array.isArray(type)) {

*/
public static compose(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {
public static compose<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static compose<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
public static compose<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
public static compose(...types: (keyof ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {
let acc = phrase;
let acc: any = phrase;
for (let entry of types) {
if (typeof entry === "function") entry = entry.bind(this);
acc = await Argument.cast(entry, this.handler.resolver, message, acc);
acc = await Argument.cast(entry as any, this.handler.resolver, message, acc);
if (Argument.isFailure(acc)) return acc;

@@ -456,8 +498,15 @@ }

*/
public static composeWithFailure<T extends ArgumentTypeCaster>(
...types: T[]
): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static composeWithFailure<T extends keyof BaseArgumentType>(
...types: T[]
): ArgumentTypeCaster<BaseArgumentType[T]>;
public static composeWithFailure<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
public static composeWithFailure(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {
let acc = phrase;
let acc: any = phrase;
for (let entry of types) {
if (typeof entry === "function") entry = entry.bind(this);
acc = await Argument.cast(entry, this.handler.resolver, message, acc);
acc = await Argument.cast(entry as any, this.handler.resolver, message, acc);
}

@@ -482,2 +531,5 @@

*/
public static product<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static product<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
public static product<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
public static product(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {

@@ -488,3 +540,3 @@ return async function typeFn(this: any, message, phrase) {

if (typeof entry === "function") entry = entry.bind(this);
const res = await Argument.cast(entry, this.handler.resolver, message, phrase);
const res = await Argument.cast(entry as any, this.handler.resolver, message, phrase);
if (Argument.isFailure(res)) return res;

@@ -505,2 +557,20 @@ results.push(res);

*/
public static range<T extends ArgumentTypeCaster>(
type: T,
min: number,
max: number,
inclusive?: boolean
): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static range<T extends keyof BaseArgumentType>(
type: T,
min: number,
max: number,
inclusive?: boolean
): ArgumentTypeCaster<BaseArgumentType[T]>;
public static range<T extends ArgumentType>(
type: T,
min: number,
max: number,
inclusive?: boolean
): ArgumentTypeCaster;
public static range(

@@ -512,3 +582,3 @@ type: ArgumentType | ArgumentTypeCaster,

): ArgumentTypeCaster {
return Argument.validate(type, (msg, p, x) => {
return Argument.validate(type as any, (msg, p, x) => {
const o =

@@ -527,6 +597,12 @@ typeof x === "number" || typeof x === "bigint" ? x : x.length != null ? x.length : x.size != null ? x.size : x;

*/
public static tagged<T extends ArgumentTypeCaster>(
type: T,
tag?: any
): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static tagged<T extends keyof BaseArgumentType>(type: T, tag?: any): ArgumentTypeCaster<BaseArgumentType[T]>;
public static tagged<T extends ArgumentType>(type: T, tag?: any): ArgumentTypeCaster;
public static tagged(type: ArgumentType | ArgumentTypeCaster, tag: any = type): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {
if (typeof type === "function") type = type.bind(this);
const res = await Argument.cast(type, this.handler.resolver, message, phrase);
const res = await Argument.cast(type as any, this.handler.resolver, message, phrase);
if (Argument.isFailure(res)) {

@@ -546,6 +622,11 @@ return Flag.fail({ tag, value: res });

*/
public static taggedUnion<T extends ArgumentTypeCaster>(
...types: T[]
): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static taggedUnion<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
public static taggedUnion<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
public static taggedUnion(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {
for (let entry of types) {
entry = Argument.tagged(entry);
entry = Argument.tagged(entry as any);
const res = await Argument.cast(entry, this.handler.resolver, message, phrase);

@@ -565,6 +646,15 @@ if (!Argument.isFailure(res)) return res;

*/
public static taggedWithInput<T extends ArgumentTypeCaster>(
type: T,
tag?: any
): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static taggedWithInput<T extends keyof BaseArgumentType>(
type: T,
tag?: any
): ArgumentTypeCaster<BaseArgumentType[T]>;
public static taggedWithInput<T extends ArgumentType>(type: T, tag?: any): ArgumentTypeCaster;
public static taggedWithInput(type: ArgumentType | ArgumentTypeCaster, tag: any = type): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {
if (typeof type === "function") type = type.bind(this);
const res = await Argument.cast(type, this.handler.resolver, message, phrase);
const res = await Argument.cast(type as any, this.handler.resolver, message, phrase);
if (Argument.isFailure(res)) {

@@ -583,3 +673,6 @@ return Flag.fail({ tag, input: phrase, value: res });

*/
public static union(...types: (ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {
public static union<T extends ArgumentTypeCaster>(...types: T[]): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static union<T extends keyof BaseArgumentType>(...types: T[]): ArgumentTypeCaster<BaseArgumentType[T]>;
public static union<T extends ArgumentType>(...types: T[]): ArgumentTypeCaster;
public static union(...types: (keyof ArgumentType | ArgumentTypeCaster)[]): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {

@@ -602,3 +695,15 @@ for (let entry of types) {

*/
public static validate(type: ArgumentType | ArgumentTypeCaster, predicate: ParsedValuePredicate): ArgumentTypeCaster {
public static validate<T extends ArgumentTypeCaster>(
type: T,
predicate: ParsedValuePredicate
): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static validate<T extends keyof BaseArgumentType>(
type: T,
predicate: ParsedValuePredicate
): ArgumentTypeCaster<BaseArgumentType[T]>;
public static validate<T extends ArgumentType>(type: T, predicate: ParsedValuePredicate): ArgumentTypeCaster;
public static validate(
type: keyof ArgumentType | ArgumentTypeCaster,
predicate: ParsedValuePredicate
): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {

@@ -618,6 +723,9 @@ if (typeof type === "function") type = type.bind(this);

*/
public static withInput<T extends ArgumentTypeCaster>(type: T): ArgumentTypeCaster<ArgumentTypeCasterReturn<T>>;
public static withInput<T extends keyof BaseArgumentType>(type: T): ArgumentTypeCaster<BaseArgumentType[T]>;
public static withInput<T extends ArgumentType>(type: T): ArgumentTypeCaster;
public static withInput(type: ArgumentType | ArgumentTypeCaster): ArgumentTypeCaster {
return async function typeFn(this: any, message, phrase) {
if (typeof type === "function") type = type.bind(this);
const res = await Argument.cast(type, this.handler.resolver, message, phrase);
const res = await Argument.cast(type as any, this.handler.resolver, message, phrase);
if (Argument.isFailure(res)) {

@@ -879,3 +987,3 @@ return Flag.fail({ input: phrase, value: res });

/**
* * - `string` does not cast to any type.
* - `string` does not cast to any type.
* - `lowercase` makes the input lowercase.

@@ -925,57 +1033,58 @@ * - `uppercase` makes the input uppercase.

*/
export type BaseArgumentType =
| "string"
| "lowercase"
| "uppercase"
| "charCodes"
| "number"
| "integer"
| "bigint"
| "emojint"
| "url"
| "date"
| "color"
| "user"
| "users"
| "member"
| "members"
| "relevant"
| "relevants"
| "channel"
| "channels"
| "textChannel"
| "textChannels"
| "voiceChannel"
| "voiceChannels"
| "categoryChannel"
| "categoryChannels"
| "newsChannel"
| "newsChannels"
| "storeChannel"
| "storeChannels"
| "stageChannel"
| "stageChannels"
| "threadChannel"
| "threadChannels"
| "role"
| "roles"
| "emoji"
| "emojis"
| "guild"
| "guilds"
| "message"
| "guildMessage"
| "relevantMessage"
| "invite"
| "userMention"
| "memberMention"
| "channelMention"
| "roleMention"
| "emojiMention"
| "commandAlias"
| "command"
| "inhibitor"
| "listener"
| "task"
| "contextMenuCommand";
export interface BaseArgumentType {
string: string | null;
lowercase: string | null;
uppercase: string | null;
charCodes: number[] | null;
number: number | null;
integer: number | null;
bigint: bigint | null;
emojint: number | null;
url: URL | null;
date: Date | null;
color: number | null;
user: User | null;
users: Collection<string, User> | null;
member: GuildMember | null;
members: Collection<string, GuildMember> | null;
relevant: User | GuildMember | null;
relevants: Collection<string, User> | Collection<string, GuildMember> | null;
channel: GuildTextBasedChannels | BaseGuildVoiceChannel | null;
channels: Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel> | null;
textChannel: TextChannel | null;
textChannels: Collection<string, TextChannel>;
voiceChannel: VoiceChannel;
voiceChannels: Collection<string, VoiceChannel>;
categoryChannel: CategoryChannel;
categoryChannels: Collection<string, CategoryChannel>;
newsChannel: NewsChannel;
newsChannels: Collection<string, NewsChannel>;
storeChannel: StoreChannel;
storeChannels: Collection<string, StoreChannel>;
stageChannel: StageChannel;
stageChannels: Collection<string, StageChannel>;
threadChannel: ThreadChannel;
threadChannels: Collection<string, ThreadChannel>;
role: Role | null;
roles: Collection<string, Role> | null;
emoji: Emoji | null;
emojis: Collection<string, Emoji> | null;
guild: Guild | null;
guilds: Collection<string, Guild> | null;
message: Message | null;
guildMessage: Message | null;
relevantMessage: Message | null;
invite: Invite | null;
userMention: User | null;
memberMention: GuildMember | null;
channelMention: ThreadChannel | GuildChannel | null;
roleMention: Role | null;
emojiMention: GuildEmoji | null;
commandAlias: Command | null;
command: Command | null;
inhibitor: Inhibitor | null;
listener: Listener | null;
task: Task | null;
contextMenuCommand: ContextMenuCommand | null;
}

@@ -992,3 +1101,3 @@ /**

*/
export type ArgumentType = BaseArgumentType | (string | string[])[] | RegExp | string;
export type ArgumentType = keyof BaseArgumentType | (string | string[])[] | RegExp | string;

@@ -1003,11 +1112,8 @@ /**

*/
export type ArgumentTypeCaster = (message: Message, phrase: string) => any;
export type ArgumentTypeCaster<R = unknown> = (message: Message, phrase: string) => R;
/**
* A function for processing some value to use as an argument.
* This is mainly used in composing argument types.
* @param message - Message that triggered the command.
* @param value - Some value.
* The return type of an argument.
*/
export type ArgumentTypeCaster_ = (message: Message, value: any) => any;
type ArgumentTypeCasterReturn<R> = R extends ArgumentTypeCaster<infer S> ? S : R;

@@ -1014,0 +1120,0 @@ /**

import {
BaseGuildVoiceChannel,
CategoryChannel,
Collection,

@@ -8,8 +8,9 @@ DMChannel,

NewsChannel,
Snowflake,
StageChannel,
StoreChannel,
TextChannel,
ThreadChannel
ThreadChannel,
VoiceChannel
} from "discord.js";
import { URL } from "url";
import type { GuildTextBasedChannels } from "../../../typings/guildTextBasedChannels.js";
import { ArgumentTypes } from "../../../util/Constants.js";

@@ -22,3 +23,3 @@ import type AkairoClient from "../../AkairoClient.js";

import type CommandHandler from "../CommandHandler.js";
import type { ArgumentTypeCaster } from "./Argument.js";
import type { ArgumentTypeCaster, BaseArgumentType } from "./Argument.js";

@@ -171,3 +172,3 @@ /**

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
return this.client.util.resolveMember(phrase, message.guild.members.cache);

@@ -178,3 +179,3 @@ },

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
const members = this.client.util.resolveMembers(phrase, message.guild.members.cache);

@@ -186,5 +187,4 @@ return members.size ? members : null;

if (!phrase) return null;
if (!message.guild) return null;
const person = message.guild
const person = message.inGuild()
? this.client.util.resolveMember(phrase, message.guild.members.cache)

@@ -205,3 +205,3 @@ : this.client.util.resolveUser(

if (!phrase) return null;
const persons = message.guild
const persons = message.inGuild()
? this.client.util.resolveMembers(phrase, message.guild.members.cache)

@@ -217,3 +217,5 @@ : this.client.util.resolveUsers(

if (!persons.size) return null;
return message.guild ? (persons as Collection<string, GuildMember>).map(member => member.user) : persons;
return message.inGuild()
? (persons as Collection<string, GuildMember>).mapValues(member => member.user)
: persons;
},

@@ -223,7 +225,4 @@

if (!phrase) return null;
if (!message.guild) return null;
return this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
return this.client.util.resolveChannel(phrase, message.guild.channels.cache);
},

@@ -233,7 +232,4 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
return channels.size ? channels : null;

@@ -244,10 +240,7 @@ },

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || channel.type !== "GUILD_TEXT") return null;
return channel;
return channel as TextChannel;
},

@@ -257,11 +250,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const textChannels = channels.filter(c => c.type === "GUILD_TEXT");
return textChannels.size ? textChannels : null;
return textChannels.size ? (textChannels as Collection<string, TextChannel>) : null;
},

@@ -271,9 +261,6 @@

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!channel || !channel.isVoice()) return null;
return channel;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || channel.type !== "GUILD_VOICE") return null;
return channel as VoiceChannel;
},

@@ -283,11 +270,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const voiceChannels = channels.filter(c => c.type === "GUILD_VOICE");
return voiceChannels.size ? voiceChannels : null;
return voiceChannels.size ? (voiceChannels as Collection<string, VoiceChannel>) : null;
},

@@ -297,10 +281,7 @@

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!channel || channel.type !== "GUILD_CATEGORY") return null;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (channel?.type !== "GUILD_CATEGORY") return null;
return channel;
return channel as CategoryChannel;
},

@@ -310,11 +291,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const categoryChannels = channels.filter(c => c.type === "GUILD_CATEGORY");
return categoryChannels.size ? categoryChannels : null;
return categoryChannels.size ? (categoryChannels as Collection<string, CategoryChannel>) : null;
},

@@ -324,10 +302,7 @@

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!channel || channel.type !== "GUILD_NEWS") return null;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (channel?.type !== "GUILD_NEWS") return null;
return channel;
return channel as NewsChannel;
},

@@ -337,11 +312,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const newsChannels = channels.filter(c => c.type === "GUILD_NEWS");
return newsChannels.size ? newsChannels : null;
return newsChannels.size ? (newsChannels as Collection<string, NewsChannel>) : null;
},

@@ -351,10 +323,7 @@

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!channel || channel.type !== "GUILD_STORE") return null;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (channel?.type !== "GUILD_STORE") return null;
return channel;
return channel as StoreChannel;
},

@@ -364,11 +333,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const storeChannels = channels.filter(c => c.type === "GUILD_STORE");
return storeChannels.size ? storeChannels : null;
return storeChannels.size ? (storeChannels as Collection<string, StoreChannel>) : null;
},

@@ -378,10 +344,7 @@

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!channel || channel.type !== "GUILD_STAGE_VOICE") return null;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (channel?.type !== "GUILD_STAGE_VOICE") return null;
return channel;
return channel as StageChannel;
},

@@ -391,11 +354,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const storeChannels = channels.filter(c => c.type === "GUILD_STAGE_VOICE");
return storeChannels.size ? storeChannels : null;
return storeChannels.size ? (storeChannels as Collection<string, StageChannel>) : null;
},

@@ -405,10 +365,7 @@

if (!phrase) return null;
if (!message.guild) return null;
const channel = this.client.util.resolveChannel(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!channel || !channel.type.includes("THREAD")) return null;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || !channel.isThread()) return null;
return channel;
return channel as ThreadChannel;
},

@@ -418,11 +375,8 @@

if (!phrase) return null;
if (!message.guild) return null;
const channels = this.client.util.resolveChannels(
phrase,
message.guild.channels.cache as Collection<string, GuildTextBasedChannels | BaseGuildVoiceChannel>
);
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
const storeChannels = channels.filter(c => c.type.includes("THREAD"));
return storeChannels.size ? storeChannels : null;
const storeChannels = channels.filter(c => c.isThread());
return storeChannels.size ? (storeChannels as Collection<string, ThreadChannel>) : null;
},

@@ -432,3 +386,3 @@

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
return this.client.util.resolveRole(phrase, message.guild.roles.cache);

@@ -439,3 +393,3 @@ },

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
const roles = this.client.util.resolveRoles(phrase, message.guild.roles.cache);

@@ -447,3 +401,3 @@ return roles.size ? roles : null;

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
return this.client.util.resolveEmoji(phrase, message.guild.emojis.cache);

@@ -454,3 +408,3 @@ },

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
const emojis = this.client.util.resolveEmojis(phrase, message.guild.emojis.cache);

@@ -474,3 +428,3 @@ return emojis.size ? emojis : null;

try {
return message.channel.messages.fetch(phrase as Snowflake);
return message.channel.messages.fetch(phrase);
} catch (e) {

@@ -483,7 +437,7 @@ return null;

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
for (const channel of message.guild.channels.cache.values()) {
if (channel.type !== "GUILD_TEXT") continue;
if (!channel.isText()) continue;
try {
return await (channel as TextChannel | NewsChannel | ThreadChannel).messages.fetch(phrase as Snowflake);
return await channel.messages.fetch(phrase);
} catch (err) {

@@ -499,3 +453,3 @@ if (/^Invalid Form Body/.test(err.message)) return null;

if (!phrase) return null;
const hereMsg = await message.channel.messages.fetch(phrase as Snowflake).catch(() => null);
const hereMsg = await message.channel.messages.fetch(phrase).catch(() => null);
if (hereMsg) {

@@ -505,7 +459,7 @@ return hereMsg;

if (message.guild) {
if (message.inGuild()) {
for (const channel of message.guild.channels.cache.values()) {
if (channel.type !== "GUILD_TEXT") continue;
if (!channel.isText()) continue;
try {
return await (channel as TextChannel | NewsChannel | ThreadChannel).messages.fetch(phrase as Snowflake);
return await channel.messages.fetch(phrase);
} catch (err) {

@@ -533,3 +487,3 @@ if (/^Invalid Form Body/.test(err.message)) return null;

if (!id) return null;
return this.client.users.cache.get(id[1] as Snowflake) || null;
return this.client.users.cache.get(id[1]) ?? null;
},

@@ -539,6 +493,6 @@

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
const id = phrase.match(/<@!?(\d{17,19})>/);
if (!id) return null;
return message.guild.members.cache.get(id[1] as Snowflake) || null;
return message.guild.members.cache.get(id[1]) ?? null;
},

@@ -548,6 +502,6 @@

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
const id = phrase.match(/<#(\d{17,19})>/);
if (!id) return null;
return message.guild.channels.cache.get(id[1] as Snowflake) || null;
return message.guild.channels.cache.get(id[1]) ?? null;
},

@@ -560,3 +514,3 @@

if (!id) return null;
return message.guild.roles.cache.get(id[1] as Snowflake) || null;
return message.guild.roles.cache.get(id[1]) ?? null;
},

@@ -566,6 +520,6 @@

if (!phrase) return null;
if (!message.guild) return null;
if (!message.inGuild()) return null;
const id = phrase.match(/<a?:[a-zA-Z0-9_]+:(\d{17,19})>/);
if (!id) return null;
return message.guild.emojis.cache.get(id[1] as Snowflake) || null;
return message.guild.emojis.cache.get(id[1]) ?? null;
},

@@ -575,3 +529,3 @@

if (!phrase) return null;
return this.commandHandler.findCommand(phrase) || null;
return this.commandHandler.findCommand(phrase) ?? null;
},

@@ -581,3 +535,3 @@

if (!phrase) return null;
return this.commandHandler.modules.get(phrase) || null;
return this.commandHandler.modules.get(phrase) ?? null;
},

@@ -587,3 +541,3 @@

if (!phrase) return null;
return this.inhibitorHandler?.modules.get(phrase) || null;
return this.inhibitorHandler?.modules.get(phrase) ?? null;
},

@@ -593,3 +547,3 @@

if (!phrase) return null;
return this.listenerHandler?.modules.get(phrase) || null;
return this.listenerHandler?.modules.get(phrase) ?? null;
},

@@ -599,3 +553,3 @@

if (!phrase) return null;
return this.taskHandler?.modules.get(phrase) || null;
return this.taskHandler?.modules.get(phrase) ?? null;
},

@@ -605,3 +559,3 @@

if (!phrase) return null;
return this.contextMenuCommandHandler?.modules.get(phrase) || null;
return this.contextMenuCommandHandler?.modules.get(phrase) ?? null;
}

@@ -619,2 +573,4 @@ };

*/
public type(name: keyof BaseArgumentType): ArgumentTypeCaster;
public type(name: string): ArgumentTypeCaster | undefined;
public type(name: string): ArgumentTypeCaster | undefined {

@@ -621,0 +577,0 @@ return this.types.get(name);

@@ -1304,8 +1304,8 @@ import {

}
let typing;
if (command.typing || this.typing) {
typing = setInterval(() => {
if (command.typing || this.typing) message.channel.sendTyping();
}, 9000);
}
const typing =
command.typing || this.typing
? setInterval(() => {
if (command.typing || this.typing) message.channel.sendTyping();
}, 9000)
: undefined;

@@ -1312,0 +1312,0 @@ try {

@@ -132,3 +132,3 @@ /* eslint-disable @typescript-eslint/ban-types */

return str
.toUpperCase()
.toLowerCase()
.split("_")

@@ -135,0 +135,0 @@ .map((word, index) => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc