{"id":30883255,"url":"https://github.com/globocom/json-sharp","last_synced_at":"2025-09-08T09:43:50.359Z","repository":{"id":57285263,"uuid":"43568048","full_name":"globocom/json-sharp","owner":"globocom","description":"Javascript tool to process operations on pure JSON objects","archived":false,"fork":false,"pushed_at":"2017-06-28T17:01:43.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-08-20T14:18:12.251Z","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/globocom.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":"2015-10-02T18:01:44.000Z","updated_at":"2021-04-11T18:22:52.000Z","dependencies_parsed_at":"2022-09-04T19:20:51.802Z","dependency_job_id":null,"html_url":"https://github.com/globocom/json-sharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/json-sharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fjson-sharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fjson-sharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fjson-sharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fjson-sharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/json-sharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fjson-sharp/sbom","scorecard":{"id":430064,"data":{"date":"2025-08-11","repo":{"name":"github.com/globocom/json-sharp","commit":"863847609f4619f9a1d98325ef26d1214687fe0b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 2/28 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:07:41.458Z","repository_id":57285263,"created_at":"2025-08-19T03:07:41.459Z","updated_at":"2025-08-19T03:07:41.459Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166928,"owners_count":25233959,"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-09-08T02:00:09.813Z","response_time":121,"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":[],"created_at":"2025-09-08T09:43:48.415Z","updated_at":"2025-09-08T09:43:50.344Z","avatar_url":"https://github.com/globocom.png","language":"JavaScript","funding_links":[],"categories":["Transformations"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/globocom/json-sharp.png?branch=master)](https://travis-ci.org/globocom/json-sharp)\n\njson-sharp\n==========\n\nProcess operations on pure JSON objects.\n\n\n## How it works\n\n`JSONSharp.process` clones an object and processes operations returning a\nmodified object.\n\nOperations are simple objects with a single property representing its name.\n\nThe operation name should be preceded by the `#` (sharp) symbol to avoid\nconflicts with real data.\n\nThe property value is processed by the operation logic using a given context.\n\n\n## Motivation\n\nSome systems need slightly different configuration between environments and\ncontexts. This technique allows to have a good degree of reuse with a simple\nformat.\n\n\n## Example\n\nGiven the following object and context:\n\n```js\nvar config = {\n    '#merge': [\n        {debug: true, url: 'http://localhost'},\n        {\n            '#switch': {\n                '#property': 'env',\n                '#case': {\n                    dev: {\n                        url: 'http://dev.com/'\n                    },\n                    prod: {\n                        url: 'http://prod.com/',\n                        debug: false\n                    }\n                }\n            }\n        }\n    ]\n};\n\nvar context = {\n    env: 'dev'\n};\n\nvar devConfig = require('JSONSharp').process(config, context);\n```\n\nResults in the following `devConfig` object:\n\n```js\n{\n    debug: true, // Debug flag inherited from merging with the defaults\n    url: 'http://dev.com/' // Url is replaced\n}\n```\n\n\n## Operations\n\n### `#merge`\n\nThe `#merge` operation takes a list of objects and deeply merges its properties\nusing the [deepmerge](https://www.npmjs.com/package/deepmerge) library.\n\nExamples:\n\n```js\nJSONSharp.process({'#merge': [{a: 'a'}, {b: 'b']}, {});\n// ==\u003e {a: 'a', b: 'b'}\n```\n\n\n### `#switch`\n\nThe `#switch` operation works much like the [switch](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/switch) Javascript statement, with the exception that it doesn't\nuse a `break` statement.\n\nIt takes an object with the following properties:\n\n* `#property`: the property name or `JSONPath` to be matched for results\n* `#case`: an object mapping `#property` values to desired results\n* `#case.#default`: the value will be used if no matching value is found\n\nExamples:\n\n```js\nvar switchObj = {\n    '#switch': {\n        '#property': 'name',\n        '#case': {a: 'Prop A', '#default': 'not found'}\n    }\n};\n\nJSONSharp.process(switchObj, {});\n// ==\u003e \"not found\"\n\nJSONSharp.process(switchObj, {name: 'a'});\n// ==\u003e \"Prop A\"\n\nJSONSharp.process(switchObj, {name: '$.a'});\n// ==\u003e \"Prop A\"\n```\n\n\n## Property resolution\n\nA `#property` starting with `$.` will be resolved using the\n[JSONPath](https://www.npmjs.com/package/JSONPath) library, otherwise simple\nproperty access will be used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fjson-sharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Fjson-sharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fjson-sharp/lists"}