{"id":20046399,"url":"https://github.com/aneldev/dyna-object-scan","last_synced_at":"2025-07-22T18:35:03.928Z","repository":{"id":57217577,"uuid":"288380932","full_name":"aneldev/dyna-object-scan","owner":"aneldev","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-05T12:54:46.000Z","size":170,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-14T05:15:16.751Z","etag":null,"topics":[],"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/aneldev.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":"2020-08-18T07:04:03.000Z","updated_at":"2021-11-17T17:05:34.000Z","dependencies_parsed_at":"2022-08-28T21:41:23.656Z","dependency_job_id":null,"html_url":"https://github.com/aneldev/dyna-object-scan","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aneldev/dyna-object-scan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneldev%2Fdyna-object-scan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneldev%2Fdyna-object-scan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneldev%2Fdyna-object-scan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneldev%2Fdyna-object-scan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aneldev","download_url":"https://codeload.github.com/aneldev/dyna-object-scan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneldev%2Fdyna-object-scan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266552738,"owners_count":23947183,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-13T11:23:34.330Z","updated_at":"2025-07-22T18:35:03.894Z","avatar_url":"https://github.com/aneldev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dynaObjectScan\n\nScans deeply an object calling a callback.\n\nSkips circular references.\n\nThe callback called with an object as argument with these properties:\n\n```\npropertyName: string | undefined;   // The name of the current property, number for array position\nvalue: any;                         // The value of the current property\nparent: any                         // The owner of the property\npath: string | undefined;           // Full path of the value in the object\nskip: () =\u003e void;                   // Function to skip the scan of the current value\n```\n\n# Examples\n\n## Console path and value\n\n```\ndynaObjectScan(\n  {\n    fname: 'John',\n    lname: 'Smith',\n    cars: ['Honda', 'Porche'],\n  },\n  ({path, value, parent}) =\u003e {\n    if (parent === undefined) return;\n    console.log(path, value);\n  },\n)\n```\nConsoles:\n\n```\n.fname John\n.lname Smith\n.cars (2) \u003e [\"Honda\", \"Porche\"]\n.cars[0] Honda\n.cars[1] Porche\n```\n## Console propertyName and value\n\n```\ndynaObjectScan(\n  {\n    fname: 'John',\n    lname: 'Smith',\n    cars: ['Honda', 'Porche'],\n  },\n  ({propertyName, value, parent}) =\u003e {\n    if (parent === undefined) return;\n    console.log(propertyName, value);\n  },\n)\n```\nConsoles:\n\n```\nfname John\nlname Smith\ncars (2) \u003e [\"Honda\", \"Porche\"]\n0 Honda\n1 Porche\n```\n\n## Skip specific property\n\n```\ndynaObjectScan(\n  {\n    fname: 'John',\n    lname: 'Smith',\n    cars: ['Honda', 'Porche'],\n  },\n  ({path, value, skip, parent}) =\u003e {\n      if (parent === undefined) return;\n      if (path === '.cars') {\n      skip(); // This will block the scan of the root `cars` property.\n      return;\n    }\n    console.log(path, value);\n  },\n);\n\n```\nConsoles:\n\n```\n.fname John\n.lname Smith\n```\n\n# Change log\n\n## v2\n\nVersion 2 scans and the root object. Version 1 didn't.\n\nTo detect is the scanning object is the root one, the `parent === undefined`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneldev%2Fdyna-object-scan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faneldev%2Fdyna-object-scan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneldev%2Fdyna-object-scan/lists"}