This repository has been archived by the owner on Jun 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing string validation options with tests (#293)
adding chai-as-promised
- Loading branch information
Showing
5 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { prop, Typegoose } from '../../src/typegoose'; | ||
|
||
export class StringValidators extends Typegoose { | ||
@prop({ maxlength: 3 }) | ||
public maxLength: string; | ||
|
||
@prop({ trim: true }) | ||
public trimmed: string; | ||
|
||
@prop({ uppercase: true }) | ||
public uppercased: string; | ||
|
||
@prop({ lowercase: true }) | ||
public lowercased: string; | ||
|
||
@prop({ enum: ['one', 'two', 'three'] }) | ||
public enumed: string; | ||
} | ||
|
||
export const model = new StringValidators().getModelForClass(StringValidators); |