{"id":13726152,"url":"https://github.com/jaredly/js_deep_ppx","last_synced_at":"2025-09-04T01:34:03.479Z","repository":{"id":57283937,"uuid":"193611118","full_name":"jaredly/js_deep_ppx","owner":"jaredly","description":"[@js.deep] for immutably updating nested javascript objects in Reason/OCaml","archived":false,"fork":false,"pushed_at":"2019-07-02T05:11:41.000Z","size":4061,"stargazers_count":36,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-10T13:48:27.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/jaredly.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":"2019-06-25T01:33:25.000Z","updated_at":"2023-07-28T13:24:25.000Z","dependencies_parsed_at":"2022-09-19T22:33:24.692Z","dependency_job_id":null,"html_url":"https://github.com/jaredly/js_deep_ppx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaredly/js_deep_ppx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredly%2Fjs_deep_ppx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredly%2Fjs_deep_ppx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredly%2Fjs_deep_ppx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredly%2Fjs_deep_ppx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredly","download_url":"https://codeload.github.com/jaredly/js_deep_ppx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredly%2Fjs_deep_ppx/sbom","scorecard":{"id":506378,"data":{"date":"2025-08-11","repo":{"name":"github.com/jaredly/js_deep_ppx","commit":"fb2533df25839566932dbb952dd3eb56cf2fa97c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/5 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":"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":9,"reason":"binaries present in source code","details":["Warn: binary detected: publish/ppx:1"],"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":"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"}}]},"last_synced_at":"2025-08-19T23:19:32.224Z","repository_id":57283937,"created_at":"2025-08-19T23:19:32.224Z","updated_at":"2025-08-19T23:19:32.224Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539279,"owners_count":25123494,"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-03T02:00:09.631Z","response_time":76,"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":"2024-08-03T01:02:54.130Z","updated_at":"2025-09-04T01:34:03.456Z","avatar_url":"https://github.com/jaredly.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# [@js.deep] for immutably updating javascript objects in Reason/OCaml\n\nMotivation: Reason has this nice syntax for constructing javascript objects `{\"some\": thing}`, and a nice way to represent the types `type t = {. \"some\": int}`, and so it can be quite convenient when working with external javascript libraries to just keep everything in the original data format ... that is, until you want to update something. Mutative updates require creating `external`s for every field, and trying to update things immutably is an exercise in frustration.\n\nThat's where `js.deep` comes in! This ppx allows you to retain type safety, while making immutable updates to deeply nested javascript objects almost painless.\n\n## Usage:\n\n`js.deep` transforms code that looks like `some_value[\"attrname\"].replace(newvalue)` into code that does the equivalent of the javascript `{...some_value, attrname: newvalue}`, and `some_value[\"attrname\"].map(somefn)` with `{...some_value, attrname: somefn(some_value.attrname)}`.\n\n```reason\n// Some nested data\nlet one = {\"one\": {\"two\": {\"three\": 4}}};\n\n// Updating a field -- this replaces the value at \"three\" with 5\nlet two = [%js.deep one[\"one\"][\"two\"][\"three\"].replace(5)];\n/* Fails type check (arg needs to be an int)\nlet two = [%js.deep one[\"one\"][\"two\"][\"three\"].replace(5.0)];\n*/\n\nassert(two == {\"one\": {\"two\": {\"three\": 5}}});\n\n// Updating a field with a map function, increasing the value by 10\nlet three = [%js.deep one[\"one\"][\"two\"][\"three\"].map(n =\u003e n + 10)];\n/* Fails type check (transform function expects a float, gets an int)\nlet two = [%js.deep one[\"one\"][\"two\"][\"three\"].map(n =\u003e n +. 1.0)];\n*/\n\nassert(three == {\"one\": {\"two\": {\"three\": 14}}});\n\n/* Fails type check (accessing paths that don't exist)\nlet two = [%js.deep one[\"one\"][\"two\"][\"five\"].replace(5)];\nlet two = [%js.deep one[\"one\"][\"three\"][\"five\"].replace(5)];\n*/\n\nlet other = {\"one\": {\"two\": {\"three\": {\"four\": 4, \"five\": 5}}}};\n\n// map + replace!\nlet other_new = [%js.deep other[\"one\"][\"two\"][\"three\"].map(\n  // update two fields\n  three =\u003e three[\"four\"].replace(10)[\"five\"].replace(50)\n)];\nassert(other_new == {\"one\": {\"two\": {\"three\": {\"four\": 10, \"five\": 50}}}})\n```\n\n## Installation\n\n`npm i js_deep_ppx`\n\nbsconfig.json\n\n```\n\"ppx-flags\": [\"js_deep_ppx/ppx\"]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredly%2Fjs_deep_ppx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredly%2Fjs_deep_ppx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredly%2Fjs_deep_ppx/lists"}