value-to-type

Get schema from data, great for making quick assertions in integration tests.

Usage no npm install needed!

<script type="module">
  import valueToType from 'https://cdn.skypack.dev/value-to-type';
</script>

README

Value to Type Build Status

Install

npm install value-to-type

Usage

const valueToType = require('value-to-type');

valueToType('unicorns');
//=> 'string'

API

valueToType(value)

input

Type: any

For example:

[{rainbow: 'unicorns'}, {rainbow: 'cats'}]

Output:

[{rainbow: 'string'}]

License

MIT © Herman