Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
485 bytes
|
Line | |
---|
1 | import t from "@babel/types";
|
---|
2 |
|
---|
3 | export default function generateAsserts() {
|
---|
4 | let output = `/*
|
---|
5 | * This file is auto-generated! Do not modify it directly.
|
---|
6 | * To re-generate run 'make build'
|
---|
7 | */
|
---|
8 | import * as t from "@babel/types";
|
---|
9 | import NodePath from "../index";
|
---|
10 |
|
---|
11 |
|
---|
12 | export interface NodePathAssetions {`;
|
---|
13 |
|
---|
14 | for (const type of [...t.TYPES].sort()) {
|
---|
15 | output += `
|
---|
16 | assert${type}(
|
---|
17 | opts?: object,
|
---|
18 | ): asserts this is NodePath<t.${type}>;`;
|
---|
19 | }
|
---|
20 |
|
---|
21 | output += `
|
---|
22 | }`;
|
---|
23 |
|
---|
24 | return output;
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.