{"id":20999822,"url":"https://github.com/wandeber/agnese","last_synced_at":"2026-02-26T23:01:57.519Z","repository":{"id":42637652,"uuid":"369188669","full_name":"wandeber/agnese","owner":"wandeber","description":"This project will help you to map data easily from a plain object or JSON configuration.","archived":false,"fork":false,"pushed_at":"2025-11-11T15:02:20.000Z","size":1135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-11T17:24:13.513Z","etag":null,"topics":["agnese","loop","map","mapper","mapping","mappings"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wandeber.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-20T11:44:26.000Z","updated_at":"2025-11-11T15:00:22.000Z","dependencies_parsed_at":"2024-06-06T22:32:13.833Z","dependency_job_id":"0bb87da7-9cdf-4c69-bc5b-fed37ecd5eff","html_url":"https://github.com/wandeber/agnese","commit_stats":{"total_commits":73,"total_committers":2,"mean_commits":36.5,"dds":0.0547945205479452,"last_synced_commit":"3534f8312d6ce9ac80cdeba923eb1a1b14e68bea"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/wandeber/agnese","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandeber%2Fagnese","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandeber%2Fagnese/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandeber%2Fagnese/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandeber%2Fagnese/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wandeber","download_url":"https://codeload.github.com/wandeber/agnese/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandeber%2Fagnese/sbom","scorecard":{"id":1239673,"data":{"date":"2025-11-03","repo":{"name":"github.com/wandeber/agnese","commit":"e23ec834e43059c2a1b67dc0695b5eb5735ca794"},"scorecard":{"version":"v5.3.1-0.20251106164954-c65a663bf4a9","commit":"c65a663bf4a93c0f6eca32e6d34713d3e3440e11"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#code-review"}},{"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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/release-package.yml:23","Info: jobLevel 'contents' permission set to 'read': .github/workflows/release-package.yml:41","Warn: no topLevel permission defined: .github/workflows/release-package.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/wandeber/agnese/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/wandeber/agnese/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/wandeber/agnese/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/wandeber/agnese/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/wandeber/agnese/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/wandeber/agnese/release-package.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   3 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#fuzzing"}},{"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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#packaging"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/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/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: https://osv.dev/GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: https://osv.dev/GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: https://osv.dev/GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: https://osv.dev/GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: https://osv.dev/GHSA-952p-6rrq-rcjv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#sast"}}]},"last_synced_at":"2025-11-11T17:24:32.644Z","repository_id":42637652,"created_at":"2025-11-11T17:24:32.660Z","updated_at":"2025-11-11T17:24:32.660Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29876342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T22:37:10.609Z","status":"ssl_error","status_checked_at":"2026-02-26T22:37:09.019Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["agnese","loop","map","mapper","mapping","mappings"],"created_at":"2024-11-19T08:08:24.913Z","updated_at":"2026-02-26T23:01:57.496Z","avatar_url":"https://github.com/wandeber.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Agnese](https://www.npmjs.com/package/agnese) - [![GitHub license](https://img.shields.io/badge/license-CC_BY--ND_4.0-blue.svg)](https://github.com/wandeber/agnese?tab=License-1-ov-file#readme) [![Version](https://img.shields.io/github/package-json/v/wandeber/agnese)](https://www.npmjs.com/package/agnese) [![size](https://img.shields.io/bundlephobia/min/agnese)](https://www.npmjs.com/package/agnese)\n\nAgnese is an object mapper that allows you to transform an object (or array) into another one with different structure.\n\nThe target is to completely remove or a least separate and organize the mapping code from our projects making it easy to maintain. In order to achieve this mission, Agnese makes possible to define the new structure in a JSON/YAML file and using directly there simple conditions and arithmetic operations with Quara, a tiny JavaScript interpreted language.\n\nFor more complex needs, you can create your own preprocessors and point to them with different arguments to treat any data you want.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Getting started](#getting-started)\n  - [Simple mapping example](#simple-mapping-example)\n  - [Autocompletion](#autocompletion)\n    - [JSON](#json)\n    - [YAML](#yaml)\n- [Easy CSV generation](#easy-csv-generation)\n- [License](#license)\n\n## Features\n\n- Convert source data to objects, arrays, strings or simple data based on mapping configuration.\n- Read mapping configuration from JSON file.\n- Conditional fields/items powered by Quara*.\n- Array iteration.\n- Possibility of define a default value for a field.\n- Assign values by their paths in source data.\n- Force types and casting.\n- Use of custom functions to preprocess values before assign them.\n- Values from conditional path (switch).\n- YAML optional support.\n\n\u003e *Quara is a simple JavaScript interpreted language that will be available soon as a separate module.\n\n## Installation\n\nAgnese is available as an [NPM](https://www.npmjs.com/package/agnese) package:\n\n```bash\nnpm install agnese\n```\n\nIf you prefer download it from [Github Packages](https://github.com/wandeber/agnese/packages/807391) (take a look at the [documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package)):\n\n```bash\nnpm install @wandeber/agnese\n```\n\n## Getting started\n\nWe will use the next source data in the examples throughout this document:\n\n```javascript\nconst sourceData = {\n  name: \"Gohan\",\n  surname: \"Son\",\n  isAlive: true,\n  isDeath: false,\n  alias: [\n    \"Great Saiyaman\",\n    \"The Golden Fighter\",\n    \"The Golden Warrior\",\n    \"The Chosen One\",\n    \"Monkey boy\"\n  ],\n  characteristics: {\n    race: \"Human/Saiyan\",\n    gender: \"Male\",\n    age: \"10\",\n    height: 176.5,\n    weight: 61\n  },\n  transformations: [\n    {\n      name: \"Super Saiyan\",\n      power: \"Uff...\",\n      level: 1\n    },\n    {\n      name: \"Super Saiyan II\",\n      power: \"Ask Cell... (De locos...)\",\n      level: 2\n    }\n  ]\n};\n```\n\n#### Simple mapping example:\n\nOne of the most awesome things about this module is you can keep all your mapping info in a separate JSON file.\n\n##### map-info.json\n\n```json\n{\n  \"type\": \"Object\",\n  \"fields\": [\n    {\n      \"name\": \"lastname\",\n      \"if\": {\n        \"quara\": \"surname == \\\"Son\\\"\"\n      },\n      \"value\": {\n        \"fromPath\": \"surname\"\n      }\n    }\n  ]\n}\n```\n\n##### JavaScript code to map from JSON file\n\n```javascript\nlet mapper = new Agnese();\nmapper.setMapInfo(\"map-info.json\");\nlet target = mapper.map(sourceData);\n```\n\nThe variable `target` will contain the next object:\n\n```js\n{\n  lastname: \"Son\"\n}\n```\n\nSince the code is almost completely common to any case of use, sometimes you will only find the map info or settings in future examples of this document.\n\n\u003e While I complete this documentation, I recommend you take a look at the examples used in the [unit tests](test/MapInfoFiles).\n\n### Autocompletion\n\nAgnese provides [JSON schemas](schemas) that you can use with VSCode to enable autocompletion and validation.\n\n#### JSON\n\n```json\n{\n  \"$schema\": \"node_modules/agnese/schema/index.json\",\n  \"value\": {\n    \"type\": \"Integer\",\n    \"fromPath\": \"characteristics.age\"\n  }\n}\n```\n\n#### YAML\n\nYou need to install the [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension.\n\n```yaml\n# yaml-language-server: $schema=node_modules/agnese/schema/index.json\ntype: Object\nfields:\n  - name: parent\n    value:\n      default: Son Goku\n```\n\n## Easy CSV generation\n\nIf you think on CSV as an object with one unique level, you can easily map any data to CSV or other similar structure. \n\n## License\n\nAgnese © 2020 by [Bernardo A. Siverio (wandeber)](https://github.com/wandeber) is licensed under [CC BY-ND 4.0](https://github.com/wandeber/agnese?tab=License-1-ov-file#readme)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwandeber%2Fagnese","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwandeber%2Fagnese","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwandeber%2Fagnese/lists"}