2.0.0 • Published 3 years ago

@join-com/typeorm-class-validator-is-frozen-when-preset v2.0.0

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

Is frozen when preset validator for class-validator and typeorm

Custom validator for class-validator and typeorm

It validates that a field can not be changed once it was set before.

Installation

npm install @join-com/typeorm-class-validator-is-frozen-when-preset --save

Usage

You can use the validator as any other class-validator:

@Entity()
class User {
  @PrimaryGeneratedColumn()
  public id: number;

  // Raises a validation error when the field is updated
  @IsFrozenWhenPreset()
  @Column({ type: 'int', nullable: true })
  public companyId?: number;
}
2.0.0

3 years ago

1.2.10

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.0

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago