aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authortschicke-brown <tyler_schicke@brown.edu>2019-04-08 21:59:41 -0400
committerGitHub <noreply@github.com>2019-04-08 21:59:41 -0400
commitfbb5f2c19ffd1278d31b432a74ec3ae747b85894 (patch)
treeb6a4255bd3a0a3c30504639f3e0e7a48ebadd420 /src/Utils.ts
parenta2135bcc0a995378aad0e71ade832a4d526a37f0 (diff)
parente963f324fe8436ff5fc8ee21cdf091b6265690f9 (diff)
Merge pull request #81 from browngraphicslab/propsRefactor
Props refactor
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index a5d9bd0ca..8bd7f2f5c 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -18,7 +18,7 @@ export class Utils {
return { scale: 1, translateX: 1, translateY: 1 }
}
const rect = ele.getBoundingClientRect();
- const scale = ele.offsetWidth == 0 && rect.width == 0 ? 1 : rect.width / ele.offsetWidth;
+ const scale = ele.offsetWidth === 0 && rect.width === 0 ? 1 : rect.width / ele.offsetWidth;
const translateX = rect.left;
const translateY = rect.top;
@@ -86,4 +86,14 @@ export class Utils {
}
}
+export function returnTrue() {
+ return true;
+}
+
+export function returnFalse() {
+ return false;
+}
+
+export function emptyFunction() { }
+
export type Without<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; \ No newline at end of file