time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1229B)


      1 
      2 {{alias}}( obj, path[, options] )
      3     Returns a nested property value.
      4 
      5     Parameters
      6     ----------
      7     obj: ObjectLike
      8         Input object.
      9 
     10     path: string|Array
     11         Key path.
     12 
     13     options: Object (optional)
     14         Options.
     15 
     16     options.sep: string (optional)
     17         Key path separator. Default: '.'.
     18 
     19     Returns
     20     -------
     21     out: any
     22         Nested property value.
     23 
     24     Examples
     25     --------
     26     > var obj = { 'a': { 'b': { 'c': 'd' } } };
     27     > var val = {{alias}}( obj, 'a.b.c' )
     28     'd'
     29 
     30     // Specify a custom separator via the `sep` option:
     31     > var obj = { 'a': { 'b': { 'c': 'd' } } };
     32     > var val = {{alias}}( obj, 'a/b/c', { 'sep': '/' } )
     33     'd'
     34 
     35 {{alias}}.factory( path[, options] )
     36     Creates a reusable deep get function.
     37 
     38     Parameters
     39     ----------
     40     path: string|Array
     41         Key path.
     42 
     43     options: Object (optional)
     44         Options.
     45 
     46     options.sep: string (optional)
     47         Key path separator. Default: '.'.
     48 
     49     Returns
     50     -------
     51     out: Function
     52         Deep get factory.
     53 
     54     Examples
     55     --------
     56     > var dget = {{alias}}.factory( 'a/b/c', { 'sep': '/' } );
     57     > var obj = { 'a': { 'b': { 'c': 'd' } } };
     58     > var val = dget( obj )
     59     'd'
     60 
     61     See Also
     62     --------
     63