mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
fix: deprecate underscore in favor of underline (#10054)
* fix: deprecate `underscore` in favor of `underline` * refactor: use `underline` in `underscore` Co-authored-by: Almeida <github@almeidx.dev> --------- Co-authored-by: Almeida <github@almeidx.dev>
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
|||||||
strikethrough,
|
strikethrough,
|
||||||
time,
|
time,
|
||||||
TimestampStyles,
|
TimestampStyles,
|
||||||
underscore,
|
underline,
|
||||||
unorderedList,
|
unorderedList,
|
||||||
userMention,
|
userMention,
|
||||||
} from '../src/index.js';
|
} from '../src/index.js';
|
||||||
@@ -58,9 +58,9 @@ describe('Message formatters', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('underscore', () => {
|
describe('underline', () => {
|
||||||
test('GIVEN "discord.js" THEN returns "__discord.js__"', () => {
|
test('GIVEN "discord.js" THEN returns "__discord.js__"', () => {
|
||||||
expect<'__discord.js__'>(underscore('discord.js')).toEqual('__discord.js__');
|
expect<'__discord.js__'>(underline('discord.js')).toEqual('__discord.js__');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,19 @@ export function bold<Content extends string>(content: Content): `**${Content}**`
|
|||||||
*
|
*
|
||||||
* @typeParam Content - This is inferred by the supplied content
|
* @typeParam Content - This is inferred by the supplied content
|
||||||
* @param content - The content to wrap
|
* @param content - The content to wrap
|
||||||
|
* @deprecated Use {@link underline} instead.
|
||||||
*/
|
*/
|
||||||
export function underscore<Content extends string>(content: Content): `__${Content}__` {
|
export function underscore<Content extends string>(content: Content): `__${Content}__` {
|
||||||
|
return underline(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats the content into underlined text.
|
||||||
|
*
|
||||||
|
* @typeParam Content - This is inferred by the supplied content
|
||||||
|
* @param content - The content to wrap
|
||||||
|
*/
|
||||||
|
export function underline<Content extends string>(content: Content): `__${Content}__` {
|
||||||
return `__${content}__`;
|
return `__${content}__`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user