{"id":22445492,"url":"https://github.com/mistlog/type-query","last_synced_at":"2025-08-01T20:31:02.313Z","repository":{"id":46266680,"uuid":"422759201","full_name":"mistlog/type-query","owner":"mistlog","description":"jQuery style type manipulation","archived":false,"fork":false,"pushed_at":"2021-11-03T12:34:27.000Z","size":188,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T06:51:17.454Z","etag":null,"topics":["type","typescript","typetype"],"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/mistlog.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":"2021-10-30T01:56:57.000Z","updated_at":"2025-03-30T23:36:03.000Z","dependencies_parsed_at":"2022-09-09T03:01:38.622Z","dependency_job_id":null,"html_url":"https://github.com/mistlog/type-query","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mistlog/type-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistlog%2Ftype-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistlog%2Ftype-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistlog%2Ftype-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistlog%2Ftype-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mistlog","download_url":"https://codeload.github.com/mistlog/type-query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistlog%2Ftype-query/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268291192,"owners_count":24226772,"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-08-01T02:00:08.611Z","response_time":67,"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":["type","typescript","typetype"],"created_at":"2024-12-06T03:14:56.732Z","updated_at":"2025-08-01T20:31:02.038Z","avatar_url":"https://github.com/mistlog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeQuery \u0026middot; [![Build Status](https://github.com/mistlog/type-query/workflows/build/badge.svg)](https://github.com/mistlog/type-query/workflows/build/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/mistlog/type-query/badge.svg)](https://coveralls.io/github/mistlog/type-query)\n\nTypeQuery is a lib of [typetype](https://github.com/mistlog/typetype/), used to create complex typescript type using js, in jQuery style(jQuery means fashion here, :)).\n\n* introducation: [Type Query: jQuery Style Type Manipulation](https://mistlog.medium.com/type-query-jquery-style-type-manipulation-497ce26d93f)\n* quick start: [typetype template](https://github.com/mistlog/typetype-template)\n\n\n## Usage\n\n```bash\n\u003e npm i @mistlog/type-query\n```\n\n### API\n\n\u003e example: [typetype-template/src/type-query-basic.ts](https://github.com/mistlog/typetype-template/blob/main/src/type-query-basic.ts)\n\n```ts\nimport { transcribe } from \"@mistlog/type-query\";\n\nconst filePath = \"tuple-to-object.type\";\nconst input = `\n    type tuple = [\"tesla\", \"model 3\", \"model X\", \"model Y\"]\n\n    type result = \\`\\`\\` \"use js\"\n    return $.use(\"tuple\")\n        .tupleToObject()\n        .omit(key =\u003e !key.startsWith(\"model\"))\n        .type();\n    \\`\\`\\`\n`;\nconst output = transcribe(filePath, input);\nconsole.log(output.code);\n```\n\noutput: \n\n```ts\ntype tuple = [\"tesla\", \"model 3\", \"model X\", \"model Y\"];\ntype result = {\n  \"model 3\": \"model 3\";\n  \"model X\": \"model X\";\n  \"model Y\": \"model Y\";\n};\n```\n\n## Examples \n\n- all examples: [type query test assets](https://github.com/mistlog/type-query/tree/main/test/assets)\n\n## License\n\nThis project is [MIT licensed](https://github.com/mistlog/type-query/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmistlog%2Ftype-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmistlog%2Ftype-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmistlog%2Ftype-query/lists"}