aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index e07d4e82d..8252ba011 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -1,11 +1,13 @@
import v4 = require('uuid/v4');
import v5 = require("uuid/v5");
import { Socket } from 'socket.io';
-import { Message, Types, Transferable } from './server/Message';
+import { Message } from './server/Message';
import { Document } from './fields/Document';
export class Utils {
+ public static DRAG_THRESHOLD = 4;
+
public static GenerateGuid(): string {
return v4();
}
@@ -87,10 +89,25 @@ export class Utils {
}
}
+export function OmitKeys(obj: any, keys: any, addKeyFunc?: (dup: any) => void) {
+ var dup: any = {};
+ for (var key in obj) {
+ if (keys.indexOf(key) === -1) {
+ dup[key] = obj[key];
+ }
+ }
+ addKeyFunc && addKeyFunc(dup);
+ return dup;
+}
+
export function returnTrue() { return true; }
export function returnFalse() { return false; }
+export function returnOne() { return 1; }
+
+export function returnZero() { return 0; }
+
export function emptyFunction() { }
export function emptyDocFunction(doc: Document) { }