File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11
11
*
12
12
* Status: ALPHA - currently only supports get
13
13
*/
14
- ; ( function ( _ ) {
14
+ ; ( function ( _ ) {
15
15
16
16
// save original core accessor
17
17
var _get = _ . get ;
18
18
// replace with enhanced version
19
- _ . get = function ( area , key , kid ) {
19
+ _ . get = function ( area , key , kid ) {
20
20
var s = _get ( area , key ) ;
21
21
if ( s == null ) {
22
22
var parts = _ . split ( key ) ;
31
31
val = _ . resolvePath ( val , kid ) ;
32
32
s = _ . stringify ( val ) ;
33
33
} catch ( e ) {
34
- console . error ( "Error accessing nested property:" , e ) ;
34
+ window . console . error ( "Error accessing nested property:" , e ) ;
35
35
return null ;
36
36
}
37
37
}
38
38
return s ;
39
39
} ;
40
40
41
41
// Helper function to resolve nested paths safely
42
- _ . resolvePath = function ( obj , path ) {
43
- return path . split ( '.' ) . reduce ( ( acc , key ) => acc && acc [ key ] , obj ) ;
42
+ _ . resolvePath = function ( obj , path ) {
43
+ return path . split ( '.' ) . reduce ( function ( acc , key ) { return acc && acc [ key ] ; } , obj ) ;
44
44
} ;
45
45
46
46
// expose internals on the underscore to allow extensibility
47
- _ . split = function ( key ) {
47
+ _ . split = function ( key ) {
48
48
var dot = key . lastIndexOf ( '.' ) ;
49
49
if ( dot > 0 ) {
50
50
var kid = key . substring ( dot + 1 , key . length ) ;
You can’t perform that action at this time.
0 commit comments