Skip to content

Commit d5d2ea4

Browse files
committed
Update all dependencies
1 parent 535a6fb commit d5d2ea4

10 files changed

Lines changed: 2740 additions & 4481 deletions

__tests__/decorators.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
MaxLength,
99
MetadataStorage,
1010
} from 'class-validator'
11-
import _get from 'lodash.get'
1211

1312
import { JSONSchema, validationMetadatasToSchemas } from '../src'
1413

@@ -42,7 +41,7 @@ class User {
4241
empty?: string
4342
}
4443

45-
const metadata = _get(getFromContainer(MetadataStorage), 'validationMetadatas')
44+
const metadata = getFromContainer(MetadataStorage)?.['validationMetadatas']
4645
const schemas = validationMetadatasToSchemas(metadata)
4746

4847
describe('decorators', () => {

__tests__/defaultConverters.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// tslint:disable:object-literal-sort-keys
22
import * as validator from 'class-validator'
3-
import _get from 'lodash.get'
43

54
import { validationMetadatasToSchemas } from '../src'
65

@@ -139,10 +138,7 @@ class User {
139138
@validator.ArrayUnique() arrayUnique: any[]
140139
}
141140

142-
const metadata = _get(
143-
validator.getFromContainer(validator.MetadataStorage),
144-
'validationMetadatas'
145-
)
141+
const metadata = validator.getFromContainer(validator.MetadataStorage)?.['validationMetadatas']
146142
const schemas = validationMetadatasToSchemas(metadata)
147143

148144
describe('defaultConverters', () => {
@@ -161,7 +157,6 @@ describe('defaultConverters', () => {
161157
anyOf: [
162158
{ type: 'string', enum: [''] },
163159
{
164-
nullable: true,
165160
not: {
166161
anyOf: [
167162
{ type: 'string' },

__tests__/index.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('classValidatorConverter', () => {
7070
expect(
7171
validationMetadatasToSchemas({
7272
classValidatorMetadataStorage: emptyStorage,
73-
})
73+
}),
7474
).toEqual({})
7575
})
7676

@@ -136,7 +136,6 @@ describe('classValidatorConverter', () => {
136136
{ type: 'object' },
137137
],
138138
},
139-
nullable: true,
140139
},
141140
],
142141
},
@@ -201,7 +200,6 @@ describe('classValidatorConverter', () => {
201200
{ type: 'object' },
202201
],
203202
},
204-
nullable: true,
205203
},
206204
],
207205
},
@@ -265,7 +263,6 @@ describe('classValidatorConverter', () => {
265263
{ type: 'object' },
266264
],
267265
},
268-
nullable: true,
269266
},
270267
],
271268
},

__tests__/inheritedProperties.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
MetadataStorage,
1212
MinLength,
1313
} from 'class-validator'
14-
import _get from 'lodash.get'
1514

1615
import {
1716
JSONSchema,
@@ -71,7 +70,7 @@ class User extends BaseContent {
7170
// @ts-ignore: not referenced
7271
class Admin extends User {}
7372

74-
const metadatas = _get(getFromContainer(MetadataStorage), 'validationMetadatas')
73+
const metadatas = getFromContainer(MetadataStorage)?.['validationMetadatas']
7574

7675
describe('Inheriting validation decorators', () => {
7776
it('inherits and merges validation decorators from parent class', () => {

__tests__/options.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
MetadataStorage,
1111
ValidateNested,
1212
} from 'class-validator'
13-
import _get from 'lodash.get'
1413

1514
import { validationMetadatasToSchemas } from '../src'
1615

@@ -33,7 +32,7 @@ class Post {
3332
user: User
3433
}
3534

36-
const metadata = _get(getFromContainer(MetadataStorage), 'validationMetadatas')
35+
const metadata = getFromContainer(MetadataStorage)?.['validationMetadatas']
3736
const defaultSchemas = validationMetadatasToSchemas(metadata)
3837

3938
describe('options', () => {
@@ -73,8 +72,7 @@ describe('options', () => {
7372
type: 'string',
7473
},
7574
[MAX_LENGTH]: (meta) => ({
76-
exclusiveMaximum: true,
77-
maxLength: meta.constraints[0] + 1,
75+
exclusiveMaximum: meta.constraints[0] + 1,
7876
type: 'string',
7977
}),
8078
},
@@ -88,7 +86,7 @@ describe('options', () => {
8886
not: { type: 'null' },
8987
},
9088
tags: {
91-
items: { exclusiveMaximum: true, type: 'string', maxLength: 21 },
89+
items: { exclusiveMaximum: 21, type: 'string' },
9290
type: 'array',
9391
},
9492
})

0 commit comments

Comments
 (0)