Skip to content

Commit

Permalink
fix: add tonic demo
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Jan 29, 2016
1 parent 435db27 commit 2d70b33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var undefsafe = require('undefsafe');

var object = {
a: {
b: {
c: 1,
d: [1,2,3],
e: 'remy'
}
}
};

console.log(undefsafe(object, 'a.b.e')); // "remy"
console.log(undefsafe(object, 'a.b.not.found')); // undefined
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 2d70b33

Please sign in to comment.