aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-04-16 12:46:06 -0400
committerbob <bcz@cs.brown.edu>2019-04-16 12:46:06 -0400
commita4122573367ef36a9725e09b8447f3edfaa5c6a1 (patch)
tree76fec7e0f5f964efc0af0957681d63fde309e5cc /src/Utils.ts
parentc6360fb4aed348f6f6a3c7412b6acc0d1990c239 (diff)
parentfeae8f4d314ef389cc544fd3ad0792a6bb04832c (diff)
Merge branch 'master' into presentation_view
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index e07d4e82d..dec6245ef 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -87,10 +87,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) { }