{"id":19281302,"url":"https://github.com/calavera/query-map-rs","last_synced_at":"2025-04-22T01:31:01.135Z","repository":{"id":40492238,"uuid":"459417769","full_name":"calavera/query-map-rs","owner":"calavera","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-03T15:31:18.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T01:08:33.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/calavera.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":"2022-02-15T03:47:24.000Z","updated_at":"2024-10-26T17:18:22.000Z","dependencies_parsed_at":"2024-11-09T21:23:59.617Z","dependency_job_id":"64738489-621e-405c-a6b4-02e473a06751","html_url":"https://github.com/calavera/query-map-rs","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.2941176470588235,"last_synced_commit":"fab952e4167eef6f199d1a81f49ee522735c6efd"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calavera%2Fquery-map-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calavera%2Fquery-map-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calavera%2Fquery-map-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calavera%2Fquery-map-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calavera","download_url":"https://codeload.github.com/calavera/query-map-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250161957,"owners_count":21385014,"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-09T21:22:17.924Z","updated_at":"2025-04-22T01:31:00.718Z","avatar_url":"https://github.com/calavera.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QueryMap\n\n[![crates.io][crate-image]][crate-link]\n[![Documentation][doc-image]][doc-link]\n[![Build Status][build-image]][build-link]\n\nQueryMap is a generic wrapper around HashMap\u003cString, Vec\u003cString\u003e\u003e\nto handle different transformations like URL query strings.\n\nQueryMap can normalize HashMap structures with single value elements\ninto structures with value vector elements.\n\n## Installation\n\n```\ncargo install query_map\n```\n\n## Examples\n\nCreate a QueryMap from a HashMap:\n\n```rust\nuse std::collections::HashMap;\nuse query_map::QueryMap;\n\nlet mut data = HashMap::new();\ndata.insert(\"foo\".into(), vec![\"bar\".into()]);\n\nlet map: QueryMap = QueryMap::from(data);\nassert_eq!(\"bar\", map.first(\"foo\").unwrap());\nassert_eq!(None, map.first(\"bar\"));\n```\n\nCreate a QueryMap from a Serde Value (requires `serde` feature):\n\n```rust\nuse query_map::QueryMap;\n#[derive(Deserialize)]\nstruct Test {\n    data: QueryMap,\n}\n\nlet json = serde_json::json!({\n    \"data\": {\n        \"foo\": \"bar\"\n    }\n});\n\nlet test: Test = serde_json::from_value(json).unwrap();\nassert_eq!(\"bar\", test.data.first(\"foo\").unwrap());\n```\n\nCreate a QueryMap from a query string (requires `url-query` feature):\n\n```rust\nuse query_map::QueryMap;\n\nlet data = \"foo=bar\u0026baz=quux\u0026foo=qux\";\nlet map = data.parse::\u003cQueryMap\u003e().unwrap();\nlet got = map.all(\"foo\").unwrap();\nassert_eq!(vec![\"bar\", \"qux\"], got);\n```\n\n[//]: # (badges)\n\n[crate-image]: https://img.shields.io/crates/v/query_map.svg\n[crate-link]: https://crates.io/crates/query_map\n[doc-image]: https://docs.rs/query_map/badge.svg\n[doc-link]: https://docs.rs/query_map\n[build-image]: https://github.com/calavera/query-map-rs/workflows/Build/badge.svg\n[build-link]: https://github.com/calavera/query-map-rs/actions?query=workflow%3ACI+branch%3Amain","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalavera%2Fquery-map-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalavera%2Fquery-map-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalavera%2Fquery-map-rs/lists"}