packages/babel-types/src/clone/cloneDeepWithoutLoc.ts
raw| 1 | import cloneNode from "./cloneNode"; |
| 2 | import type * as t from ".."; |
| 3 | /** |
| 4 | * Create a deep clone of a `node` and all of it's child nodes |
| 5 | * including only properties belonging to the node. |
| 6 | * excluding `_private` and location properties. |
| 7 | */ |
| 8 | export default function cloneDeepWithoutLoc<T extends t.Node>(node: T): T { |
| 9 | return cloneNode(node, /* deep */ true, /* withoutLoc */ true); |
| 10 | } |