{"id":15722551,"url":"https://github.com/thinknathan/defold-etable","last_synced_at":"2025-10-14T19:30:53.194Z","repository":{"id":212427911,"uuid":"731472890","full_name":"thinknathan/defold-etable","owner":"thinknathan","description":"A native extension for Defold with functions to manipulate tables.","archived":true,"fork":false,"pushed_at":"2024-03-03T23:18:05.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T11:35:55.722Z","etag":null,"topics":["defold","defold-extension","defold-game-engine","defold-library","defold-native-extension","gamedev"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thinknathan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-14T06:52:23.000Z","updated_at":"2024-03-17T18:45:25.000Z","dependencies_parsed_at":"2023-12-20T23:59:34.875Z","dependency_job_id":"68d7f9a6-c81c-4978-9df3-0a05076e8fde","html_url":"https://github.com/thinknathan/defold-etable","commit_stats":null,"previous_names":["thinknathan/defold-etable"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thinknathan/defold-etable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fdefold-etable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fdefold-etable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fdefold-etable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fdefold-etable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinknathan","download_url":"https://codeload.github.com/thinknathan/defold-etable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fdefold-etable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020650,"owners_count":26086898,"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-10-14T02:00:06.444Z","response_time":60,"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":["defold","defold-extension","defold-game-engine","defold-library","defold-native-extension","gamedev"],"created_at":"2024-10-03T22:08:22.215Z","updated_at":"2025-10-14T19:30:52.872Z","avatar_url":"https://github.com/thinknathan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"_docs/def-etable-x1.png\" alt=\"Def-eTable\"\u003e\n\n# Def-eTable\n\n[![Build with bob](https://github.com/thinknathan/defold-etable/actions/workflows/bob.yml/badge.svg)](https://github.com/thinknathan/defold-etable/actions/workflows/bob.yml) ![GitHub License](https://img.shields.io/github/license/thinknathan/defold-etable)\n\nThis Defold native extension implements functions to manipulate tables in Lua scripts.\n\nWarning: in Lua, table values are not guaranteed to have a stable order.\n\n## API\n\n- `etable.empty(table)`\n- Clears all values from the given table.\n\n- `etable.remove(table, key)`\n- Removes a value with a specific key from a table.\n\n- `etable.index_of(table, value)`\n- Finds the index/key of the first occurrence of a value in the given table.\n\n- `etable.slice(table, start_index, end_index)`\n- Creates a new table containing a subset of the elements from an existing table.\n\n## Installation\n\n1. Edit game.project\n2. Add dependency `https://github.com/thinknathan/defold-etable/archive/main.zip` for the current version\n   - Or add a specific [release](https://github.com/thinknathan/defold-etable/releases)\n\n### TypeScript Definitions\n\nThis extension includes types for use with [TypeScript + Defold](https://ts-defold.dev/).\n\n1. Install these types\n\n```bash\nyarn add git+https://git@github.com/thinknathan/defold-etable.git#^1.0.0 -D\n# or\nnpm install git+https://git@github.com/thinknathan/defold-etable.git#^1.0.0 --save-dev\n```\n\n2. Add `defold-etable` to `types` in `tsconfig.json`\n\n```diff\n{\n\t\"compilerOptions\": {\n\t\t\"types\": [\n+\t\t\t\"defold-etable\",\n\t\t],\n\t}\n}\n```\n\n3. Add `node_modules/@types` to `typeRoots` in `tsconfig.json` if it's not already there\n\n```diff\n{\n\t\"compilerOptions\": {\n\t\t\"typeRoots\": [\n+\t\t\t\"node_modules/@types\",\n\t\t],\n\t}\n}\n```\n\n## Usage\n\n```lua\n-- Sample table\nlocal myTable = { \"apple\", \"banana\", \"cherry\", \"date\", \"fig\" }\n\n-- index_of\n-- Finds the index/key of the first occurrence of a value in the given table.\n-- If the table is structured like an array, the numerical index is returned.\n-- If the table is structured in key/value pairs, the key is returned.\nlocal index = etable.index_of(myTable, \"banana\")  -- Result: Index of 'banana': 2\n\n-- remove\n-- Removes a value with a specific key from a table.\netable.remove(myTable, 4)  -- Result: After remove: apple, banana, cherry, fig\n\n-- slice\n-- Creates a new table containing a subset of the elements from an existing table.\n-- Start: The starting index\n-- End: The ending index (exclusive)\nlocal slicedTable = etable.slice(myTable, 2, 4)  -- Result: Sliced table: banana, cherry, date\n\n-- empty\n-- Clears all values from the given table.\netable.empty(myTable)  -- Result: After empty: { }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinknathan%2Fdefold-etable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinknathan%2Fdefold-etable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinknathan%2Fdefold-etable/lists"}