{"id":43583804,"url":"https://github.com/aenario/circularmemo","last_synced_at":"2026-02-04T00:10:33.136Z","repository":{"id":42856783,"uuid":"260526643","full_name":"aenario/circularmemo","owner":"aenario","description":"Memoization function with support for circular references.","archived":false,"fork":false,"pushed_at":"2022-12-30T20:19:28.000Z","size":77,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-23T22:06:38.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/aenario.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-05-01T18:10:36.000Z","updated_at":"2020-05-01T18:10:57.000Z","dependencies_parsed_at":"2023-01-31T15:35:12.048Z","dependency_job_id":null,"html_url":"https://github.com/aenario/circularmemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aenario/circularmemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aenario%2Fcircularmemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aenario%2Fcircularmemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aenario%2Fcircularmemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aenario%2Fcircularmemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aenario","download_url":"https://codeload.github.com/aenario/circularmemo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aenario%2Fcircularmemo/sbom","scorecard":{"id":168869,"data":{"date":"2025-08-11","repo":{"name":"github.com/aenario/circularmemo","commit":"6e2b41c3f8e64b09b3be5512edc8a1d02ff03690"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/1 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":"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":"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":"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":"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":"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":"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":"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":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"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-16T15:47:58.978Z","repository_id":42856783,"created_at":"2025-08-16T15:47:58.978Z","updated_at":"2025-08-16T15:47:58.978Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29062493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T23:14:54.203Z","status":"ssl_error","status_checked_at":"2026-02-03T23:14:50.873Z","response_time":96,"last_error":"SSL_read: 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":[],"created_at":"2026-02-04T00:10:32.484Z","updated_at":"2026-02-04T00:10:33.099Z","avatar_url":"https://github.com/aenario.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# circularmemo\n\nA convenience function to recursively iterates over a (like typescript's types)\nwith memoization and without breaking circular references.\n\nIt requires your function to expect itself as the first argument, and returns \na similar function, you can then pass your function to a Y-combinator to get a \n\"normal\" function.\n\nThis package also provides a spreading Y combinator and the `MFN` type for this kind of\nself-passed function.\n\n```typescript\nimport { Y, circularmemo, MFN } from 'circularmemo'\n\ninterface Node {\n    n: number,\n    left: Node,\n}\nconst circle: Node = { n: 1, left: { n: 2, left: (null as unknown as Node) } }\ncircle.left.left = circle\n\nconst _plusX: MFN\u003c[Node, number], Node\u003e = (self, x, n) =\u003e\n    ({ n: x.n + n, left: self(x.left, n) })\n\nconst plusX = Y(circularmemo({\n    circularMarker: (_) =\u003e ({} as Node), // leave an empty object, which will be\n    replaceMarker: (marker, res) =\u003e Object.assign(marker, res) // fill up the object\n}, _plusX))\n\nconst result = plusX(circle, 1)\nassert(result.n === 2)\nassert(result.left.n === 3)\nassert(result.left.left === result) // maintained circular\n```\n\n## Other options\n\nThe first arguments to `circularmemo` is a Param object which accepts \nthe following functions.\n\n\n```typescript\ncircularMarker: (...args: Args) =\u003e Marker,\nreplaceMarker: (tmp: Marker, final: Res) =\u003e Res\n\nuseMarker?: (tmp: Marker) =\u003e Res,\nuseExisting?: (existing: Res) =\u003e Res,\nshouldMemo?: (...args: Args) =\u003e boolean,\nkeyMaker?: (...args: Args) =\u003e Key,\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faenario%2Fcircularmemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faenario%2Fcircularmemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faenario%2Fcircularmemo/lists"}