mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Move getSynthesizedDeepClone to services/utilities.ts
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user