We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 435db27 commit 2d70b33Copy full SHA for 2d70b33
example.js
@@ -0,0 +1,14 @@
1
+var undefsafe = require('undefsafe');
2
+
3
+var object = {
4
+ a: {
5
+ b: {
6
+ c: 1,
7
+ d: [1,2,3],
8
+ e: 'remy'
9
+ }
10
11
+};
12
13
+console.log(undefsafe(object, 'a.b.e')); // "remy"
14
+console.log(undefsafe(object, 'a.b.not.found')); // undefined
package.json
@@ -3,6 +3,7 @@
"version": "0.0.3",
"description": "Undefined safe way of extracting object properties",
"main": "lib/undefsafe.js",
+ "tonicExampleFilename": "example.js",
"directories": {
"test": "test"
},
0 commit comments