0.0.1 • Published 3 years ago

tinypath v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

tinypath CI codecov

A tiny utility for generating chains of object property paths.

Usage

import { getPaths } from 'tinypath'

getPaths({
  root: 'root',
  lvl1: {
    propLvl1: 'propLvl1',
    lvl2: {
      propLvl2: 'propLvl1'
    }
  }
})
// =>
// {
//   "root": "root",
//   "lvl1": {
//     "propLvl1": "lvl1.propLvl1",
//     "lvl2": {
//       "propLvl2": "lvl1.lvl2.propLvl2",
//       "self": "lvl1.lvl2"
//     },
//     "self": "lvl1"
//    }
// }

API: getPaths(object[, options])

  • object: Object
  • options?: TinyPathOptions

TinyPathOptions

depth?: number

Default: 0

base?: string

Default: ''

separator?: string

Default: '.'


licence

0.0.1

3 years ago

1.0.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.2

3 years ago