Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jun 21, 2017
1 parent 4e6970e commit 84adad4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var set = require('./');

console.log(set({}, 'a.b.c', 'd'));
//=> { a: { b: { c: 'd' } } }

console.log(set({}, 'a\\.b.c', 'd'));
//=> { 'a.b': { c: 'd' } }

console.log(set({}, 'a\\.b\\.c', 'd'));
//=> { 'a.b.c': 'd' }

console.log(set({}, '"a.b".c', 'd'));
//=> { 'a.b': { c: 'd' } }

console.log(set({}, "'a.b'.c", "d"));
//=> { 'a.b': { c: 'd' } }

console.log(set({}, "{a..b}.c", "d"));
//=> { '{a..b}': { c: 'd' } }

console.log(set({}, '"this/is/a/.file.path"', 'd'));
//=> { 'this/is/a/.file.path': 'd' }

0 comments on commit 84adad4

Please sign in to comment.