diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-04-19 17:06:56 -0400 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-04-19 17:06:56 -0400 |
commit | d77951f2f29b5b7b4869128116c3627d77e2c73b (patch) | |
tree | 81a0a02dc59af308ec322920a2060ac1b53d15f2 /src/Utils.ts | |
parent | be1976fb0ba33064978ee973993b3a2316cdf43c (diff) | |
parent | ecae4ae106be3e07471208cb93ec0965548d2d12 (diff) |
Merge commit 'ecae4ae' into new_search
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 15 |
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) { } |