repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-parameters/test/fixtures/parameters/generator/input.ts
packages/babel-plugin-transform-parameters/test/fixtures/parameters/generator/input.ts
function* fn(a, [], b = 2) { yield a; yield arguments; yield this; return b; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-ts-this-parameter/input.ts
packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-ts-this-parameter/input.ts
function u(this: Foo, ...items) { items[0]; } function v(this: Foo, event: string, ...args: any[]) { args; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-parameters/test/fixtures/parameters/preserve-types/input.ts
packages/babel-plugin-transform-parameters/test/fixtures/parameters/preserve-types/input.ts
type Point = { x: number; y: number; }; function value({ x, y }: Point) { return x * y; } function valueWithDefault({ x, y }: Point = {}) { return x * y; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/builder.ts
packages/babel-template/src/builder.ts
import { merge, validate } from "./options.ts"; import type { TemplateOpts, PublicOpts, PublicReplacements, } from "./options.ts"; import type { Formatter } from "./formatters.ts"; import stringTemplate from "./string.ts"; import literalTemplate from "./literal.ts"; export type TemplateBuilder<T> = { // Build...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/parse.ts
packages/babel-template/src/parse.ts
import { isCallExpression, isExpressionStatement, isFunction, isIdentifier, isJSXIdentifier, isNewExpression, isPlaceholder, isStatement, isStringLiteral, removePropertiesDeep, traverse, } from "@babel/types"; import type * as t from "@babel/types"; import type { TraversalAncestors } from "@babel/...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/options.ts
packages/babel-template/src/options.ts
import type { ParserOptions as ParserOpts } from "@babel/parser"; export type { ParserOpts }; /** * These are the options that 'babel-template' actually accepts and typechecks * when called. All other options are passed through to the parser. */ export type PublicOpts = { /** * A set of placeholder names to a...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/string.ts
packages/babel-template/src/string.ts
import type { Formatter } from "./formatters.ts"; import type { TemplateOpts } from "./options.ts"; import type { Metadata } from "./parse.ts"; import { normalizeReplacements } from "./options.ts"; import parseAndBuildMetadata from "./parse.ts"; import populatePlaceholders from "./populate.ts"; export default function...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/populate.ts
packages/babel-template/src/populate.ts
import { blockStatement, cloneNode, emptyStatement, expressionStatement, identifier, isStatement, isStringLiteral, stringLiteral, validate, } from "@babel/types"; import type * as t from "@babel/types"; import type { TemplateReplacements } from "./options.ts"; import type { Metadata, Placeholder } fr...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/index.ts
packages/babel-template/src/index.ts
import * as formatters from "./formatters.ts"; import createTemplateBuilder from "./builder.ts"; export const smart = createTemplateBuilder(formatters.smart); export const statement = createTemplateBuilder(formatters.statement); export const statements = createTemplateBuilder(formatters.statements); export const expre...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/formatters.ts
packages/babel-template/src/formatters.ts
import { assertExpressionStatement } from "@babel/types"; import type * as t from "@babel/types"; export type Formatter<T> = { code: (source: string) => string; validate: (ast: t.File) => void; unwrap: (ast: t.File) => T; }; function makeStatementFormatter<T>( fn: (statements: t.Statement[]) => T, ): Formatte...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-template/src/literal.ts
packages/babel-template/src/literal.ts
import type { Formatter } from "./formatters.ts"; import type { TemplateReplacements, TemplateOpts } from "./options.ts"; import { normalizeReplacements } from "./options.ts"; import parseAndBuildMetadata from "./parse.ts"; import populatePlaceholders from "./populate.ts"; export default function literalTemplate<T>( ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-react-display-name/src/index.ts
packages/babel-plugin-transform-react-display-name/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import path from "node:path"; import { types as t } from "@babel/core"; type ReactCreateClassCall = t.CallExpression & { arguments: [t.ObjectExpression]; }; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); function addDisplayName(id: ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-check-duplicate-nodes/src/index.ts
packages/babel-helper-check-duplicate-nodes/src/index.ts
import { VISITOR_KEYS } from "@babel/types"; import type * as t from "@babel/types"; type StackItem = { node: t.Node; parent: t.Node | null; }; export default function checkDuplicateNodes(ast: t.Node) { if (arguments.length !== 1) { throw new Error("checkDuplicateNodes accepts only one argument: ast"); } ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-annotate-as-pure/src/index.ts
packages/babel-helper-annotate-as-pure/src/index.ts
import { addComment, type Node } from "@babel/types"; const PURE_ANNOTATION = "#__PURE__"; const isPureAnnotated = ({ leadingComments }: Node): boolean => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value)); export default function annotateAsPure( pathOrNode: Node | { node:...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-instanceof/src/index.ts
packages/babel-plugin-transform-instanceof/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); return { name: "transform-instanceof", visitor: { BinaryExpression(path) { const { node } = path; if (node.operator...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-flow-strip-types/src/index.ts
packages/babel-plugin-transform-flow-strip-types/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import syntaxFlow from "@babel/plugin-syntax-flow"; import { types as t, type NodePath } from "@babel/core"; export interface Options { requireDirective?: boolean; allowDeclareFields?: boolean; } export default declare((api, opts: Options) => { api.assertVer...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-syntax-throw-expressions/src/index.ts
packages/babel-plugin-syntax-throw-expressions/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; export default declare(api => { api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0-0")); return { name: "syntax-throw-expressions", manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("throwExpressions"); }, }; });
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-json-strings/src/index.ts
packages/babel-plugin-transform-json-strings/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import type { NodePath, types as t } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0-0")); const regex = /(\\*)([\u2028\u2029])/g; function replace(match: string, escapes: string, separator: string) {...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-modules-amd/src/index.ts
packages/babel-plugin-transform-modules-amd/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { buildDynamicImport, isModule, rewriteModuleStatementsAndPrepareHeader, type RewriteModuleStatementsAndPrepareHeaderOptions, hasExports, isSideEffectImport, buildNamespaceInitStatements, ensureStatementsHoisted, wrapInterop, getModuleName...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-named-capturing-groups-regex/src/index.ts
packages/babel-plugin-transform-named-capturing-groups-regex/src/index.ts
/* eslint-disable @babel/development/plugin-name */ import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin"; import { declare } from "@babel/helper-plugin-utils"; export interface Options { runtime?: boolean; } export default declare((api, options: Options) => { const { runtime } =...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-sticky-regex/src/index.ts
packages/babel-plugin-transform-sticky-regex/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); return { name: "transform-sticky-regex", visitor: { RegExpLiteral(path) { const { node } = path; if (!node.flags.in...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-syntax-function-sent/src/index.ts
packages/babel-plugin-syntax-function-sent/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; export default declare(api => { api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0-0")); return { name: "syntax-function-sent", manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("functionSent"); }, }; });
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-proposal-async-do-expressions/src/index.ts
packages/babel-plugin-proposal-async-do-expressions/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; export default declare(({ types: t, assertVersion }) => { assertVersion(REQUIRED_VERSION("^7.13.0")); return { name: "proposal-async-do-expressions", manipulateOptions: (_, parser) => parser.plugins.push("asyncDoExpressions", "doExpressions"), ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-plugin-utils/src/index.ts
packages/babel-helper-plugin-utils/src/index.ts
import type { PluginAPI, PluginObject, PluginPass, PresetAPI, PresetObject, } from "@babel/core"; type APIPolyfillFactory<T extends keyof PluginAPI> = ( api: PluginAPI, ) => PluginAPI[T]; type APIPolyfills = { assertVersion: APIPolyfillFactory<"assertVersion">; }; const apiPolyfills: APIPolyfills = { ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-react-constant-elements/src/index.ts
packages/babel-plugin-transform-react-constant-elements/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t, template } from "@babel/core"; import type { Visitor, Scope, NodePath } from "@babel/core"; export interface Options { allowMutablePropsOnTags?: null | string[]; } interface VisitorState { isImmutable: boolean; mutablePropsAllowed: boole...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-template-literals/src/index.ts
packages/babel-plugin-transform-template-literals/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { template, types as t, type NodePath } from "@babel/core"; export interface Options { loose?: boolean; } export default declare((api, options: Options) => { api.assertVersion(REQUIRED_VERSION(7)); const ignoreToPrimitiveHint = api.assumption("ig...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-template-literals/test/fixtures/default/ts-literal-type/input.ts
packages/babel-plugin-transform-template-literals/test/fixtures/default/ts-literal-type/input.ts
type World = "world"; type Greeting = `hello ${World}`;
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-async-generator-functions/src/for-await.ts
packages/babel-plugin-transform-async-generator-functions/src/for-await.ts
import { types as t, template, type NodePath } from "@babel/core"; const buildForAwait = template(` async function wrapper() { var ITERATOR_ABRUPT_COMPLETION = false; var ITERATOR_HAD_ERROR_KEY = false; var ITERATOR_ERROR_KEY; try { for ( var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KE...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-async-generator-functions/src/index.ts
packages/babel-plugin-transform-async-generator-functions/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import remapAsyncToGenerator from "@babel/helper-remap-async-to-generator"; import type { NodePath, Visitor, PluginPass } from "@babel/core"; import { types as t } from "@babel/core"; import { visitors } from "@babel/traverse"; import rewriteForAwait from "./for-awa...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-jscript/src/index.ts
packages/babel-plugin-transform-jscript/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); return { name: "transform-jscript", visitor: { FunctionExpression: { exit(path) { const { node } = path; ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-duplicate-keys/src/index.ts
packages/babel-plugin-transform-duplicate-keys/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; function getName( key: t.Identifier | t.StringLiteral | t.NumericLiteral | t.BigIntLiteral, ) { if (t.isIdentifier(key)) { return key.name; } return key.value.toString(); } export default declare(api => { api...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-syntax-import-defer/src/index.ts
packages/babel-plugin-syntax-import-defer/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; export default declare(api => { api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0-0")); return { name: "syntax-import-defer", manipulateOptions(_, parserOpts) { parserOpts.plugins.push("deferredImportEvaluation"); }, }; });
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-preset-flow/src/normalize-options.ts
packages/babel-preset-flow/src/normalize-options.ts
import { OptionValidator } from "@babel/helper-validator-option"; const v = new OptionValidator("@babel/preset-flow"); export default function normalizeOptions(options: any = {}) { let { all, ignoreExtensions, experimental_useHermesParser } = options; v.invariant( !("allowDeclareFields" in options), `Sinc...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-preset-flow/src/index.ts
packages/babel-preset-flow/src/index.ts
import { declarePreset } from "@babel/helper-plugin-utils"; import transformFlowStripTypes from "@babel/plugin-transform-flow-strip-types"; import normalizeOptions from "./normalize-options.ts"; export default declarePreset((api, opts) => { api.assertVersion(REQUIRED_VERSION(7)); const { all, ignoreExtensi...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-preset-flow/test/fixtures/ignoreExtensions/true/input.ts
packages/babel-preset-flow/test/fixtures/ignoreExtensions/true/input.ts
type A = string;
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-preset-flow/test/fixtures/ignoreExtensions/false/input.ts
packages/babel-preset-flow/test/fixtures/ignoreExtensions/false/input.ts
// The TS plugin is not enabled, so this will throw because // the Flow preset will not enable Flow support in TS files. type A = string;
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-syntax-pipeline-operator/src/index.ts
packages/babel-plugin-syntax-pipeline-operator/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; const PIPELINE_PROPOSALS = ["fsharp", "hack"] as const; const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"] as const; const documentationURL = "https://babeljs.io/docs/en/babel-plugin-proposal-pipeline-operator"; export interface Options { proposal: (typeof PIPEL...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/printer.ts
packages/babel-generator/src/printer.ts
import Buffer, { type Pos } from "./buffer.ts"; import type { Loc } from "./buffer.ts"; import * as n from "./node/index.ts"; import type * as t from "@babel/types"; import { isExpression, isFunction, isStatement, isClassBody, isTSInterfaceBody, isTSEnumMember, } from "@babel/types"; import type { Opts as j...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
true
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/token-map.ts
packages/babel-generator/src/token-map.ts
import type * as t from "@babel/types"; import type { Token } from "@babel/parser"; import { traverseFast, VISITOR_KEYS } from "@babel/types"; export class TokenMap { _tokens: Token[]; _source: string; _nodesToTokenIndexes = new Map<t.Node, number[]>(); _nodesOccurrencesCountCache = new Map< t.Node, ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/index.ts
packages/babel-generator/src/index.ts
import SourceMap from "./source-map.ts"; import Printer from "./printer.ts"; import type * as t from "@babel/types"; import type { Opts as jsescOptions } from "jsesc"; import type { Format } from "./printer.ts"; import type { EncodedSourceMap, DecodedSourceMap, Mapping, } from "@jridgewell/gen-mapping"; /** * N...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/source-map.ts
packages/babel-generator/src/source-map.ts
import { GenMapping, maybeAddMapping, setSourceContent, allMappings, toEncodedMap, toDecodedMap, } from "@jridgewell/gen-mapping"; import type { EncodedSourceMap, DecodedSourceMap, Mapping, } from "@jridgewell/gen-mapping"; import type { InvalidOriginalMapping, OriginalMapping, SourceMapInput,...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/buffer.ts
packages/babel-generator/src/buffer.ts
import type SourceMap from "./source-map.ts"; // We inline this package // eslint-disable-next-line import/no-extraneous-dependencies import * as charcodes from "charcodes"; export type Pos = { line: number; column: number; index: number; }; export type Loc = { start?: Pos; end?: Pos; filename?: string; }...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/node/parentheses.ts
packages/babel-generator/src/node/parentheses.ts
import { isArrayTypeAnnotation, isBinaryExpression, isCallExpression, isForOfStatement, isIndexedAccessType, isMemberExpression, isObjectPattern, isOptionalMemberExpression, isYieldExpression, isStatement, } from "@babel/types"; import type * as t from "@babel/types"; import { TokenContext } from "...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/node/whitespace.ts
packages/babel-generator/src/node/whitespace.ts
import { FLIPPED_ALIAS_KEYS, isArrayExpression, isAssignmentExpression, isBinary, isBlockStatement, isCallExpression, isFunction, isIdentifier, isLiteral, isMemberExpression, isObjectExpression, isOptionalCallExpression, isOptionalMemberExpression, isStringLiteral, } from "@babel/types"; //...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/node/index.ts
packages/babel-generator/src/node/index.ts
import * as whitespace from "./whitespace.ts"; import * as parens from "./parentheses.ts"; import { FLIPPED_ALIAS_KEYS, VISITOR_KEYS, isCallExpression, isDecorator, isExpressionStatement, isMemberExpression, isNewExpression, isParenthesizedExpression, } from "@babel/types"; import type * as t from "@bab...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/jsx.ts
packages/babel-generator/src/generators/jsx.ts
import type Printer from "../printer.ts"; import type * as t from "@babel/types"; export function JSXAttribute(this: Printer, node: t.JSXAttribute) { this.print(node.name); if (node.value) { this.token("="); this.print(node.value); } } export function JSXIdentifier(this: Printer, node: t.JSXIdentifier) ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/expressions.ts
packages/babel-generator/src/generators/expressions.ts
import type Printer from "../printer.ts"; import { isCallExpression, isLiteral, isMemberExpression, isNewExpression, isPattern, } from "@babel/types"; import type * as t from "@babel/types"; import { TokenContext } from "../node/index.ts"; export function UnaryExpression(this: Printer, node: t.UnaryExpressio...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/modules.ts
packages/babel-generator/src/generators/modules.ts
import type Printer from "../printer.ts"; import { isClassDeclaration, isExportDefaultSpecifier, isExportNamespaceSpecifier, isImportDefaultSpecifier, isImportNamespaceSpecifier, isStatement, } from "@babel/types"; import type * as t from "@babel/types"; import { TokenContext } from "../node/index.ts"; exp...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/typescript.ts
packages/babel-generator/src/generators/typescript.ts
import type Printer from "../printer.ts"; import type * as t from "@babel/types"; export function TSTypeAnnotation( this: Printer, node: t.TSTypeAnnotation, parent: t.Node, ) { // TODO(@nicolo-ribaudo): investigate not including => in the range // of the return type of an arrow function type this.token( ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/base.ts
packages/babel-generator/src/generators/base.ts
import type Printer from "../printer.ts"; import type * as t from "@babel/types"; export function File(this: Printer, node: t.File) { if (node.program) { // Print this here to ensure that Program node 'leadingComments' still // get printed after the hashbang. this.print(node.program.interpreter); } ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/statements.ts
packages/babel-generator/src/generators/statements.ts
import type Printer from "../printer.ts"; import { isFor, isForStatement, isIfStatement, isStatement, isVoidPattern, } from "@babel/types"; import type * as t from "@babel/types"; // We inline this package // eslint-disable-next-line import/no-extraneous-dependencies import * as charCodes from "charcodes"; ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/classes.ts
packages/babel-generator/src/generators/classes.ts
import type Printer from "../printer.ts"; import { isExportDefaultDeclaration, isExportNamedDeclaration, } from "@babel/types"; import type * as t from "@babel/types"; // We inline this package // eslint-disable-next-line import/no-extraneous-dependencies import * as charCodes from "charcodes"; export function Cl...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/methods.ts
packages/babel-generator/src/generators/methods.ts
import type Printer from "../printer.ts"; import type * as t from "@babel/types"; import { isIdentifier, type ParentMaps } from "@babel/types"; import { TokenContext } from "../node/index.ts"; type ParentsOf<T extends t.Node> = ParentMaps[T["type"]]; export function _params( this: Printer, node: t.Function | t.TS...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/template-literals.ts
packages/babel-generator/src/generators/template-literals.ts
import type Printer from "../printer.ts"; import type * as t from "@babel/types"; export function TaggedTemplateExpression( this: Printer, node: t.TaggedTemplateExpression, ) { this.print(node.tag); this.print(node.typeArguments); this.print(node.quasi); } export function TemplateElement(this: Printer) { ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/flow.ts
packages/babel-generator/src/generators/flow.ts
import type Printer from "../printer.ts"; import { isDeclareExportDeclaration, isStatement } from "@babel/types"; import type * as t from "@babel/types"; import { ExportAllDeclaration } from "./modules.ts"; import { TokenContext } from "../node/index.ts"; export function AnyTypeAnnotation(this: Printer) { this.word(...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/types.ts
packages/babel-generator/src/generators/types.ts
import type Printer from "../printer.ts"; import { isAssignmentPattern, isIdentifier } from "@babel/types"; import type * as t from "@babel/types"; import jsesc from "jsesc"; let lastRawIdentNode: t.Identifier | null = null; let lastRawIdentResult: string = ""; export function _getRawIdentifier(this: Printer, node: t....
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/src/generators/index.ts
packages/babel-generator/src/generators/index.ts
export * from "./template-literals.ts"; export * from "./expressions.ts"; export * from "./statements.ts"; export * from "./classes.ts"; export * from "./methods.ts"; export * from "./modules.ts"; export * from "./types.ts"; export * from "./flow.ts"; export * from "./base.ts"; export * from "./jsx.ts"; export * from "...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/regression/ts-infer-keyword-compact-mode/input.ts
packages/babel-generator/test/fixtures/regression/ts-infer-keyword-compact-mode/input.ts
type T = A extends infer B ? C : D;
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/flow/import-typeof/input.ts
packages/babel-generator/test/fixtures/flow/import-typeof/input.ts
import typeof U from "x"
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-function-type/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-function-type/input.ts
// These parentheses should be kept type t = b | (() => c); type t2 = b & (() => c); type t3 = (() => a) extends b ? c : d; type t4 = a extends (() => b) ? c : d; type t5 = a extends b ? () => c : d; type t6 = a extends b ? c : () => d; type t7 = (() => a)[]; type t8 = (() => a)["name"]; type t9 = (a|b)["name"]; type ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-intersection-type/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-intersection-type/input.ts
// These parentheses should be kept type t0 = (string & string)[]; type t1 = (string & string)['valueOf']; type t2 = [(string & string)?]; type t3 = keyof (t0 & t1); // These parentheses should be stripped type s0 = number | (string & string); type s1 = Object[('valueOf' & 'valueOf')] type s2 = [...(s0[] & s1[])]
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-union-type/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-union-type/input.ts
// These parentheses should be kept type t0 = (string | boolean)[]; type t1 = (string | boolean)['valueOf']; type t2 = [(string | boolean)?]; type t3 = (string & (boolean | boolean)) type t4 = keyof (t0 | t1); // These parentheses should be stripped type s0 = number | (string | boolean); type s1 = Object[('valueOf' | ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-infer-type/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-infer-type/input.ts
// These parentheses should be kept type t0<T> = T extends Array<(infer K)[]> ? K : never; type t1<T> = T extends Array<(infer K)['valueOf']> ? K : never; type t2<T> = T extends Array<[(infer K)?]> ? K : never; type t3<T> = T extends Array<(infer K extends string) | boolean> ? K : never; type t4<T> = T extends Array<(...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-conditional-type/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-conditional-type/input.ts
// These parentheses should be kept type t0<T> = (T extends string[] ? T : never)[] type t1<T> = (T extends string[] ? T : never)[0] type t2<T> = [(T extends string[] ? T : never)?] type t3<T> = (T extends string[] ? T : never) | boolean; type t4<T> = (T extends string[] ? T : never) & boolean; type t5<T> = keyof (T ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-constructor-type/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-constructor-type/input.ts
// These parentheses should be kept type t0 = b | (new () => number) type t1 = b & (new () => number) type t2 = (new () => number) extends a ? b : c type t3 = a extends (new () => number) ? b : c type t4 = (new () => number)[] type t5 = (new () => number)["name"] function foo2(...args: [number, (new () => number)?, .....
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/parentheses/ts-type-operator/input.ts
packages/babel-generator/test/fixtures/parentheses/ts-type-operator/input.ts
// These parentheses should be kept type t0<T> = (keyof T)[]; type t1<T> = (keyof T)['valueOf']; type t2<T> = [(keyof T)?]; // These parentheses should be stripped type s0<T> = [...(keyof T)]; type s1<T> = (keyof T) & string; type s2<T> = (keyof T) | string;
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/preserveFormat-edgecases/ts-interface-mixed-delimiters/input.ts
packages/babel-generator/test/fixtures/preserveFormat-edgecases/ts-interface-mixed-delimiters/input.ts
interface Mixed { x: string, y: number; z: boolean }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/preserveFormat-edgecases/ts-parameter-initialization/input.tsx
packages/babel-generator/test/fixtures/preserveFormat-edgecases/ts-parameter-initialization/input.tsx
const res = await request<BaseResponse<{ resultData: { code: number; output: unknown } }>>({ url: 'abc', method: 'post' })
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/abstract-override/input.ts
packages/babel-generator/test/fixtures/typescript/abstract-override/input.ts
abstract class Foo extends FooBase { abstract override bar(): any; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/satisfies-parentheses/input.ts
packages/babel-generator/test/fixtures/typescript/satisfies-parentheses/input.ts
// These do not normally need parens { (a + b // c ) satisfies x; (a + b ) satisfies x; } { (b ** (c ** d // c )) satisfies x; (b ** (c ** d )) satisfies x; } { (a + (b ** c // c )) satisfies x; (a + (b ** c )) satisfies x; } // These need parens anyway { (a + (b + c // c )) satisfies x; ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/export-type-star-from/input.ts
packages/babel-generator/test/fixtures/typescript/export-type-star-from/input.ts
export type * from './mod'; export type * as ns from './mod'; // Note: TSC doesn't support string module specifiers yet, // but it's easier for us to support them than not. export type * as "ns2" from './mod';
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/types-parameter-const-modifier/input.ts
packages/babel-generator/test/fixtures/typescript/types-parameter-const-modifier/input.ts
class C0<const T>{ p: () => T } class C1<const in T>{ p: (x: T) => void } class C2<const out T>{ p: () => T } class C3<const in out T>{ p: (x: T) => T }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx
packages/babel-generator/test/fixtures/typescript/variance-annotations-with-jsx/input.tsx
// valid JSX <in T>() => {}</in>; type Covariant<out T> = { x: T; } declare let super_covariant: Covariant<unknown>; declare let sub_covariant: Covariant<string>; super_covariant = sub_covariant; sub_covariant = super_covariant; // Error type Contravariant<in T> = { f: (x: T) => void; } declare let super_...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/instantiation-expression/input.ts
packages/babel-generator/test/fixtures/typescript/instantiation-expression/input.ts
a<b>; (a<b>)<c>; (a<b>)<c>(); (a<b>)<c>?.(); (a?.b<c>)<d>(); new (a<b>)<c>();
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/function-param-annotated-default-and-destructuring/input.ts
packages/babel-generator/test/fixtures/typescript/function-param-annotated-default-and-destructuring/input.ts
function f({ a }?: type = val) {}
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/import-type-empty-object/input.ts
packages/babel-generator/test/fixtures/typescript/import-type-empty-object/input.ts
import type {} from 'some-module'; export type {} from "some-module"
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/satisfies-parentheses-createParenthesizedExpression/input.ts
packages/babel-generator/test/fixtures/typescript/satisfies-parentheses-createParenthesizedExpression/input.ts
// These do not normally need parens { (a + b // c ) satisfies x; (a + b ) satisfies x; } { (b ** (c ** d // c )) satisfies x; (b ** (c ** d )) satisfies x; } { (a + (b ** c // c )) satisfies x; (a + (b ** c )) satisfies x; } // These need parens anyway { (a + (b + c // c )) satisfies x; ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/infer-with-constraints/input.ts
packages/babel-generator/test/fixtures/typescript/infer-with-constraints/input.ts
type X3<T> = T extends [infer U extends number] ? MustBeNumber<U> : never; type X4<T> = T extends [infer U extends number, infer U extends number] ? MustBeNumber<U> : never; type X5<T> = T extends [infer U extends number, infer U] ? MustBeNumber<U> : never; type X6<T> = T extends [infer U, infer U extends number] ? Mus...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/typescript/mapped-type/input.ts
packages/babel-generator/test/fixtures/typescript/mapped-type/input.ts
type Bar = { [key in Foo] }; type Foo2 = { [key in Bar]? }; type Foo3 = { [key in keyof Bar]-? }; type Foo4 = { [key in keyof Bar]+? };
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/input.ts
packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/input.ts
// From packages\babel-generator\src\printer.ts import Buffer from "./buffer"; import type { Loc } from "./buffer"; import * as n from "./node"; import type * as t from "@babel/types"; import type { RecordAndTuplePluginOptions, PipelineOperatorPluginOptions, } from "@babel/parser"; import type { Opts as jsescOptio...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/sourcemaps/ts-class-properties-with-retainlines/input.ts
packages/babel-generator/test/fixtures/sourcemaps/ts-class-properties-with-retainlines/input.ts
class ClassName { a: { a1: number; a2: number; }; b: { b1: number; b2: number; }; c( a: number, b: number, c: number, d: { d1: number; d2: number; d3: number; } ): { a: number; b: number; c: number; d: { d1: number; d2: number...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file1/input.ts
packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file1/input.ts
// From packages\babel-cli\src\babel\watcher.ts import { createRequire } from "module"; import path from "path"; import type { WatchOptions, FSWatcher } from "chokidar"; const fileToDeps = new Map<string, Set<string>>(); const depToFiles = new Map<string, Set<string>>(); let isWatchMode = false; let watcher: FSWatch...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts
packages/babel-plugin-transform-react-jsx/src/create-plugin.ts
import jsx from "@babel/plugin-syntax-jsx"; import { declare } from "@babel/helper-plugin-utils"; import { template, types as t } from "@babel/core"; import type { PluginPass, NodePath } from "@babel/core"; import { addNamed, addNamespace, isModule } from "@babel/helper-module-imports"; import annotateAsPure from "@bab...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-react-jsx/src/development.ts
packages/babel-plugin-transform-react-jsx/src/development.ts
import createPlugin from "./create-plugin.ts"; export default createPlugin({ name: "transform-react-jsx/development", development: true, });
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-react-jsx/src/index.ts
packages/babel-plugin-transform-react-jsx/src/index.ts
/* eslint-disable @babel/development/plugin-name */ import createPlugin from "./create-plugin.ts"; export default createPlugin({ name: "transform-react-jsx", development: false, }); export type { Options } from "./create-plugin.ts";
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-unicode-sets-regex/src/index.ts
packages/babel-plugin-transform-unicode-sets-regex/src/index.ts
/* eslint-disable @babel/development/plugin-name */ import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin"; import { declare } from "@babel/helper-plugin-utils"; export default declare(api => { api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0-0")); return createRegExpFeature...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-plugin-test-runner/src/index.ts
packages/babel-helper-plugin-test-runner/src/index.ts
import testRunner from "@babel/helper-transform-fixture-test-runner"; import path from "node:path"; import { URL } from "node:url"; export default function (loc: string) { let fixtures = new URL("./fixtures", loc).pathname; if (process.platform === "win32") { // Remove the leading / before the drive letter ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-member-expression-to-functions/src/util.ts
packages/babel-helper-member-expression-to-functions/src/util.ts
import type { NodePath } from "@babel/traverse"; /** * Test if a NodePath will be cast to boolean when evaluated. * * @example * // returns true * const nodePathAQDotB = NodePath("if (a?.#b) {}").get("test"); // a?.#b * willPathCastToBoolean(nodePathAQDotB) * @example * // returns false * willPathCastToBoolea...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-member-expression-to-functions/src/index.ts
packages/babel-helper-member-expression-to-functions/src/index.ts
import type { NodePath, Visitor } from "@babel/traverse"; import { LOGICAL_OPERATORS, arrowFunctionExpression, assignmentExpression, binaryExpression, booleanLiteral, callExpression, cloneNode, conditionalExpression, identifier, isMemberExpression, isOptionalCallExpression, isOptionalMemberExpre...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-optimise-call-expression/src/index.ts
packages/babel-helper-optimise-call-expression/src/index.ts
import { callExpression, identifier, isIdentifier, isSpreadElement, memberExpression, optionalCallExpression, optionalMemberExpression, } from "@babel/types"; import type { CallExpression, Expression, OptionalCallExpression, } from "@babel/types"; /** * A helper function that generates a new call ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-syntax-export-default-from/src/index.ts
packages/babel-plugin-syntax-export-default-from/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; export default declare(api => { api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0-0")); return { name: "syntax-export-default-from", manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("exportDefaultFrom"); }, }; });
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-block-scoped-functions/src/index.ts
packages/babel-plugin-transform-block-scoped-functions/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t, type NodePath } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); function transformStatementList( parentPath: NodePath, paths: NodePath<t.Statement>[], ) { // eslint-disable-next-lin...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-proto-to-assign/src/index.ts
packages/babel-plugin-transform-proto-to-assign/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t, type File } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); function isProtoKey(node: t.ObjectExpression["properties"][number]) { return ( !t.isSpreadElement(node) && t.isStringLi...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-plugin-transform-export-namespace-from/src/index.ts
packages/babel-plugin-transform-export-namespace-from/src/index.ts
import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; export default declare(api => { api.assertVersion(REQUIRED_VERSION(7)); return { name: "transform-export-namespace-from", manipulateOptions: undefined, visitor: { ExportNamedDeclaration(path) { ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-module-transforms/src/rewrite-live-references.ts
packages/babel-helper-module-transforms/src/rewrite-live-references.ts
import { template, types as t } from "@babel/core"; import type { NodePath, Visitor, Scope } from "@babel/core"; import type { ModuleMetadata } from "./normalize-and-load-metadata.ts"; interface RewriteReferencesVisitorState { exported: Map<any, any>; metadata: ModuleMetadata; requeueInParent: (path: NodePath) ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-module-transforms/src/rewrite-this.ts
packages/babel-helper-module-transforms/src/rewrite-this.ts
import { types as t } from "@babel/core"; import traverse, { visitors, type NodePath } from "@babel/traverse"; /** * A lazily constructed visitor to walk the tree, rewriting all `this` references in the * top-level scope to be `void 0` (undefined). * */ let rewriteThisVisitor: Parameters<typeof traverse>[1]; expo...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-module-transforms/src/get-module-name.ts
packages/babel-helper-module-transforms/src/get-module-name.ts
type RootOptions = { filename?: string; filenameRelative?: string; sourceRoot?: string; }; export type PluginOptions = { moduleId?: string; moduleIds?: boolean; getModuleId?: (moduleName: string) => string | null | undefined; moduleRoot?: string; }; export default function getModuleName( rootOpts: Roo...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-module-transforms/src/index.ts
packages/babel-helper-module-transforms/src/index.ts
import assert from "node:assert"; import { template, types as t } from "@babel/core"; import { isModule } from "@babel/helper-module-imports"; import rewriteThis from "./rewrite-this.ts"; import rewriteLiveReferences from "./rewrite-live-references.ts"; import normalizeModuleAndLoadMetadata, { hasExports, isSideE...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-module-transforms/src/dynamic-import.ts
packages/babel-helper-module-transforms/src/dynamic-import.ts
// Heavily inspired by // https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js import { types as t, template } from "@babel/core"; export function buildDynamicImport( node: t.CallExpression | t.ImportExpression, deferToThen: boolean, wrapWithPromise: boolean, builder: (specifier...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helper-module-transforms/src/normalize-and-load-metadata.ts
packages/babel-helper-module-transforms/src/normalize-and-load-metadata.ts
import { basename, extname } from "node:path"; import type { types as t, NodePath } from "@babel/core"; import { isIdentifierName } from "@babel/helper-validator-identifier"; export interface ModuleMetadata { exportName: string; // The name of the variable that will reference an object containing export names. ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false