aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2019-09-17 17:01:39 -0400
committerandrewdkim <adkim414@gmail.com>2019-09-17 17:01:39 -0400
commitcd052ac6bd318a0569c66ca1fba684b7dbdaaca9 (patch)
tree29b3086762f70965f6be2c586180bf3c4c252688 /src/Utils.ts
parent02119d9fa648ed530d956889a2244875978ad093 (diff)
parent1310633790e3db50a31a1cc6d357306d7884a053 (diff)
merge
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 3921a49c3..415023ac4 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -37,6 +37,7 @@ export class Utils {
public static prepend(extension: string): string {
return window.location.origin + extension;
}
+
public static CorsProxy(url: string): string {
return this.prepend(RouteStore.corsProxy + "/") + encodeURIComponent(url);
}
@@ -239,6 +240,10 @@ export function timenow() {
return now.toLocaleDateString() + ' ' + h + ':' + m + ' ' + ampm;
}
+export function percent2frac(percent: string) {
+ return Number(percent.substr(0, percent.length - 1)) / 100;
+}
+
export function numberRange(num: number) { return Array.from(Array(num)).map((v, i) => i); }
export function returnTrue() { return true; }