( obj: t.Node | undefined | null | (t.Node | undefined | null)[], deep: boolean, withoutLoc: boolean, commentsCache: CommentCache, )
| 20 | } |
| 21 | |
| 22 | function cloneIfNodeOrArray( |
| 23 | obj: t.Node | undefined | null | (t.Node | undefined | null)[], |
| 24 | deep: boolean, |
| 25 | withoutLoc: boolean, |
| 26 | commentsCache: CommentCache, |
| 27 | ) { |
| 28 | if (Array.isArray(obj)) { |
| 29 | return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache)); |
| 30 | } |
| 31 | return cloneIfNode(obj, deep, withoutLoc, commentsCache); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Create a clone of a `node` including only properties belonging to the node. |
no test coverage detected