Skip to content

Commit 76ef58d

Browse files
committed
update validator to 13.15.20
1 parent 221502c commit 76ef58d

File tree

4 files changed

+35
-22
lines changed

4 files changed

+35
-22
lines changed

package-lock.json

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
"test:ci": "jest --runInBand --no-cache --coverage --verbose"
3737
},
3838
"dependencies": {
39-
"@types/validator": "^13.11.8",
39+
"@types/validator": "^13.15.3",
4040
"libphonenumber-js": "^1.11.1",
41-
"validator": "^13.9.0"
41+
"validator": "^13.15.20"
4242
},
4343
"devDependencies": {
4444
"@rollup/plugin-commonjs": "^25.0.7",

src/decorator/string/IsRgbColor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const IS_RGB_COLOR = 'isRgbColor';
1010
* If given value is not a string, then it returns false.
1111
*/
1212
export function isRgbColor(value: unknown, includePercentValues?: boolean): boolean {
13-
return typeof value === 'string' && isRgbColorValidator(value, includePercentValues);
13+
return typeof value === 'string' && isRgbColorValidator(value, {
14+
includePercentValues
15+
});
1416
}
1517

1618
/**

test/functional/validation-functions-and-decorators.spec.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ function checkReturnedError(
265265
return Promise.all(promises);
266266
}
267267

268-
const validator = new Validator();
269-
270268
describe('IsDefined', () => {
271269
const validValues = [0, 1, true, false, '', '0', '1234', -1];
272270
const invalidValues: any[] = [null, undefined];
@@ -3117,9 +3115,13 @@ describe('IsJWT', () => {
31173115
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb3JlbSI6Imlwc3VtIn0.ymiJSsMJXR6tMSr8G9usjQ15_8hKPDv_CArLhxw28MI',
31183116
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb2xvciI6InNpdCIsImFtZXQiOlsibG9yZW0iLCJpcHN1bSJdfQ.rRpe04zbWbbJjwM43VnHzAboDzszJtGrNsUxaqQ-GQ8',
31193117
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqb2huIjp7ImFnZSI6MjUsImhlaWdodCI6MTg1fSwiamFrZSI6eyJhZ2UiOjMwLCJoZWlnaHQiOjI3MH19.YRLPARDmhGMC3BBk_OhtwwK21PIkVCqQe8ncIRPKo-E',
3118+
];
3119+
const invalidValues = [
3120+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
3121+
'$Zs.ewu.su84',
3122+
'ks64$S/9.dy$§kz.3sd73b',
31203123
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ', // No signature
31213124
];
3122-
const invalidValues = ['eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', '$Zs.ewu.su84', 'ks64$S/9.dy$§kz.3sd73b'];
31233125

31243126
class MyClass {
31253127
@IsJWT()
@@ -3533,7 +3535,7 @@ describe('IsUrl', () => {
35333535

35343536
describe('IsUUID', () => {
35353537
const validValues = [
3536-
'A987FBC9-4BED-3078-CF07-9141BA07C9F3',
3538+
'A987FBC9-4BED-3078-8F07-9141BA07C9F3',
35373539
'A987FBC9-4BED-4078-8F07-9141BA07C9F3',
35383540
'A987FBC9-4BED-5078-AF07-9141BA07C9F3',
35393541
];
@@ -3547,6 +3549,7 @@ describe('IsUUID', () => {
35473549
'934859',
35483550
'987FBC9-4BED-3078-CF07A-9141BA07C9F3',
35493551
'AAAAAAAA-1111-1111-AAAG-111111111111',
3552+
'A987FBC9-4BED-3078-CF07-9141BA07C9F3', // does not conform to RFC9562 UUID
35503553
];
35513554

35523555
class MyClass {
@@ -3578,7 +3581,12 @@ describe('IsUUID', () => {
35783581
});
35793582

35803583
describe('IsUUID v3', () => {
3581-
const validValues = ['A987FBC9-4BED-3078-CF07-9141BA07C9F3'];
3584+
const validValues = [
3585+
'A987FBC9-4BED-3078-8F07-9141BA07C9F3',
3586+
'A987FBC9-4BED-3078-9F07-9141BA07C9F3',
3587+
'A987FBC9-4BED-3078-AF07-9141BA07C9F3',
3588+
'A987FBC9-4BED-3078-BF07-9141BA07C9F3',
3589+
];
35823590
const invalidValues = [
35833591
null,
35843592
undefined,
@@ -3588,6 +3596,7 @@ describe('IsUUID v3', () => {
35883596
'AAAAAAAA-1111-1111-AAAG-111111111111',
35893597
'A987FBC9-4BED-4078-8F07-9141BA07C9F3',
35903598
'A987FBC9-4BED-5078-AF07-9141BA07C9F3',
3599+
'A987FBC9-4BED-3078-CF07-9141BA07C9F3', // does not conform to RFC9562 UUID
35913600
];
35923601

35933602
class MyClass {

0 commit comments

Comments
 (0)