mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Sequelize is using Validator to validate that a string is a UUID. Validator supports 4 versions of UUID:
b59133b172/lib/isUUID.js (L14-L19)
Update Sequelize's typescript to include `all` and change `number` type to a more specific type (3|4|5).
Update Validator's typescript to be more specific. instead of `string | number` set the enum values (3|4|5|all)
This commit is contained in:
parent
825d361b8e
commit
f668da13f4
2
types/sequelize/index.d.ts
vendored
2
types/sequelize/index.d.ts
vendored
@ -4765,7 +4765,7 @@ declare namespace sequelize {
|
||||
/**
|
||||
* only allow uuids
|
||||
*/
|
||||
isUUID?: number | { msg: string, args: number };
|
||||
isUUID?: 3|4|5|"3"|"4"|"5"|"all" | { msg: string, args: number };
|
||||
|
||||
/**
|
||||
* only allow date strings
|
||||
|
||||
2
types/sequelize/v3/index.d.ts
vendored
2
types/sequelize/v3/index.d.ts
vendored
@ -4661,7 +4661,7 @@ declare namespace sequelize {
|
||||
/**
|
||||
* only allow uuids
|
||||
*/
|
||||
isUUID?: number | { msg: string, args: number };
|
||||
isUUID?: 3|4|5|"3"|"4"|"5"|"all" | { msg: string, args: number };
|
||||
|
||||
/**
|
||||
* only allow date strings
|
||||
|
||||
2
types/validator/index.d.ts
vendored
2
types/validator/index.d.ts
vendored
@ -156,7 +156,7 @@ declare namespace ValidatorJS {
|
||||
isURL(str: string, options?: IsURLOptions): boolean;
|
||||
|
||||
// check if the string is a UUID. Must be one of ['3', '4', '5', 'all'], default is all.
|
||||
isUUID(str: string, version?: string | number): boolean;
|
||||
isUUID(str: string, version?: 3|4|5|"3"|"4"|"5"|"all"): boolean;
|
||||
|
||||
// check if the string is uppercase.
|
||||
isUppercase(str: string): boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user