mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -16,7 +16,7 @@ export function clone<T>(obj: T): T {
|
||||
return obj as any;
|
||||
}
|
||||
const result = (Array.isArray(obj)) ? <any>[] : <any>{};
|
||||
Object.keys(obj).forEach((key) => {
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (obj[key] && typeof obj[key] === 'object') {
|
||||
result[key] = clone(obj[key]);
|
||||
} else {
|
||||
@@ -31,7 +31,7 @@ export function deepClone<T>(obj: T): T {
|
||||
return obj;
|
||||
}
|
||||
const result = (Array.isArray(obj)) ? <any>[] : <any>{};
|
||||
Object.getOwnPropertyNames(obj).forEach((key) => {
|
||||
Object.getOwnPropertyNames(obj).forEach(key => {
|
||||
if (obj[key] && typeof obj[key] === 'object') {
|
||||
result[key] = deepClone(obj[key]);
|
||||
} else {
|
||||
@@ -93,7 +93,7 @@ export function mixin(destination: any, source: any, overwrite: boolean = true):
|
||||
}
|
||||
|
||||
if (isObject(source)) {
|
||||
Object.keys(source).forEach((key) => {
|
||||
Object.keys(source).forEach(key => {
|
||||
if (key in destination) {
|
||||
if (overwrite) {
|
||||
if (isObject(destination[key]) && isObject(source[key])) {
|
||||
@@ -111,7 +111,7 @@ export function mixin(destination: any, source: any, overwrite: boolean = true):
|
||||
}
|
||||
|
||||
export function assign(destination: any, ...sources: any[]): any {
|
||||
sources.forEach(source => Object.keys(source).forEach((key) => destination[key] = source[key]));
|
||||
sources.forEach(source => Object.keys(source).forEach(key => destination[key] = source[key]));
|
||||
return destination;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user