{"id":20576617,"url":"https://github.com/hobbyquaker/obj-ease","last_synced_at":"2025-09-09T14:10:56.599Z","repository":{"id":58224616,"uuid":"51520576","full_name":"hobbyquaker/obj-ease","owner":"hobbyquaker","description":"handle javascript objects with ease :surfer:","archived":false,"fork":false,"pushed_at":"2017-05-01T14:55:24.000Z","size":26,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-28T03:24:41.413Z","etag":null,"topics":["clone","compare","extend","javascript","objects","properties"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hobbyquaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-11T14:39:50.000Z","updated_at":"2021-05-07T15:24:11.000Z","dependencies_parsed_at":"2022-08-31T04:10:40.879Z","dependency_job_id":null,"html_url":"https://github.com/hobbyquaker/obj-ease","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hobbyquaker/obj-ease","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fobj-ease","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fobj-ease/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fobj-ease/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fobj-ease/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobbyquaker","download_url":"https://codeload.github.com/hobbyquaker/obj-ease/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fobj-ease/sbom","scorecard":{"id":467231,"data":{"date":"2025-08-11","repo":{"name":"github.com/hobbyquaker/obj-ease","commit":"edfd6e4b7edb9e645912fac566ac34d31e8cd928"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T12:51:09.324Z","repository_id":58224616,"created_at":"2025-08-19T12:51:09.324Z","updated_at":"2025-08-19T12:51:09.324Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274308293,"owners_count":25261221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clone","compare","extend","javascript","objects","properties"],"created_at":"2024-11-16T05:46:24.156Z","updated_at":"2025-09-09T14:10:56.547Z","avatar_url":"https://github.com/hobbyquaker.png","language":"JavaScript","readme":"# obj-ease\n\n[![NPM version](https://badge.fury.io/js/obj-ease.svg)](http://badge.fury.io/js/obj-ease)\n[![Dependency Status](https://img.shields.io/gemnasium/hobbyquaker/obj-ease.svg?maxAge=2592000)](https://gemnasium.com/github.com/hobbyquaker/obj-ease)\n[![Build Status](https://travis-ci.org/hobbyquaker/obj-ease.svg?branch=master)](https://travis-ci.org/hobbyquaker/obj-ease)\n[![Coverage Status](https://coveralls.io/repos/github/hobbyquaker/obj-ease/badge.svg?branch=master)](https://coveralls.io/github/hobbyquaker/obj-ease?branch=master)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![License][mit-badge]][mit-url]\n\n[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat\n[mit-url]: LICENSE\n\n\u003e handle javascript objects with ease :surfer:\n\n\n## Purpose\n\nget/set/delete properties by dot-notation, clone, extend and compare objects.\n\n\u003e Why reinvent the wheel? There are more than enough modules solving the same problems!\n\nMost of the implementations I found didn't suite my needs at 100% (e.g. useful return values, see below) and this module \nhas also some educational purpose - I want to improve my js skills, so I would be glad and thankful to hear your opinion \nand critics on this implementation or - even better - get some pull requests that help to optimize performance, \nfunction, tooling, style and documentation of this module.\n\n\n## Usage Examples\n\n```Javascript\nvar oe = require('obj-ease');\n\nvar obj1 = {a: {b: {c: true}}};\nconsole.log(oe.getProp(obj1, 'a.b.c')); // true\nconsole.log(oe.getProp(obj1, 'a.b.missing')); // undefined\n\nvar obj2 = oe.clone(obj1);\nconsole.log(oe.equal(obj1, obj2)); // true\n\noe.setProp(obj2, 'a.b.c', false);\nconsole.log(oe.equal(obj1, obj2)); // false\nconsole.log(oe.getProp(obj1, 'a.b.c')); // true\n\noe.extend(obj1, {a: {b: {bla: 'blub'}}});\nconsole.log(obj1); // { a: { b: { c: true, bla: 'blub' } } }\n\noe.setProp(obj1, 'a.b', {c: null});\nconsole.log(obj1); // { a: { b: { c: null } } }\n\noe.delProp(obj1, 'a.b');\nconsole.log(obj1); // { a: {} }\n```\n\n## Advanced usage\n\n### Return values\n\n#### setProp \n\nsetProp tells you if it really did a change on the object. So ```oe.setProp({a:1}, 'a', 1)``` will return false and ```oe.setProp({a:1}, 'a', 2)``` will return true. \n\n\n#### extend\n\nextend returns an object containing all properties that changed on the target or undefined if no change happened. So ```oe.extend({a: {b: {x: 1, y: 2}}}, {a: {b: {x: 1, y: 3}}})``` will return ```{ a: { b: { y: 3 } } }```\n\n\n### alternative usage on objects\n\nYou can attach the methods of obj-ease as non-enumerable properties to an object or an object prototype:\n\n```Javascript\nvar db = {};\nrequire('obj-ease').attach(db);\n\ndb.setProp('a.b.c', 'test!');\nconsole.log(db); // { a: { b: { c: 'test!' } } }\n```\nObviously the first param of all methods has to be omitted if used on an object.\n\nOne could also extend Object.prototype (really?): ```require('obj-ease').attach(Object.prototype);```\n\n\n### Escaping\n\nYou can access properties with dots in their names simply by escaping them with backslashes.\n\n```Javascript\nvar oe = require('obj-ease');\n\noe.setProp(obj, 'key\\\\.containing\\\\.dots.key\\\\\\\\containing\\\\\\\\backslashes\\\\.and\\\\.dots', 'test!');\nconsole.log(obj); // { 'key.containing.dots': { 'key\\\\containing\\\\backslashes.and.dots': 'test!' } }\n```\n\n\n### Special Objects\n\nThis module works with Array and Buffer objects too. \n\nUntil now it can not handle Function objects (see Todo). Handling of Date and RegExp objects is untested also.\n\n\n## API\n## Classes\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#objease\"\u003eobjease\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n## Functions\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#attach\nextends an object (prototype) with the obj-ease functions (non-enumerable)\"\u003eattach\nextends an object (prototype) with the obj-ease functions (non-enumerable)(obj)\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#split\nSplit str by . - supports backslash escaped delimiters\"\u003esplit\nSplit str by . - supports backslash escaped delimiters(str)\u003c/a\u003e ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#delProp\ndelete an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.\"\u003edelProp\ndelete an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.(obj, prop)\u003c/a\u003e ⇒ \u003ccode\u003eboolean\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#setProp\nset an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.\"\u003esetProp\nset an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.(obj, prop, val)\u003c/a\u003e ⇒ \u003ccode\u003eboolean\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#getProp\nget an objects property. supports nested properties through dot-notation, dots may be escaped by backslash\"\u003egetProp\nget an objects property. supports nested properties through dot-notation, dots may be escaped by backslash(obj, prop)\u003c/a\u003e ⇒ \u003ccode\u003eall\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#equal\ncompare objects by value\"\u003eequal\ncompare objects by value(obj1, obj2)\u003c/a\u003e ⇒ \u003ccode\u003eboolean\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#clone\nclone obj\"\u003eclone\nclone obj(obj)\u003c/a\u003e ⇒ \u003ccode\u003eObject\u003c/code\u003e | \u003ccode\u003eArray\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#extend\nextend that by obj. observes if a change happens while extending\"\u003eextend\nextend that by obj. observes if a change happens while extending(that, obj)\u003c/a\u003e ⇒ \u003ccode\u003eundefined\u003c/code\u003e | \u003ccode\u003eObject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"objease\"\u003e\u003c/a\u003e\n\n## objease\n**Kind**: global class  \n\u003ca name=\"attach\nextends an object (prototype) with the obj-ease functions (non-enumerable)\"\u003e\u003c/a\u003e\n\n## attach\nextends an object (prototype) with the obj-ease functions (non-enumerable)(obj)\n**Kind**: global function  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| obj | \u003ccode\u003eobject\u003c/code\u003e | object to extend |\n\n\u003ca name=\"split\nSplit str by . - supports backslash escaped delimiters\"\u003e\u003c/a\u003e\n\n## split\nSplit str by . - supports backslash escaped delimiters(str) ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\n**Kind**: global function  \n\n| Param | Type |\n| --- | --- |\n| str | \u003ccode\u003estring\u003c/code\u003e | \n\n\u003ca name=\"delProp\ndelete an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.\"\u003e\u003c/a\u003e\n\n## delProp\ndelete an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.(obj, prop) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n**Kind**: global function  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - - true if property was found and deleted  \n\n| Param | Type |\n| --- | --- |\n| obj | \u003ccode\u003eObject\u003c/code\u003e | \n| prop | \u003ccode\u003estring\u003c/code\u003e | \n\n\u003ca name=\"setProp\nset an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.\"\u003e\u003c/a\u003e\n\n## setProp\nset an objects property. supports nested properties through dot-notation, dots may be escaped by backslash.(obj, prop, val) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n**Kind**: global function  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - - true if a change on obj happened  \n\n| Param | Type |\n| --- | --- |\n| obj | \u003ccode\u003eObject\u003c/code\u003e | \n| prop | \u003ccode\u003estring\u003c/code\u003e | \n| val | \u003ccode\u003eall\u003c/code\u003e | \n\n\u003ca name=\"getProp\nget an objects property. supports nested properties through dot-notation, dots may be escaped by backslash\"\u003e\u003c/a\u003e\n\n## getProp\nget an objects property. supports nested properties through dot-notation, dots may be escaped by backslash(obj, prop) ⇒ \u003ccode\u003eall\u003c/code\u003e\n**Kind**: global function  \n**Returns**: \u003ccode\u003eall\u003c/code\u003e - the properties value or undefined  \n\n| Param | Type |\n| --- | --- |\n| obj | \u003ccode\u003eObject\u003c/code\u003e | \n| prop | \u003ccode\u003estring\u003c/code\u003e | \n\n\u003ca name=\"equal\ncompare objects by value\"\u003e\u003c/a\u003e\n\n## equal\ncompare objects by value(obj1, obj2) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n**Kind**: global function  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if both objects are equal  \n\n| Param | Type |\n| --- | --- |\n| obj1 | \u003ccode\u003eobject\u003c/code\u003e | \n| obj2 | \u003ccode\u003eobject\u003c/code\u003e | \n\n\u003ca name=\"clone\nclone obj\"\u003e\u003c/a\u003e\n\n## clone\nclone obj(obj) ⇒ \u003ccode\u003eObject\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e\n**Kind**: global function  \n**Returns**: \u003ccode\u003eObject\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e - the cloned object  \n\n| Param | Type |\n| --- | --- |\n| obj | \u003ccode\u003eObject\u003c/code\u003e \\| \u003ccode\u003eArray\u003c/code\u003e | \n\n\u003ca name=\"extend\nextend that by obj. observes if a change happens while extending\"\u003e\u003c/a\u003e\n\n## extend\nextend that by obj. observes if a change happens while extending(that, obj) ⇒ \u003ccode\u003eundefined\u003c/code\u003e \\| \u003ccode\u003eObject\u003c/code\u003e\n**Kind**: global function  \n**Returns**: \u003ccode\u003eundefined\u003c/code\u003e \\| \u003ccode\u003eObject\u003c/code\u003e - undefined if no change happened - otherwise an object containing the changes is returned  \n\n| Param | Type |\n| --- | --- |\n| that | \u003ccode\u003eObject\u003c/code\u003e | \n| obj | \u003ccode\u003eObject\u003c/code\u003e | \n\n\n## Todo\n\n* Handling of Date and RegExp objects\n* Handle function objects in a useful manner\n* Gulp task bumping version and publishing to npm and bower\n* More and better tests\n* Better Readme\n* optimize get/set/delProp performance by integrated split method (could break prop string loop earlier)\n* Auto-generate markdown from benchmark results and insert into Readme\n* More and better benchmarks\n\n\n## License\n\nMIT © [Sebastian Raff](https://github.com/hobbyquaker)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Fobj-ease","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobbyquaker%2Fobj-ease","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Fobj-ease/lists"}