This commit is contained in:
Johannes Rieken 2019-07-02 15:33:43 +02:00
parent 8508bb8b77
commit ab5b94db34
2 changed files with 6 additions and 6 deletions

View file

@ -14,11 +14,11 @@ export function deepClone<T>(obj: T): T {
return obj as any; return obj as any;
} }
const result: any = Array.isArray(obj) ? [] : {}; const result: any = Array.isArray(obj) ? [] : {};
Object.keys(obj as any).forEach((key: string) => { Object.keys(<any>obj).forEach((key: string) => {
if (obj[key] && typeof obj[key] === 'object') { if ((<any>obj)[key] && typeof (<any>obj)[key] === 'object') {
result[key] = deepClone(obj[key]); result[key] = deepClone((<any>obj)[key]);
} else { } else {
result[key] = obj[key]; result[key] = (<any>obj)[key];
} }
}); });
return result; return result;

View file

@ -14,7 +14,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces'; import { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';
export const KnownSnippetVariableNames = Object.freeze({ export const KnownSnippetVariableNames: { [key: string]: true } = Object.freeze({
'CURRENT_YEAR': true, 'CURRENT_YEAR': true,
'CURRENT_YEAR_SHORT': true, 'CURRENT_YEAR_SHORT': true,
'CURRENT_MONTH': true, 'CURRENT_MONTH': true,
@ -275,4 +275,4 @@ export class WorkspaceBasedVariableResolver implements VariableResolver {
} }
return filename; return filename;
} }
} }