JSPM

set-js-object

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q12049F
  • License ISC

Create a JS Object (object literal) by given a key and a value

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

Build StatusCode Coverage 100%ISC License

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