{"id":20630703,"url":"https://github.com/sysgears/fractal-objects","last_synced_at":"2025-04-15T18:22:40.961Z","repository":{"id":33274777,"uuid":"150860353","full_name":"sysgears/fractal-objects","owner":"sysgears","description":"Fractal Objects - self-similar objects that can be multiplied together and the result will be a fractal object and have the same type and shape as multiplicands.","archived":false,"fork":false,"pushed_at":"2023-01-03T19:43:51.000Z","size":996,"stargazers_count":2,"open_issues_count":12,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T17:48:57.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sysgears.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":"2018-09-29T12:05:33.000Z","updated_at":"2022-05-19T05:55:43.000Z","dependencies_parsed_at":"2023-01-15T00:17:32.854Z","dependency_job_id":null,"html_url":"https://github.com/sysgears/fractal-objects","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Ffractal-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Ffractal-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Ffractal-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Ffractal-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysgears","download_url":"https://codeload.github.com/sysgears/fractal-objects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249126459,"owners_count":21216786,"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","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-11-16T14:09:20.003Z","updated_at":"2025-04-15T18:22:40.936Z","avatar_url":"https://github.com/sysgears.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fractal Objects\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/sysgears.svg?style=social)](https://twitter.com/sysgears)\n\n## Example\n\n```javascript\n// Fractal object #1\nconst part1 = { arrayKey: [1], objectKey: { a: 'a', b: 'b' } };\n// Fractal object #2\nconst part2 = { arrayKey: [2, 3], objectKey: { c: 'c' } };\n// Fractal object #3\nconst part3 = { arrayKey: [4] }\n\n// View the result of the multiplication of the fractal objects #1, #2, and #3\nconsole.log(fold([part1, part2, part3]));\n// The output is a new fractal object:\n// { arrayKey: [ 1, 2, 3, 4 ], objectKey: { a: 'a', b: 'b', c: 'c' } }\n```\n\n## Concept\n\nA fractal object is an object that has self-similarity at lower scales. Multiplication of two fractal objects results in a new fractal object that has the same shape as the original ones.\n\nIf we multiply fractal objects in a list pairwise, we'll receive a new fractal object, which will represent all the fractal objects in the list and which will also have the same shape.\n\nBy default, the multiplication function provided by the `fractal-objects` package multiplies two objects by concatenating their array values, merging object values, and replacing scalars with\nvalues from the second multiplied object.\n\nAny other multiplication function can be used if it has the following properties:\n\n1. It _keeps the object shape_: The multiplicands and the result must have the same shape and type.\n2. It's _associative_. For example, multiplying `(a b) c` must have the same result as multiplying `a (b c)`.\n3. It must yield the result `a` when multiplying `undefined a` or `a undefined`.\n\nIn terms of mathematics, fractal objects are a _[semigroup]_.\n\n## Usage\n\nFractal Objects currently have implementations for these programming languages:\n\n  - [TypeScript](/typescript)\n  - [Scala](/scala)\n\n## License\n\nCopyright © 2018 [SysGears (Cyprus) Limited]. This source code is licensed under the [MIT] license.\n\n[MIT]: LICENSE\n[SysGears (Cyprus) Limited]: http://sysgears.com\n[commutative semigroup]: https://en.wikipedia.org/wiki/Semigroup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysgears%2Ffractal-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysgears%2Ffractal-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysgears%2Ffractal-objects/lists"}