Add cloneDeepWithoutLoc (#10680)
* feat: add cloneDeepWithoutLoc * fix: sort functions alphabetically * doc: add documentation for the withoutLoc parameter * test: add a test for shallow cloneWithoutLoc * test: add loc object to node and fix test * fix: set loc object on deeper node * test: check loc on deeper node is null * doc: adjust withoutLoc documentation * fix: add withoutLoc param to deep clones * fix: apply cloneIfNodeOrArray for leadingComments, innerComments and trailingComments * test: add test for leadingComments, innerComments and trailingComments * Cleanup PR Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -135,7 +135,8 @@ lines.push(
|
||||
// clone/
|
||||
`declare function clone<T>(n: T): T;`,
|
||||
`declare function cloneDeep<T>(n: T): T;`,
|
||||
`declare function cloneNode<T>(n: T, deep?: boolean): T;`,
|
||||
`declare function cloneDeepWithoutLoc<T>(n: T): T;`,
|
||||
`declare function cloneNode<T>(n: T, deep?: boolean, withoutLoc?: boolean): T;`,
|
||||
`declare function cloneWithoutLoc<T>(n: T): T;`,
|
||||
|
||||
// comments/
|
||||
|
||||
@@ -154,7 +154,8 @@ lines.push(
|
||||
// clone/
|
||||
`export function clone<T extends Node>(n: T): T;`,
|
||||
`export function cloneDeep<T extends Node>(n: T): T;`,
|
||||
`export function cloneNode<T extends Node>(n: T, deep?: boolean): T;`,
|
||||
`export function cloneDeepWithoutLoc<T extends Node>(n: T): T;`,
|
||||
`export function cloneNode<T extends Node>(n: T, deep?: boolean, withoutLoc?: boolean): T;`,
|
||||
`export function cloneWithoutLoc<T extends Node>(n: T): T;`,
|
||||
|
||||
// comments/
|
||||
|
||||
Reference in New Issue
Block a user