Gathering detailed insights and metrics for agnese
Gathering detailed insights and metrics for agnese
Gathering detailed insights and metrics for agnese
Gathering detailed insights and metrics for agnese
This project will help you to map data easily from a plain object or JSON configuration.
npm install agnese
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (97.54%)
JavaScript (1.37%)
Shell (1.1%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
101 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Jun 06, 2024
Latest Version
0.6.3
Package Id
agnese@0.6.3
Unpacked Size
103.67 kB
Size
23.71 kB
File Count
52
NPM Version
10.2.4
Node Version
20.11.1
Published on
Mar 13, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
8
1
Agnese is an object mapper that allows you to transform an object (or array) into another one with different structure.
The 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.
For more complex needs, you can create your own preprocessors and point to them with different arguments to treat any data you want.
*Quara is a simple JavaScript interpreted language that will be available soon as a separate module.
Agnese is available as an NPM package:
1npm install agnese
If you prefer download it from Github Packages (take a look at the documentation):
1npm install @wandeber/agnese
We will use the next source data in the examples throughout this document:
1const sourceData = { 2 name: "Gohan", 3 surname: "Son", 4 isAlive: true, 5 isDeath: false, 6 alias: [ 7 "Great Saiyaman", 8 "The Golden Fighter", 9 "The Golden Warrior", 10 "The Chosen One", 11 "Monkey boy" 12 ], 13 characteristics: { 14 race: "Human/Saiyan", 15 gender: "Male", 16 age: "10", 17 height: 176.5, 18 weight: 61 19 }, 20 transformations: [ 21 { 22 name: "Super Saiyan", 23 power: "Uff...", 24 level: 1 25 }, 26 { 27 name: "Super Saiyan II", 28 power: "Ask Cell... (De locos...)", 29 level: 2 30 } 31 ] 32};
One of the most awesome things about this module is you can keep all your mapping info in a separate JSON file.
1{ 2 "type": "Object", 3 "fields": [ 4 { 5 "name": "lastname", 6 "if": { 7 "quara": "surname == \"Son\"" 8 }, 9 "value": { 10 "fromPath": "surname" 11 } 12 } 13 ] 14}
1let mapper = new Agnese(); 2mapper.setMapInfo("map-info.json"); 3let target = mapper.map(sourceData);
The variable target
will contain the next object:
1{ 2 lastname: "Son" 3}
Since 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.
While I complete this documentation, I recommend you take a look at the examples used in the unit tests.
Agnese provides JSON schemas that you can use with VSCode to enable autocompletion and validation.
1{ 2 "$schema": "node_modules/agnese/schema/index.json", 3 "value": { 4 "type": "Integer", 5 "fromPath": "characteristics.age" 6 } 7}
You need to install the YAML extension.
1# yaml-language-server: $schema=node_modules/agnese/schema/index.json 2type: Object 3fields: 4 - name: parent 5 value: 6 default: Son Goku
If you think on CSV as an object with one unique level, you can easily map any data to CSV or other similar structure.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More