Skip to content

Commit

Permalink
Merge pull request #5 from codibre/assert-as-decorator
Browse files Browse the repository at this point in the history
fix: using assert.ok as decorator
  • Loading branch information
Farenheith authored Sep 23, 2024
2 parents c3a3bf6 + d92c2d0 commit 5954086
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
},
"peerDependencies": {
"@nestjs/cli": "*",
"typescript": "^5.3.3",
"tsconfig-paths": "*"
"tsconfig-paths": "*",
"typescript": "^5.3.3"
},
"keywords": [
"typescript",
Expand Down
16 changes: 9 additions & 7 deletions src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ export function before() {
!isStatic(node)
) {
const decorator = tsBinary.factory.createDecorator(
tsBinary.factory.createCallExpression(
tsBinary.factory.createIdentifier('require'),
tsBinary.factory.createPropertyAccessChain(
tsBinary.factory.createCallExpression(
tsBinary.factory.createIdentifier('require'),
undefined,
[
tsBinary.factory.createStringLiteral('assert'),
]
),
undefined,
[
tsBinary.factory.createStringLiteral(
'nestjs-auto-reflect-metadata-emitter/dist/simple-decorator',
),
],
tsBinary.factory.createIdentifier('ok')
),
);
if (!tsBinary.isClassDeclaration(node)) {
Expand Down

0 comments on commit 5954086

Please sign in to comment.