commit 18bd65bae241edc01b06f53aa0c0060c8f89d118 Author: GitLab Runner Date: Mon Apr 7 16:54:54 2025 +0200 Auto COMMIT for build : 76 \n commit by: Administrator \n with message : remove sudo diff --git a/README.md b/README.md new file mode 100644 index 0000000..399eda0 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ + +# @D3v4pp/dot +[![GitHub license](https://img.shields.io/badge/licence-d3v4pp-red.svg)](https://cvs.d3v4pp.fr/D3V4PP/validate.git) +[![npm version](https://img.shields.io/npm/v/@d3v4pp/validate?style=flat)](https://www.npmjs.com/package/@d3v4pp/validate) + Get and set object properties with dot notation + +## Installation + + $ npm install @d3v4pp/dot + +## API + +### dot.set(object, path, value) +```js +dot.set(obj, 'cool.aid', 'rocks'); +assert(obj.cool.aid === 'rocks'); +``` + +### dot.get(object, path) +```js +var value = dot.get(obj, 'cool.aid'); +assert(value === 'rocks'); +``` + +### dot.delete(object, path) +```js +var value = dot.delete(obj, 'cool.aid'); +assert(!obj.cool.hasOwnProperty('aid')); +``` + diff --git a/index.js b/index.js new file mode 100644 index 0000000..0eadbc4 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +(()=>{var r={};(()=>{var t=r;function e(r,t){return function(r){return"[object Object]"===Object.prototype.toString.call(r)}(r)?void 0===r[t]||function(r,t){return Object.prototype.hasOwnProperty.call(r,t)}(r,t):!!Array.isArray(r)&&!isNaN(parseInt(t,10))}t.set=function(r,t,n){for(var o=t.split("."),i=o.pop(),a=r,p=0;p", + "email": "ayoub@d3v4pp.fr", + "url": "https://d3v4pp.fr/" + }, + "funding": "https://paypal.me/SupportTheDoc", + "homepage": "https://cvs.d3v4pp.fr/D3V4PP/dot/src/master/README.md", + "bugs": { + "url": "https://cvs.d3v4pp.fr/D3V4PP/dot/issues", + "email": "ayoub@d3v4pp.fr" + }, + "repository": { + "type": "git", + "url": "https://cvs.d3v4pp.fr/D3V4PP/dot.git" + }, + "license": "d3v4pp", + "keywords": [ + "dot", + "notation", + "properties", + "object", + "path" + ] +} \ No newline at end of file