Skip to content

Commit 6003e55

Browse files
committed
feat: add eof option
1 parent f274073 commit 6003e55

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/loom.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export function createLoom<
2828
lines.push(config.template(ctx, item));
2929
}
3030

31+
if (config.eof) {
32+
lines.push("\n#EOF\n");
33+
}
34+
3135
return lines.join("\n");
3236
};
3337
}

src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ export interface LoomConfig<
5858
item: TInputSchema["_input"]
5959
) => string;
6060

61+
/**
62+
* Should there be an EOF marker at the end of the output?
63+
*/
64+
eof?: boolean;
65+
6166
/**
6267
* The predicate function. If provided, the loom will only process items that return true.
6368
*/

0 commit comments

Comments
 (0)