Move getSynthesizedDeepClone to services/utilities.ts

This commit is contained in:
Andrew Casey
2017-10-10 13:01:06 -07:00
parent 5c9f8c56d9
commit 9ece0cc956
2 changed files with 12 additions and 10 deletions

View File

@@ -71,16 +71,6 @@ namespace ts {
return clone;
}
/**
* Creates a deep, memberwise clone of a node with no source map location.
*/
/* @internal */
export function getSynthesizedDeepClone<T extends Node>(node: T | undefined): T | undefined {
return node
? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext))
: undefined;
}
// Literals
export function createLiteral(value: string): StringLiteral;

View File

@@ -1334,4 +1334,16 @@ namespace ts {
}
return position;
}
/**
* Creates a deep, memberwise clone of a node with no source map location.
*
* WARNING: This is an expensive operation and is only intended to be used in refactorings
* and code fixes (because those are triggered by explicit user actions).
*/
export function getSynthesizedDeepClone<T extends Node>(node: T | undefined): T | undefined {
return node
? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext))
: undefined;
}
}