From 1089b5388fd2d0c9ef4f021e9b4731061519fdf8 Mon Sep 17 00:00:00 2001 From: Tugrul Topuz Date: Thu, 2 May 2024 04:45:59 +0300 Subject: [PATCH] jsr.json file --- jsr.json | 5 +++++ mod.ts | 1 + src/index.ts | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 jsr.json create mode 100644 mod.ts diff --git a/jsr.json b/jsr.json new file mode 100644 index 0000000..fe4aee3 --- /dev/null +++ b/jsr.json @@ -0,0 +1,5 @@ +{ + "name": "@tugrul/async-replace", + "version": "1.0.3", + "exports": "./mod.ts" +} diff --git a/mod.ts b/mod.ts new file mode 100644 index 0000000..dfa8a20 --- /dev/null +++ b/mod.ts @@ -0,0 +1 @@ +export * from './src/index.ts'; diff --git a/src/index.ts b/src/index.ts index ae41c7a..f7d4668 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ export type ReplaceCallback = (match: string, groups: string[], index: number, input: string) => Promise; -export async function replace(str: string, regex: RegExp, callback: ReplaceCallback, limit: number = 0) { +export async function replace(str: string, regex: RegExp, callback: ReplaceCallback, limit: number = 0): string { let last = 0; let match = null;