Skip to content

Commit 84adad4

Browse files
committed
examples
1 parent 4e6970e commit 84adad4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var set = require('./');
2+
3+
console.log(set({}, 'a.b.c', 'd'));
4+
//=> { a: { b: { c: 'd' } } }
5+
6+
console.log(set({}, 'a\\.b.c', 'd'));
7+
//=> { 'a.b': { c: 'd' } }
8+
9+
console.log(set({}, 'a\\.b\\.c', 'd'));
10+
//=> { 'a.b.c': 'd' }
11+
12+
console.log(set({}, '"a.b".c', 'd'));
13+
//=> { 'a.b': { c: 'd' } }
14+
15+
console.log(set({}, "'a.b'.c", "d"));
16+
//=> { 'a.b': { c: 'd' } }
17+
18+
console.log(set({}, "{a..b}.c", "d"));
19+
//=> { '{a..b}': { c: 'd' } }
20+
21+
console.log(set({}, '"this/is/a/.file.path"', 'd'));
22+
//=> { 'this/is/a/.file.path': 'd' }

0 commit comments

Comments
 (0)