{"id":18358817,"url":"https://github.com/uppercod/map-object","last_synced_at":"2025-04-10T03:02:40.988Z","repository":{"id":57169045,"uuid":"288267323","full_name":"UpperCod/map-object","owner":"UpperCod","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-18T04:24:58.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T14:05:05.981Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UpperCod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-17T19:21:16.000Z","updated_at":"2020-09-18T04:25:01.000Z","dependencies_parsed_at":"2022-09-13T05:22:33.621Z","dependency_job_id":null,"html_url":"https://github.com/UpperCod/map-object","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"UpperCod/pkg-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fmap-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fmap-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fmap-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fmap-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpperCod","download_url":"https://codeload.github.com/UpperCod/map-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239036137,"owners_count":19571445,"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","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-05T22:19:36.259Z","updated_at":"2025-02-15T18:29:56.089Z","avatar_url":"https://github.com/UpperCod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# map-object\n\nApi for creating plugins capable of modifying an object according to its index, this library is created to implement the use of `$ref`.\n\n### \\$ref implementation example\n\n```js\nimport path from \"path\";\nimport { readFile } from \"fs/promises\";\nimport loadData from \"../../src/index\";\n\nloadData(\n    {\n        file: path.join(__dirname, \"data.json\"),\n        value: {\n            $ref: \"files/users.json\",\n        },\n    },\n    {\n        async $ref({ value, file }, { load, addChild }) {\n            const { dir } = path.parse(file);\n            const src = path.join(dir, file);\n            return load({\n                file: src,\n                value: JSON.parse(await readFile(src, \"utf-8\")),\n            });\n        },\n    }\n);\n```\n\n**The execution of load inside `$ref` allows associating an additional import on the tree object returned by loadData**, the tree object is managed by the pkg [@uppercod/imported](https://github.com/UpperCod/imported).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Fmap-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuppercod%2Fmap-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Fmap-object/lists"}