| 1 |
import { COMMENT_KEYS } from "../constants"; |
| 2 |
import type * as t from ".."; |
| 3 |
|
| 4 |
/** |
| 5 |
* Remove comment properties from a node. |
| 6 |
*/ |
| 7 |
export default function removeComments<T extends t.Node>(node: T): T { |
| 8 |
COMMENT_KEYS.forEach(key => { |
| 9 |
node[key] = null; |
| 10 |
}); |
| 11 |
|
| 12 |
return node; |
| 13 |
} |