Initial 1.3.x rework

This commit is contained in:
Sacha Weatherstone
2022-07-26 08:52:23 +10:00
parent ff6019098b
commit a2280ab96e
163 changed files with 6383 additions and 14397 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
export const fetcher = async <JSON>(
input: RequestInfo,
init?: RequestInit,
init?: RequestInit
): Promise<JSON> => {
const res = await fetch(input, init);
return res.json() as Promise<JSON>;
+3
View File
@@ -0,0 +1,3 @@
export const randId = () => {
return Math.floor(Math.random() * 1e9);
};
+15
View File
@@ -0,0 +1,15 @@
import type React from "react";
export const renderOptions = (enumValue: {
[s: string]: string | number;
}): JSX.Element[] => {
const optionsEnumValues = enumValue
? Object.entries(enumValue).filter((value) => typeof value[1] === "number")
: [];
return optionsEnumValues.map(([name, value], index) => (
<option key={index} value={value}>
{name}
</option>
));
};
+8
View File
@@ -0,0 +1,8 @@
import { LatLon } from "geodesy/mgrs.js";
export const toMGRS = (lat?: number, lng?: number) => {
if (lat && lng && lat !== 0 && lng !== 0) {
return new LatLon(lat / 1e7, lng / 1e7).toUtm().toMgrs().toString();
}
return "No Fix.";
};
+88
View File
@@ -0,0 +1,88 @@
export interface IAutor {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: false;
}
export interface IAsset {
url: string;
id: number;
node_id: string;
name: string;
label: string;
uploader: {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: false;
};
content_type: string;
state: string;
size: number;
download_count: 223;
created_at: string;
updated_at: string;
browser_download_url: string;
}
export interface IRelease {
url: string;
assets_url: string;
upload_url: string;
html_url: string;
id: number;
author: IAutor;
node_id: string;
tag_name: string;
target_commitish: string;
name: string;
draft: false;
prerelease: false;
created_at: string;
published_at: string;
assets: IAsset[];
tarball_url: string;
zipball_url: string;
body: string;
reactions: {
url: string;
total_count: number;
"+1": number;
"-1": number;
laugh: number;
hooray: 1;
confused: number;
heart: number;
rocket: number;
eyes: number;
};
}