diff options
author | bob <bcz@cs.brown.edu> | 2019-03-20 18:00:39 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-03-20 18:00:39 -0400 |
commit | a16e6592caafb601b59c3d9f7609e8c1af231eba (patch) | |
tree | e732e34c5a9fc371bf328fdd35a08ddd196bf6af /src/client/northstar/utils/Extensions.ts | |
parent | 208a57b15e6b415659311873431dbe9d5b8d8021 (diff) |
initial
Diffstat (limited to 'src/client/northstar/utils/Extensions.ts')
-rw-r--r-- | src/client/northstar/utils/Extensions.ts | 20 |
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; +} |