@targetd/explode
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@targetd/explode

Use this package if you wish to explode your payloads in to a nest object.

Targetd is a key/value store. You may want to use a dot, for exmaple, to represent nested/namespaced properties in the name.

import { explode } from '@targetd/explode'

await data.addRules([
  {
    name: 'foo.bar',
    payload: 'something',
  },
  {
    name: 'foo.otherthing',
    payload: 'something else',
  },
])

console.info(explode(await data.getPayloadForEachName(), '.'))
/*
{
  foo: {
    bar: 'something',
    otherthing: 'something else'
  }
}
*/

Readme

Keywords

none

Package Sidebar

Install

npm i @targetd/explode

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

9.38 kB

Total Files

20

Last publish

Collaborators

  • johngeorgewright