Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Mar 30, 2023
1 parent 19ecd14 commit 6b2f394
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"scripts": {
"icons": "svgexport icons/plain.svg public/icons/48.png 48:48 && svgexport icons/plain.svg public/icons/96.png 96:96",
"format": "prettier . --write",

"build": "tsc && vite build",
"watch": "vite build --watch --mode development --minify false",
"dev": "vite",
Expand All @@ -36,4 +35,4 @@
"dependencies": {
"leaflet": "^1.9.3"
}
}
}
10 changes: 6 additions & 4 deletions src/res/utils/parsePB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ function convertType(item: string): [string | number, boolean] {
let val: string | number = item;

switch (type) {
case 'f': case 'd': // float || double
case 'f':
case 'd': // float || double
val = parseFloat(item);
break;
case 'i': case 'm': // int || matrix1d
case 'i':
case 'm': // int || matrix1d
val = parseInt(item);
break;
case 'e': // enum
Expand All @@ -20,11 +22,11 @@ function convertType(item: string): [string | number, boolean] {
break;
case '1':
val = 'satellite';
};
}
break;
case 'z': // base64 encoded coords
val = atob(item).replace(/[^\d\s\-\.\'\"\°SNWE]/g, '');
};
}

return [val, type === 'm'];
}
Expand Down
2 changes: 1 addition & 1 deletion src/res/utils/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function readQ(addr: string): Promise<Marker | null> {
return null;
}

let json: {lat: string; lon: string}[] = await res.json();
let json: { lat: string; lon: string }[] = await res.json();

let body: { lat: string; lon: string } = json[0];

Expand Down

0 comments on commit 6b2f394

Please sign in to comment.