Skip to content

Commit

Permalink
Update format.ts
Browse files Browse the repository at this point in the history
The joys of using the github built in editor
  • Loading branch information
brocococonut committed Mar 22, 2023
1 parent 7498501 commit fd4f0dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/format.ts
Expand Up @@ -17,7 +17,7 @@ const DYN_FUNC_REGEX =
*/
const DYN_NESTED_REGEX = /\{\{(.*?)\}\}(?:\|\|(.*?)\|\|)?/gs;

export function format(str: string = '', opts: Record<string, unknown> = {}) {
export function format(str: string = "", opts: Record<string, unknown> = {}) {
// Find anything matching something similar to [[~ {object.nested.key} 1: `string` | 2: `{{object.second.nested.key}} string` | 3: `string` | ... | default: `string` ]]
// and replace it with the correct string depending on the value of the object.nested.key
const translated = str.replaceAll(
Expand Down

0 comments on commit fd4f0dd

Please sign in to comment.