File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Source object
2+ // The key as a string, can only be 1 level deep (no periods), must exist at the top level of the source object
3+ // The default value to use if the key doesn't exist
4+
5+ var GetFastValue = function ( source , key , defaultValue )
6+ {
7+ if ( ! source || typeof source === 'number' )
8+ {
9+ return defaultValue ;
10+ }
11+ else if ( source . hasOwnProperty ( key ) )
12+ {
13+ return source [ key ] ;
14+ }
15+ else
16+ {
17+ return defaultValue ;
18+ }
19+ } ;
20+
21+ module . exports = GetFastValue ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ module.exports = {
55 Clone : require ( './Clone' ) ,
66 Extend : require ( './Extend' ) ,
77 GetAdvancedValue : require ( './GetAdvancedValue' ) ,
8+ GetFastValue : require ( './GetFastValue' ) ,
89 GetMinMaxValue : require ( './GetMinMaxValue' ) ,
910 GetValue : require ( './GetValue' ) ,
1011 IsPlainObject : require ( './IsPlainObject' ) ,
You can’t perform that action at this time.
0 commit comments