| author | |
| committer | |
| log | 23a6c92d0729d8bae6b6e774c6333304094d1fc0 |
| tree | ab0a0724653a852da63f6b99c09dccc506f76760 |
| parent | 8f8fd1fd053c5258b3397cb251caad107f741be5 |
1 files changed, 10 insertions(+), 0 deletions(-)
src/lib.zig+10| ... | @@ -157,3 +157,13 @@ pub const dynamic_providers = struct { | ... | @@ -157,3 +157,13 @@ pub const dynamic_providers = struct { |
| 157 | .color = "#FBA457", | 157 | .color = "#FBA457", |
| 158 | }; | 158 | }; |
| 159 | }; | 159 | }; |
| 160 | |||
| 161 | pub fn providerById(name: string) ?Provider { | ||
| 162 | inline for (std.meta.declarations(providers)) |item| { | ||
| 163 | const p = @field(providers, item.name); | ||
| 164 | if (std.mem.eql(u8, p.id, name)) { | ||
| 165 | return p; | ||
| 166 | } | ||
| 167 | } | ||
| 168 | return null; | ||
| 169 | } |