packages/babel-types/src/clone/clone.ts
raw| 1 | import cloneNode from "./cloneNode"; |
| 2 | import type * as t from ".."; |
| 3 | |
| 4 | /** |
| 5 | * Create a shallow clone of a `node`, including only |
| 6 | * properties belonging to the node. |
| 7 | * @deprecated Use t.cloneNode instead. |
| 8 | */ |
| 9 | export default function clone<T extends t.Node>(node: T): T { |
| 10 | return cloneNode(node, /* deep */ false); |
| 11 | } |