aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/utils/Extensions.ts
diff options
context:
space:
mode:
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;
+}