@ovencord/formatters 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ovencord/formatters",
4
- "version": "0.6.3",
4
+ "version": "0.6.4",
5
5
  "description": "A set of functions to format strings for Discord.",
6
6
  "scripts": {
7
7
  "test": "bun test",
package/src/escapers.ts CHANGED
@@ -131,7 +131,7 @@ export function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}
131
131
  spoiler = true,
132
132
  codeBlockContent = true,
133
133
  inlineCodeContent = true,
134
- escape = true,
134
+ escape: shouldEscape = true,
135
135
  heading = true,
136
136
  bulletedList = true,
137
137
  numberedList = true,
@@ -153,7 +153,7 @@ export function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}
153
153
  strikethrough,
154
154
  spoiler,
155
155
  inlineCodeContent,
156
- escape,
156
+ escape: shouldEscape,
157
157
  heading,
158
158
  bulletedList,
159
159
  numberedList,
@@ -177,7 +177,7 @@ export function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}
177
177
  underline,
178
178
  strikethrough,
179
179
  spoiler,
180
- escape,
180
+ escape: shouldEscape,
181
181
  heading,
182
182
  bulletedList,
183
183
  numberedList,
@@ -190,7 +190,7 @@ export function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}
190
190
  }
191
191
 
192
192
  let res = text;
193
- if (escape) res = escapeEscape(res);
193
+ if (shouldEscape) res = escapeEscape(res);
194
194
  if (inlineCode) res = escapeInlineCode(res);
195
195
  if (codeBlock) res = escapeCodeBlock(res);
196
196
  if (italic) res = escapeItalic(res);
package/src/formatters.ts CHANGED
@@ -685,7 +685,10 @@ export function email<Email extends string>(
685
685
  export function email<Email extends string>(email: Email, headers?: Record<string, string | readonly string[]>) {
686
686
  if (headers) {
687
687
  const searchParams = new URLSearchParams(
688
- Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])) as Record<string, string>,
688
+ Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])) as Record<
689
+ string,
690
+ string
691
+ >,
689
692
  );
690
693
 
691
694
  return `<${email}?${searchParams.toString()}>` as const;