Skip to content

Commit

Permalink
jsr.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
tugrul committed May 2, 2024
1 parent 95048ab commit 1089b53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@tugrul/async-replace",
"version": "1.0.3",
"exports": "./mod.ts"
}
1 change: 1 addition & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/index.ts';
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

export type ReplaceCallback = (match: string, groups: string[], index: number, input: string) => Promise<string>;

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;
Expand Down

0 comments on commit 1089b53

Please sign in to comment.