@@ -30,15 +30,8 @@ function shapeRequiredIfNot(otherProps, propChecker) {
30
30
return apiCheck . utils . checkerHelpers . setupChecker ( shapeRequiredIfNotDefinition ) ;
31
31
}
32
32
33
- // TODO in 7.0.0 .nullable is available on all checkers
34
- function nullable ( checker ) {
35
- return apiCheck . oneOfType ( [
36
- apiCheck . oneOf ( [ null ] ) , checker
37
- ] ) ;
38
- }
39
-
40
33
const formlyExpression = apiCheck . oneOfType ( [ apiCheck . string , apiCheck . func ] ) ;
41
- const specifyWrapperType = nullable ( apiCheck . typeOrArrayOf ( apiCheck . string ) ) ;
34
+ const specifyWrapperType = apiCheck . typeOrArrayOf ( apiCheck . string ) . nullable ;
42
35
43
36
const apiCheckProperty = apiCheck . oneOfType ( [ apiCheck . func , apiCheck . objectOf ( apiCheck . func ) ] ) ;
44
37
@@ -73,10 +66,10 @@ const expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([
73
66
74
67
const modelChecker = apiCheck . oneOfType ( [ apiCheck . string , apiCheck . object ] ) ;
75
68
76
- const templateManipulators = nullable ( apiCheck . shape ( {
77
- preWrapper : nullable ( apiCheck . arrayOf ( apiCheck . func ) ) . optional ,
78
- postWrapper : nullable ( apiCheck . arrayOf ( apiCheck . func ) ) . optional
79
- } ) . strict ) ;
69
+ const templateManipulators = apiCheck . shape ( {
70
+ preWrapper : apiCheck . arrayOf ( apiCheck . func ) . nullable . optional ,
71
+ postWrapper : apiCheck . arrayOf ( apiCheck . func ) . nullable . optional
72
+ } ) . strict . nullable ;
80
73
81
74
const validatorChecker = apiCheck . objectOf ( apiCheck . oneOfType ( [
82
75
formlyExpression , apiCheck . shape ( {
@@ -149,7 +142,7 @@ const fieldOptionsApiShape = {
149
142
apiCheck . string , apiCheck . func , apiCheck . array
150
143
] ) . optional ,
151
144
validation : apiCheck . shape ( {
152
- show : nullable ( apiCheck . bool ) . optional ,
145
+ show : apiCheck . bool . nullable . optional ,
153
146
messages : apiCheck . objectOf ( formlyExpression ) . optional ,
154
147
errorExistsAndShouldBeVisible : apiCheck . bool . optional
155
148
} ) . optional ,
0 commit comments