dotpath-object-create

create an object from a dotpath string

Usage no npm install needed!

<script type="module">
  import dotpathObjectCreate from 'https://cdn.skypack.dev/dotpath-object-create';
</script>

README

dotpath-object-create

Create an object from a dotpath string.

npm i --save dotpath-object-create

Usage

const createObject = require('dotpath-object-create')

createObject('machdep.xcpm.io_control_disengages')
// { machdep: { xcpm: { io_control_disengages: {} } } }

createObject('machdep.xcpm.io_control_disengages', 71)
// { machdep: { xcpm: { io_control_disengages: 71 } } }