Skip to content

fix(transform): support transformAngularFile options optional in N-API bindings#179

Open
eryue0220 wants to merge 1 commit intovoidzero-dev:mainfrom
eryue0220:fix/transform-angular-file-api
Open

fix(transform): support transformAngularFile options optional in N-API bindings#179
eryue0220 wants to merge 1 commit intovoidzero-dev:mainfrom
eryue0220:fix/transform-angular-file-api

Conversation

@eryue0220
Copy link
Copy Markdown
Contributor

Summary

Updated Rust N-API task/function signatures to accept Option<TransformOptions> instead of required TransformOptions. Thus it can run in below example, or it will throw an error:

const transformed = await transformAngularFile(
  `
  import { Component } from '@angular/core';

  @Component({
    selector: 'app-root',
    template: '<h1>Hello {{ name }}</h1>',
  })
  export class AppComponent {
    name = 'World';
  }
  `,
  'app.component.ts',
)

console.log(transformed.code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant