Package Exports
- set-js-object
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (set-js-object) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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 testto run jshint
npm run jshintto run code style
npm run code-styleto run check code coverage
npm run check-coverageto open the code coverage report
npm run open-coverage