Skip to content

Commit 6c942e1

Browse files
committed
fix: Support both @materialize and @materialized
1 parent f15b94f commit 6c942e1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Use any boolean returning expression with `@if` annotation
4848

4949
```typescript
5050
/**
51-
* @materialize
51+
* @materialized
5252
* @if process.env.DEBUG !== undefined
5353
*/
5454
async function someComplexLogic() {
@@ -58,7 +58,7 @@ async function someComplexLogic() {
5858

5959
## How it works internally
6060

61-
We scan the codebase for all files containing functions with the `@materialize` annotation and temporarily add a simple statement to the end of the file to make it executable with `ts-node`.
61+
We scan the codebase for all files containing functions with the `@materialized` annotation and temporarily add a simple statement to the end of the file to make it executable with `ts-node`.
6262

6363
Then we capture the output and replace the annotated functions body with the serialized response from the ts-node execution.
6464

@@ -67,7 +67,7 @@ Then we capture the output and replace the annotated functions body with the ser
6767
import { materialize } from "materialize-ts-function";
6868

6969
materialize(
70-
someComplexLogic, // <-- @materialize function
70+
someComplexLogic, // <-- @materialized function
7171
process.env.DEBUG !== undefined // <-- @if annotation literal
7272
)
7373
.then(console.log)

src/source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export async function main(path = "**/*.ts") {
134134

135135
// parse comments
136136
comments.forEach((c) => {
137-
if (c.includes("@materialized")) {
137+
if (c.includes("@materialize")) {
138138
materialize = true;
139139
}
140140
if (c.includes("@if")) {

0 commit comments

Comments
 (0)