diff --git a/src/lib/utils/format.ts b/src/lib/utils/format.ts new file mode 100644 index 0000000..134f598 --- /dev/null +++ b/src/lib/utils/format.ts @@ -0,0 +1,3 @@ +export default function format(template: string, ...args: string[]) { + return args.reduce((p,c) => p.replace(/{}/,c), template); +} \ No newline at end of file