{"_id":"obj-util","_rev":"151737","name":"obj-util","description":"A simple helper to set/get keys from objects using a string path like 'some.key.here'","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"royriojas","email":"royriojas@gmail.com"}],"time":{"modified":"2021-06-03T11:33:10.000Z","created":"2015-03-09T06:36:37.561Z","2.0.0":"2015-12-23T00:33:22.510Z","1.0.0":"2015-03-09T06:36:37.561Z"},"users":{},"author":{"name":"Roy Riojas"},"repository":{"type":"git","url":"git+https://github.com/royriojas/obj-util.git"},"versions":{"2.0.0":{"name":"obj-util","version":"2.0.0","description":"A simple helper to set/get keys from objects using a string path like 'some.key.here'","main":"index.js","scripts":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/royriojas/obj-util.git"},"keywords":["obj","util","setKey","getKey","set","key","using","path"],"author":{"name":"Roy Riojas"},"license":"MIT","bugs":{"url":"https://github.com/royriojas/obj-util/issues"},"homepage":"https://github.com/royriojas/obj-util","gitHead":"5df4440a1b8728ffa32b459b672e79902d0b0b3f","_id":"obj-util@2.0.0","_shasum":"491f241256aa182498ab43b8660b14eaf625028a","_from":".","_npmVersion":"3.5.0","_nodeVersion":"5.1.0","_npmUser":{"name":"royriojas","email":"royriojas@gmail.com"},"maintainers":[{"name":"royriojas","email":"royriojas@gmail.com"}],"dist":{"shasum":"491f241256aa182498ab43b8660b14eaf625028a","size":2457,"noattachment":false,"key":"/obj-util/-/obj-util-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/obj-util/download/obj-util-2.0.0.tgz"},"directories":{},"publish_time":1450830802510,"_cnpm_publish_time":1450830802510,"_hasShrinkwrap":false},"1.0.0":{"name":"obj-util","version":"1.0.0","description":"A simple helper to set/get keys from objects using a string path like 'some.key.here'","main":"index.js","scripts":{"test":"test"},"repository":{"type":"git","url":"https://github.com/royriojas/obj-util.git"},"keywords":["obj","util","setKey","getKey","set","key","using","path"],"author":{"name":"Roy Riojas"},"license":"MIT","bugs":{"url":"https://github.com/royriojas/obj-util/issues"},"homepage":"https://github.com/royriojas/obj-util","gitHead":"ff8bab4d4d3d594005bff44a0601bbd79b1d7dd0","_id":"obj-util@1.0.0","_shasum":"9b79008288210a92f436d9104e9c1820c56ea6cf","_from":".","_npmVersion":"2.6.0","_nodeVersion":"0.12.0","_npmUser":{"name":"royriojas","email":"royriojas@gmail.com"},"maintainers":[{"name":"royriojas","email":"royriojas@gmail.com"}],"dist":{"shasum":"9b79008288210a92f436d9104e9c1820c56ea6cf","size":6766,"noattachment":false,"key":"/obj-util/-/obj-util-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/obj-util/download/obj-util-1.0.0.tgz"},"directories":{},"publish_time":1425882997561,"_cnpm_publish_time":1425882997561,"_hasShrinkwrap":false}},"readme":"# obj-util\n> A simple helper to set/get keys from objects using a string path like 'some.key.here'\n\n## Install\n\n```bash\nnpm i --save obj-util\n```\n\n## Usage\n\n### obj.getKeyValue \n\nReturns the value from the given object which matches the passed key\n- **param** obj {Object} The object to get the values from\n- **param** key {String} a string representing a key in the object. Subkeys are supported separating them with dots. i.e. `key1.subkey1.subsubkey1`\n- **returns** {Mixed} the value of the given key in the passed obj\n\n```javascript\nvar objUtil = require('obj-util');\n\nvar obj = {\n  some: {\n    key: 'some value'\n  }\n};\n\n// getKeyValue\nobjUtil.getKeyValue(obj, 'some.key'); // 'some value'\n```\n\n### obj.setKeyValue\n\nSets a value in an object if a matching key is found inside the given object\n\n- **param** obj {Object} the object where to set the value using if the key is found\n- **param** key {String} a string that represents the key. Subkeys are supported by separating them with dots.\n- **param** val the value to be set in the object\n\n```javascript\nvar objUtil = require('obj-util');\n\nvar obj = {\n};\nobjUtil.setKeyValue(obj, 'some.key', 'some value');\nobj.some.key === 'some value' //==> true\n```\n\nThat's it!","_attachments":{},"homepage":"https://github.com/royriojas/obj-util","bugs":{"url":"https://github.com/royriojas/obj-util/issues"},"license":"MIT"}