set-js-object
v1.0.2
Published
Create a JS Object (object literal) by given a key and a value
Downloads
2
Maintainers
Readme
set-js-object
Create a JS Object (object literal) by given a key and a value
API
var setObject = require('set-js-object')
setObject(key:string, value)
Return
- a js object
- undefined if the key is undefined
Usage
var setObject = require('set-js-object');
var obj = setObject('key', {a: 1});
// obj = {key: {a: 1}}
var singleObj = setObject('fruit', 'berry');
// singleObj = {fruit: berry}
Development
this projet has been set up with a precommit that forces you to follow a code style, no jshint issues and 100% of code coverage before commit
to run test
npm test
to run jshint
npm run jshint
to run code style
npm run code-style
to run check code coverage
npm run check-coverage
to open the code coverage report
npm run open-coverage