{"id":17854172,"url":"https://github.com/federicobond/c3-linearization","last_synced_at":"2025-03-20T11:36:33.881Z","repository":{"id":57192291,"uuid":"126424211","full_name":"federicobond/c3-linearization","owner":"federicobond","description":"A package for doing Solidity and Python-style C3-linearization in ECMAScript","archived":false,"fork":false,"pushed_at":"2018-05-01T10:58:59.000Z","size":22,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-11T11:26:21.772Z","etag":null,"topics":["algorithm","c3","linearization","mro","nodejs","python","solidity"],"latest_commit_sha":null,"homepage":"","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/federicobond.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-03-23T02:50:42.000Z","updated_at":"2024-06-21T04:20:22.000Z","dependencies_parsed_at":"2022-09-01T03:40:21.411Z","dependency_job_id":null,"html_url":"https://github.com/federicobond/c3-linearization","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/federicobond%2Fc3-linearization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicobond%2Fc3-linearization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicobond%2Fc3-linearization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/federicobond%2Fc3-linearization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/federicobond","download_url":"https://codeload.github.com/federicobond/c3-linearization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221753133,"owners_count":16875091,"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":["algorithm","c3","linearization","mro","nodejs","python","solidity"],"created_at":"2024-10-28T00:42:03.478Z","updated_at":"2024-10-28T00:42:03.938Z","avatar_url":"https://github.com/federicobond.png","language":"JavaScript","readme":"\nc3-linearization\n================\n\n[![Build Status](https://travis-ci.org/federicobond/c3-linearization.svg?branch=master)](https://travis-ci.org/federicobond/c3-linearization)\n![npm version](https://img.shields.io/npm/v/c3-linearization.svg)\n\nA package for doing Python-style C3-linearization in ECMAScript.\n\n## Usage\n\n```javascript\nimport { linearize } from 'c3-linearization'\n\nlinearize({\n  'A': ['B', 'C'],\n  'B': [],\n  'C': ['D'],\n  'D': []\n})\n\n// {\n//   'A': ['A', 'B', 'C', 'D'],\n//   'B': ['B'],\n//   'C': ['C', 'D'],\n//   'D': ['D']\n// }\n```\n\n### Important notes\n\n*Solidity* does linearization from right to left (you write the parents from most\nbase-like to most derived). This is exactly the reverse as in Python, where you\nput the most derived classes to the left. To get correct results with Solidity,\nset the `reverse` option to true.\n\n```javascript\nlinearize('A': ['B', 'C'], { reverse: true })\n```\n\n*Python* is also a bit more strict in the cases that it accepts. For accurate\nPython MRO, set the `python` option to true.\n\n```javascript\nlinearize('A': ['B', 'C'], { python: true })\n```\n\n## Author\n\nFederico Bond\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericobond%2Fc3-linearization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedericobond%2Fc3-linearization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericobond%2Fc3-linearization/lists"}