Back to Babel

@babel/helper-check-duplicate-nodes

packages/babel-helper-check-duplicate-nodes/README.md

7.29.5629 B
Original Source

@babel/helper-check-duplicate-nodes

Duplicated AST nodes often lead to obscure bugs. This module checks your AST and throws a helpful error if you include a duplicated node in your output. It's useful when authoring babel transforms.

This piece of code was originally written by @nicolo-ribaudo and is included in @babel/helper-transform-fixture-test-runnner.

API

js
import checkDuplicateNodes from "@babel/helper-check-duplicate-nodes";
checkDuplicateNodes(ast);