Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Column({ defaultValue }) might be able to be omitted #348

Open
cyjake opened this issue Sep 21, 2022 · 0 comments
Open

@Column({ defaultValue }) might be able to be omitted #348

cyjake opened this issue Sep 21, 2022 · 0 comments

Comments

@cyjake
Copy link
Owner

cyjake commented Sep 21, 2022

class User extends Bone {
  @Column({ defaultValue: 'Anonymous' })
  name!: string;
}

possibly could be rewritten as

class User extends Bone {
  @Column()
  name: string = 'Anonymous';
}

which is much more natural to TypeScript, or vanilla class field syntanx

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

No branches or pull requests

1 participant