authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-09-11 23:57:10 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-09-11 23:57:10 -07:00
log23a6c92d0729d8bae6b6e774c6333304094d1fc0
treeab0a0724653a852da63f6b99c09dccc506f76760
parent8f8fd1fd053c5258b3397cb251caad107f741be5

add providerByName


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
161pub 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}