{"id":29958419,"url":"https://github.com/nareshps/orb-object","last_synced_at":"2026-04-15T18:01:41.900Z","repository":{"id":57316010,"uuid":"373363147","full_name":"NareshPS/orb-object","owner":"NareshPS","description":"Concise Programming","archived":false,"fork":false,"pushed_at":"2021-06-04T06:38:11.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-27T08:17:13.664Z","etag":null,"topics":["concise","copy","gobject","is","javascript","node","trim","type"],"latest_commit_sha":null,"homepage":"","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/NareshPS.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":"2021-06-03T02:54:16.000Z","updated_at":"2021-06-04T06:38:14.000Z","dependencies_parsed_at":"2022-08-25T20:40:41.874Z","dependency_job_id":null,"html_url":"https://github.com/NareshPS/orb-object","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NareshPS/orb-object","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NareshPS%2Forb-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NareshPS%2Forb-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NareshPS%2Forb-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NareshPS%2Forb-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NareshPS","download_url":"https://codeload.github.com/NareshPS/orb-object/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NareshPS%2Forb-object/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268610434,"owners_count":24278120,"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-08-03T02:00:12.545Z","response_time":2577,"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":["concise","copy","gobject","is","javascript","node","trim","type"],"created_at":"2025-08-03T20:45:03.504Z","updated_at":"2026-04-15T18:01:36.844Z","avatar_url":"https://github.com/NareshPS.png","language":"JavaScript","readme":"# orb-object\nWe expose concise APIs for object manipulation.\n\n# Installation\nBrowser Installation. The module is exported as *orbo* global variable.\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/orb-object@1.0.0/dist/index.js\"\u003e\u003c/script\u003e\n```\n\nNode Installation\n```js\nnpm install orb-object\n```\n\n# Details\n*orb-object* types:\n* object: A JS object which is not an array or a null.\n* array: An Array.\n* primitive: JS types: bigint, boolean, number or string.\n* undefined: undefined.\n* null: null\n* unknown: Anything else like function or symbol etc.\n\n# APIs\n## copy\nIt performs a shallow copy of the input.\n```js\nconst o = {name: \"copy\", desc: \"Shallow copies an object\"}\nconst copied = copy(o) // A new container object is created to house the contents of o.\n// Output: {name: \"copy\", desc: \"Shallow copies an object\"}\n```\n\n## type\nIt classifies the input as one of the *orb-object* types.\n```js\nconst t = type(5)\n// Output: primitive\n\nconst t = type('orb-array')\n// Output: primitive\n\nconst t = type(['orb-array'])\n// Output: array\n\nconst t = type({name: 'orb-array'})\n// Output: object\n```\n\n## is\n*is* contains methods to perform type tests.\n```js\nconst istype = is.array([])\n// Output: true\n\nconst istype = is.array({})\n// Output: false\n\nconst istype = is.primitive('orb-array')\n// Output: true\n```\n\n## trim\n*trim* trims a complex object based on the **depth** argument. It is perfect for situations that require a complex object to be logged. The default depth is 3.\n```js\nconst o = {name: 'orb-array', address: {house: 25, street: \"ABC Street\"}}\nconst r = trim(o, 1)\n// Output: {name: 'orb-array', address: '.'}\n\nconst o = {name: 'orb-array', address: {house: 25, street: \"ABC Street\"}}\nconst r = trim(o)\n// Output: {name: 'orb-array', address: {house: 25, street: \"ABC Street\"}}\n```\n\n## gobject\n*gobject* is short for **good object**. It transform an object as follows:\n* When the input is an array or an object, it is returned as-is.\n* When the input is a primitive, it is placed in an array.\n* When the input is null, undefined or unknown, an empty array is returned.\n```js\nconst o = ['orb-object', 1]\nconst goed = gobject(o)\n// Output: ['orb-object', 1]\n\nconst o = 'orb-object'\nconst goed = gobject(o)\n// Output: ['orb-object']\n\nconst o = null\nconst goed = gobject(o)\n// Output: []\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareshps%2Forb-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnareshps%2Forb-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareshps%2Forb-object/lists"}