array-functions

Read JS functions from JSON array.

Usage no npm install needed!

<script type="module">
  import arrayFunctions from 'https://cdn.skypack.dev/array-functions';
</script>

README

array-functions NPM version NPM downloads Build Status

Read JS functions from JSON array.

Install

$ npm install --save array-functions

Usage

import test from 'ava'
import arrayFunctions from './'

test('main', t => {
    let json = [
        ['foo', 1, 2],
        ['bar', 1, 2]
    ]

    json = arrayFunctions(json)

    t.same(json, [
        {
            name: 'foo',
            args: [1, 2]
        },
        {
            name: 'bar',
            args: [1, 2]
        }
    ])
})

Related

License

MIT © EGOIST