aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/utils/Extensions.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-21 21:36:52 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-21 21:36:52 -0400
commitce4e7a03e82c71bd5c979b19308f4dba03be08a2 (patch)
tree3f1eb320790bd66cc128c8899c5ee9ed170d3382 /src/client/northstar/utils/Extensions.ts
parent27299e9666ec0aae6a4d1335fd30b2714ad67970 (diff)
parent1cf618563838f4ce7d8a98c8a0c8d94670bc4e18 (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into promises_and_user_document
Diffstat (limited to 'src/client/northstar/utils/Extensions.ts')
-rw-r--r--src/client/northstar/utils/Extensions.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/northstar/utils/Extensions.ts b/src/client/northstar/utils/Extensions.ts
new file mode 100644
index 000000000..71bcadf89
--- /dev/null
+++ b/src/client/northstar/utils/Extensions.ts
@@ -0,0 +1,20 @@
+interface String {
+ ReplaceAll(toReplace: string, replacement: string): string;
+}
+
+String.prototype.ReplaceAll = function (toReplace: string, replacement: string): string {
+ var target = this;
+ return target.split(toReplace).join(replacement);
+}
+
+interface Math {
+ log10(val: number): number;
+}
+
+Math.log10 = function (val: number): number {
+ return Math.log(val) / Math.LN10;
+}
+
+declare interface ObjectConstructor {
+ assign(...objects: Object[]): Object;
+}