File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
const Hoek = require ( '@hapi/hoek' ) ;
4
+ const Marker = require ( '@hapi/marker' ) ;
4
5
6
+ const Cast = require ( '../../cast' ) ;
5
7
const Settings = require ( './settings' ) ;
6
8
const Ref = require ( '../../ref' ) ;
7
9
const Errors = require ( '../../errors' ) ;
8
10
const State = require ( '../state' ) ;
9
11
const Symbols = require ( '../symbols' ) ;
10
12
13
+ const Pkg = require ( '../../../package.json' ) ;
14
+
11
15
let Alternatives = null ; // Delay-loaded to prevent circular dependencies
12
- let Cast = null ;
13
16
let Schemas = null ;
14
17
15
18
16
19
const internals = {
17
- Set : require ( '../../set' )
20
+ Set : require ( '../../set' ) ,
21
+ symbol : Marker ( 'joi-any-base' )
18
22
} ;
19
23
20
24
@@ -37,8 +41,6 @@ module.exports = internals.Any = class {
37
41
38
42
constructor ( ) {
39
43
40
- Cast = Cast || require ( '../../cast' ) ;
41
-
42
44
this . isJoi = true ;
43
45
this . _type = 'any' ;
44
46
this . _settings = null ;
@@ -957,6 +959,13 @@ internals.Any.prototype.disallow = internals.Any.prototype.not = internals.Any.p
957
959
internals . Any . prototype . exist = internals . Any . prototype . required ;
958
960
959
961
962
+ internals . Any . prototype [ internals . symbol ] = {
963
+ version : Pkg . version ,
964
+ compile : Cast . schema ,
965
+ root : '_currentJoi'
966
+ } ;
967
+
968
+
960
969
internals . _try = function ( fn , args = [ ] ) {
961
970
962
971
let err ;
Original file line number Diff line number Diff line change 10
10
" validation"
11
11
],
12
12
"dependencies" : {
13
- "@hapi/hoek" : " 6.x.x" ,
14
13
"@hapi/address" : " 2.x.x" ,
14
+ "@hapi/hoek" : " 6.x.x" ,
15
+ "@hapi/marker" : " 1.x.x" ,
15
16
"@hapi/topo" : " 3.x.x"
16
17
},
17
18
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments