From 13894f2beffc776a56ac03868613b4313dfb57bf Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:40:31 -0400 Subject: convert to esm --- src/arguments/abbreviatedNumber.ts | 2 +- src/arguments/contentWithDuration.ts | 2 +- src/arguments/discordEmoji.ts | 2 +- src/arguments/duration.ts | 2 +- src/arguments/durationSeconds.ts | 2 +- src/arguments/globalUser.ts | 2 +- src/arguments/permission.ts | 2 +- src/arguments/roleWithDuation.ts | 14 -------------- src/arguments/roleWithDuration.ts | 14 ++++++++++++++ src/arguments/snowflake.ts | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 src/arguments/roleWithDuation.ts create mode 100644 src/arguments/roleWithDuration.ts (limited to 'src/arguments') diff --git a/src/arguments/abbreviatedNumber.ts b/src/arguments/abbreviatedNumber.ts index a95b3e2..4dae2ff 100644 --- a/src/arguments/abbreviatedNumber.ts +++ b/src/arguments/abbreviatedNumber.ts @@ -1,4 +1,4 @@ -import { type BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '#lib'; import numeral from 'numeral'; export const abbreviatedNumberTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { diff --git a/src/arguments/contentWithDuration.ts b/src/arguments/contentWithDuration.ts index 782cf76..9bebaef 100644 --- a/src/arguments/contentWithDuration.ts +++ b/src/arguments/contentWithDuration.ts @@ -1,4 +1,4 @@ -import { type BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '#lib'; export const contentWithDurationTypeCaster: BushArgumentTypeCaster = async ( _, diff --git a/src/arguments/discordEmoji.ts b/src/arguments/discordEmoji.ts index 551cf11..6fb971a 100644 --- a/src/arguments/discordEmoji.ts +++ b/src/arguments/discordEmoji.ts @@ -1,5 +1,5 @@ +import { type BushArgumentTypeCaster } from '#lib'; import { type Snowflake } from 'discord-api-types'; -import { type BushArgumentTypeCaster } from '../lib'; export const discordEmojiTypeCaster: BushArgumentTypeCaster = (_, phrase): { name: string; id: Snowflake } | null => { if (!phrase) return null; diff --git a/src/arguments/duration.ts b/src/arguments/duration.ts index f2da700..e369ddd 100644 --- a/src/arguments/duration.ts +++ b/src/arguments/duration.ts @@ -1,4 +1,4 @@ -import { type BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '#lib'; export const durationTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { return client.util.parseDuration(phrase).duration; diff --git a/src/arguments/durationSeconds.ts b/src/arguments/durationSeconds.ts index 9882740..78be1ce 100644 --- a/src/arguments/durationSeconds.ts +++ b/src/arguments/durationSeconds.ts @@ -1,4 +1,4 @@ -import { type BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '#lib'; export const durationSecondsTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { phrase += 's'; diff --git a/src/arguments/globalUser.ts b/src/arguments/globalUser.ts index 6a20260..344fe78 100644 --- a/src/arguments/globalUser.ts +++ b/src/arguments/globalUser.ts @@ -1,4 +1,4 @@ -import { BushUser, type BushArgumentTypeCaster } from '@lib'; +import { BushUser, type BushArgumentTypeCaster } from '#lib'; // resolve non-cached users export const globalUserTypeCaster: BushArgumentTypeCaster = async (_, phrase): Promise => { diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts index 614a1c7..4f335dc 100644 --- a/src/arguments/permission.ts +++ b/src/arguments/permission.ts @@ -1,4 +1,4 @@ -import { type BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '#lib'; import { Permissions } from 'discord.js'; export const permissionTypeCaster: BushArgumentTypeCaster = (_, phrase) => { diff --git a/src/arguments/roleWithDuation.ts b/src/arguments/roleWithDuation.ts deleted file mode 100644 index c139d94..0000000 --- a/src/arguments/roleWithDuation.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type BushArgumentTypeCaster } from '@lib'; - -export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async ( - message, - phrase -): Promise<{ duration: number | null; role: string | null } | null> => { - // eslint-disable-next-line prefer-const - let { duration, contentWithoutTime } = client.util.parseDuration(phrase); - if (contentWithoutTime === null || contentWithoutTime === undefined) return null; - contentWithoutTime = contentWithoutTime.trim(); - const role = await util.arg.cast('role', message, contentWithoutTime); - if (!role) return null; - return { duration, role }; -}; diff --git a/src/arguments/roleWithDuration.ts b/src/arguments/roleWithDuration.ts new file mode 100644 index 0000000..455ad76 --- /dev/null +++ b/src/arguments/roleWithDuration.ts @@ -0,0 +1,14 @@ +import { type BushArgumentTypeCaster } from '#lib'; + +export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async ( + message, + phrase +): Promise<{ duration: number | null; role: string | null } | null> => { + // eslint-disable-next-line prefer-const + let { duration, contentWithoutTime } = client.util.parseDuration(phrase); + if (contentWithoutTime === null || contentWithoutTime === undefined) return null; + contentWithoutTime = contentWithoutTime.trim(); + const role = await util.arg.cast('role', message, contentWithoutTime); + if (!role) return null; + return { duration, role }; +}; diff --git a/src/arguments/snowflake.ts b/src/arguments/snowflake.ts index 290dc5b..03d78c2 100644 --- a/src/arguments/snowflake.ts +++ b/src/arguments/snowflake.ts @@ -1,4 +1,4 @@ -import { type BushArgumentTypeCaster } from '@lib'; +import { type BushArgumentTypeCaster } from '#lib'; import { type Snowflake } from 'discord.js'; export const snowflakeTypeCaster: BushArgumentTypeCaster = (_, phrase): Snowflake | null => { -- cgit