{"id":16014866,"url":"https://github.com/kitten/bs-rebel","last_synced_at":"2025-03-18T02:32:45.422Z","repository":{"id":78159628,"uuid":"165452570","full_name":"kitten/bs-rebel","owner":"kitten","description":"A toolkit for collections for bsb-native and bsb aimed at bundle size and performance","archived":false,"fork":false,"pushed_at":"2019-01-14T02:51:39.000Z","size":23,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T06:30:34.018Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-13T01:06:12.000Z","updated_at":"2020-04-23T14:40:25.000Z","dependencies_parsed_at":"2023-02-27T21:30:26.299Z","dependency_job_id":null,"html_url":"https://github.com/kitten/bs-rebel","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"21f1942f39b6898c59e45eaca6787300c67eaf8f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fbs-rebel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fbs-rebel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fbs-rebel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fbs-rebel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitten","download_url":"https://codeload.github.com/kitten/bs-rebel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243896301,"owners_count":20365354,"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-10-08T15:05:22.574Z","updated_at":"2025-03-18T02:32:45.407Z","avatar_url":"https://github.com/kitten.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bs-rebel\n\n**Rebel** is a toolkit for collection APIs that work with both `bsb-native` and `bsb`.\n\nWhen you're aiming to write libraries with BuckleScript you're\noften made to choose between using convenient APIs that only\nwork when compiling to JS, like `Js.Array` or to include more\n`bs-platform/lib` code, like `Array` or `Belt`.\n\nThink of **Rebel** as a standard library wrapper. It aims to\nuse JS built-ins as often as possible, but falls back to using\nthe BuckleScript standard library on native.\n\n*(Its name comes from \"Re\" as in \"Reason\" and \"bel\" as in \"belt\")*\n\n## Getting Started\n\nInstall the library from `npm`:\n\n```sh\nyarn add bs-rebel\n# or for npm\nnpm install --save bs-rebel\n```\n\nAnd add `bs-rebel` to your `bsconfig.json`\n\n```diff\n{\n  \"name\": \"\u003cyour name\u003e\",\n  \"version\": \"0.1.0\",\n  \"sources\": [\"src\"],\n  \"bsc-flags\": [\"-bs-super-errors\"],\n  \"bs-dependencies\": [\n+    \"bs-rebel\"\n  ]\n}\n```\n\nAll of Rebel's module are namespaced as `Rebel`, so for instance to\naccess the `MutableQueue` module use: `Rebel.MutableQueue`\n\n## Supported APIs\n\n### `MutableQueue`\n\nSee [Belt.MutableQueue](https://bucklescript.github.io/bucklescript/api/Belt.MutableQueue.html) for this module's signature.\n\nIn JS, this module uses externals to mirror as many functions\nfrom the `Belt` module as possible. The only functions that don't\ncompletely compile away (but are rather small) are\n`reduce`, `reduceU`, and `transfer`.\n\nIt also adds an `addMany` function that does compile away, but\nisn't part of the standard `Belt.MutableQueue` module.\n\n### `MutableStack`\n\nSee [Belt.MutableStack](https://bucklescript.github.io/bucklescript/api/Belt.MutableStack.html) for this module's signature.\n\nIn JS, this module uses externals to mirror as many functions\nfrom the `Belt` module as possible. The only functions that don't\ncompletely compile away (but are rather small) are\n`isEmpty` and `top`.\n\nIt does not implement `dynamicPopIterU` and `dynamicPopIter`.\n\n### `Array`\n\nSee [Rebel_types.re](https://github.com/kitten/bs-rebel/blob/master/src/dev/Rebel_types.re) for this module's signature.\nUnfortunately there are no auto-generated docs yet.\n\nThis module slightly diverges from `Array`, `Js.Array`, and `Belt.Array`. It tries to match the implementation\nof the JS Array methods as closely as possible. However, there are some in-place modification methods that are\nnot implemented in `Belt.Array` and are thus not included in `Rebel.Array`.\n\nOther methods like `filter` and `removeCount` are present though.\n\nThe JS externals that don't compile away completely are:\n\n- `set` (as opposed to `setUnsafe` which compiles away)\n- `reverse` (as opposed to `reverseInPlace` which compiles away)\n- `remove` (as opposed to `removeInPlace` which compiles away)\n- `removeCount` (as opposed to `removeCountInPlace` which compiles away)\n- `shuffle`\n- `shuffleInPlace`\n- `make`\n- `set`\n- `includes`\n\nSome JS-only methods are for completeness' sake still included in `Rebel.Array.Js`, but they won't be\navailable during native compilation!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fbs-rebel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitten%2Fbs-rebel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fbs-rebel/lists"}