Skip to content

Commit 57ab662

Browse files
docs: update description in object/deep-set
PR-URL: #9735 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent aaac825 commit 57ab662

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

  • lib/node_modules/@stdlib/object/deep-set/docs

lib/node_modules/@stdlib/object/deep-set/docs/repl.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,21 @@
3030

3131
Examples
3232
--------
33-
> var obj = { 'a': { 'b': { 'c': 'd' } } };
34-
> var bool = {{alias}}( obj, 'a.b.c', 'beep' )
33+
> var obj1 = { 'a': { 'b': { 'c': 'd' } } };
34+
> var bool = {{alias}}( obj1, 'a.b.c', 'beep' )
3535
true
3636

3737
// Specify an alternative separator via the sep option:
38-
> obj = { 'a': { 'b': { 'c': 'd' } } };
39-
> bool = {{alias}}( obj, 'a/b/c', 'beep', { 'sep': '/' } );
40-
> obj
38+
> var obj2 = { 'a': { 'b': { 'c': 'd' } } };
39+
> bool = {{alias}}( obj2, 'a/b/c', 'beep', { 'sep': '/' } );
40+
> obj2
4141
{ 'a': { 'b': { 'c': 'beep' } } }
4242

4343
// To create a key path which does not exist, set the create option to true:
44-
> bool = {{alias}}( obj, 'a.e.c', 'boop', { 'create': true } );
45-
> obj
46-
{ 'a': { 'b': { 'c': 'beep' }, 'e': { 'c': 'boop' } } }
44+
> var obj3 = { 'a': { 'b': { 'c': 'd' } } };
45+
> bool = {{alias}}( obj3, 'a.e.c', 'boop', { 'create': true } );
46+
> obj3
47+
{ 'a': { 'b': { 'c': 'd' }, 'e': { 'c': 'boop' } } }
4748

4849

4950
{{alias}}.factory( path[, options] )
@@ -67,7 +68,7 @@
6768
Returns
6869
-------
6970
out: Function
70-
Deep get function.
71+
Deep set function.
7172

7273
Examples
7374
--------

0 commit comments

Comments
 (0)