Skip to content

Commit

Permalink
Merge branch 'birdflop' of https://github.com/birdflop/web into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bwmp committed Jul 12, 2024
2 parents 0187ca0 + d64c3be commit ef604c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/routes/api/v2/rgb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ export const onGet: RequestHandler = async ({ json, query }) => {

const keys = Object.keys(queryjson);
for (const key of keys) {
if (key == 'colors') queryjson.colors = queryjson.colors.split(',');
else if (queryjson[key] == 'true') queryjson[key] = true;
else if (queryjson[key] == 'false') queryjson[key] = false;
else if (queryjson[key].startsWith('{') && queryjson[key].endsWith('}')) queryjson[key] = JSON.parse(queryjson[key]);
if (key == 'format' || key == 'colors') queryjson[key] = JSON.parse(queryjson[key]);
else if (queryjson[key] === 'true' || queryjson[key] === 'false') queryjson[key] = queryjson[key] === 'true';
else if (!isNaN(Number(queryjson[key]))) queryjson[key] = Number(queryjson[key]);
}
output = await getOutput(queryjson);
}
Expand Down

0 comments on commit ef604c2

Please sign in to comment.