Skip to content

Commit 391949b

Browse files
committed
deeply get field values
1 parent 2f84211 commit 391949b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/util.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export function set(target, key, val){
3838
}
3939
}
4040

41+
export function get(target, key){
42+
if ( !key in target ){
43+
44+
} else {
45+
return target[key];
46+
}
47+
}
48+
4149
/**
4250
* Checks to see whether an object has a deeply nested path
4351
* @param {Object} target

0 commit comments

Comments
 (0)