diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-11 17:58:16 -0500 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-11 17:58:16 -0500 |
commit | dc51ee0dc771b3ac6ff6adc7c039df94935ef943 (patch) | |
tree | 9fd2c2abca48cf96ec6d2dc13f3236a1f14aee98 /src/server/session/utilities/utilities.ts | |
parent | 791499af4f474fe8ec7863ab9fe7b5b1120ac5ce (diff) |
switched out to npm
Diffstat (limited to 'src/server/session/utilities/utilities.ts')
-rw-r--r-- | src/server/session/utilities/utilities.ts | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/server/session/utilities/utilities.ts b/src/server/session/utilities/utilities.ts deleted file mode 100644 index ac8a6590a..000000000 --- a/src/server/session/utilities/utilities.ts +++ /dev/null @@ -1,31 +0,0 @@ -export namespace Utilities { - - /** - * At any arbitrary layer of nesting within the configuration objects, any single value that - * is not specified by the configuration is given the default counterpart. If, within an object, - * one peer is given by configuration and two are not, the one is preserved while the two are given - * the default value. - * @returns the composition of all of the assigned objects, much like Object.assign(), but with more - * granularity in the overwriting of nested objects - */ - export function preciseAssign(target: any, ...sources: any[]): any { - for (const source of sources) { - preciseAssignHelper(target, source); - } - return target; - } - - export function preciseAssignHelper(target: any, source: any) { - Array.from(new Set([...Object.keys(target), ...Object.keys(source)])).map(property => { - let targetValue: any, sourceValue: any; - if (sourceValue = source[property]) { - if (typeof sourceValue === "object" && typeof (targetValue = target[property]) === "object") { - preciseAssignHelper(targetValue, sourceValue); - } else { - target[property] = sourceValue; - } - } - }); - } - -}
\ No newline at end of file |