[babel 8] Add "exports" to every package (#14013)

This commit is contained in:
Nicolò Ribaudo
2021-12-29 16:29:10 +01:00
committed by GitHub
parent 2c68d03bf2
commit d1cabf6bc8
145 changed files with 1717 additions and 125 deletions

View File

@@ -1,6 +1,5 @@
import t from "@babel/types";
import virtualTypes from "../../lib/path/lib/virtual-types.js";
import definitions from "@babel/types/lib/definitions/index.js";
export default function generateValidators() {
let output = `/*
@@ -21,7 +20,7 @@ export interface NodePathValidators {
for (const type of Object.keys(virtualTypes)) {
const { types } = virtualTypes[type];
if (type[0] === "_") continue;
if (definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type]) {
if (t.NODE_FIELDS[type] || t.FLIPPED_ALIAS_KEYS[type]) {
output += `is${type}(opts?: object): this is NodePath<t.${type}>;`;
} else if (types /* in VirtualTypeAliases */) {
output += `is${type}(opts?: object): this is NodePath<VirtualTypeAliases["${type}"]>;`;