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 |
|---|---|---|---|---|---|---|---|---|
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/PushPullIterable.ts | src/util/PushPullIterable.ts | import RingBuffer from './RingBuffer'
type ResolveReject<T> = {
resolve: (value: T) => void
reject: (error?: any) => void
}
export default class PushPullIterable<T> implements AsyncIterable<T> {
private queue: RingBuffer<T>
private pushQueue: ResolveReject<boolean>[] = []
private pullQueue: ResolveReject<It... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/addImports.ts | src/util/addImports.ts | import Astx from '../Astx'
import { Node, NodePath } from '../types'
import Path from 'path'
import * as t from '@babel/types'
import findImports from './findImports'
import { stripImportKind } from './imports'
import {
getPlaceholder,
unescapeIdentifier,
} from '../compileMatcher/Placeholder'
export default funct... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/omitBlankLineChanges.ts | src/util/omitBlankLineChanges.ts | import { diffLines } from 'diff'
export default function omitBlankLineChanges(
oldStr: string,
newStr: string
): string {
const changes = diffLines(oldStr, newStr, { newlineIsToken: true })
const result = []
let lastChange
for (const c of changes) {
if (c.removed ? !/\S/.test(c.value) : /\S/.test(c.val... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/findImports.ts | src/util/findImports.ts | import { ImportDeclaration } from '@babel/types'
import Astx from '../Astx'
import * as t from '@babel/types'
import { Node, NodePath } from '../types'
import { Match } from '../find'
import {
addImportKind,
getImportKind,
getImported,
stripImportKind,
} from './imports'
import compileMatcher from '../compileMa... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/RingBuffer.ts | src/util/RingBuffer.ts | export default class RingBuffer<T> {
private readonly buffer: T[]
private _size = 0
private offset = 0
constructor(capacity: number) {
this.buffer = new Array(capacity)
}
push(...values: T[]): void {
for (const value of values) {
if (this.isFull) {
throw new Error(`buffer is full`)
... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/isInteractive.ts | src/util/isInteractive.ts | import { Readable } from 'stream'
export default function isInteractive({
stream = process.stdout,
}: { stream?: Readable } = {}): boolean {
return Boolean(
(stream as any)?.isTTY &&
process.env.TERM !== 'dumb' &&
!('CI' in process.env)
)
}
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/CodeFrameError.ts | src/util/CodeFrameError.ts | import CompilePathError from './CompilePathError'
import generate from '@babel/generator'
import { NodePath } from '../types'
import { codeFrameColumns } from '@babel/code-frame'
import chalk from 'chalk'
import dedent from 'dedent-js'
interface BabelCodeFrameOptions {
/** Syntax highlight the code as JavaScript for... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/imports.ts | src/util/imports.ts | import {
ImportSpecifier,
ImportDefaultSpecifier,
ImportNamespaceSpecifier,
} from '../types'
export function getImportKind(
specifier:
| ImportSpecifier
| ImportDefaultSpecifier
| ImportNamespaceSpecifier,
declKind: 'type' | 'typeof' | 'value' = 'value'
): 'type' | 'typeof' | 'value' {
return ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/cloneNode.ts | src/util/cloneNode.ts | import { Comment, Node } from '../types'
import { original, source } from './symbols'
const commentClones: Map<Comment, Comment> = new Map()
function isComment(node: any): node is Comment {
return node.type === 'CommentLine' || node.type === 'CommentBlock'
}
export default function cloneNode<T extends Node>(node: ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/areFieldValuesEqual.ts | src/util/areFieldValuesEqual.ts | import * as AstTypes from 'ast-types'
import shallowEqual from 'shallowequal'
export default function areFieldValuesEqual(
t: typeof AstTypes,
a: unknown,
b: unknown
): boolean {
if (Array.isArray(a)) {
if (!Array.isArray(b) || b.length !== a.length) return false
return a.every((value, index) => areFie... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/symbols.ts | src/util/symbols.ts | export const original = Symbol('original')
export const source = Symbol('source')
export const rangeWithWhitespace = Symbol('rangeWithWhitespace')
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/makeWhitespaceMap.ts | src/util/makeWhitespaceMap.ts | function makeWhitespaceStartMap(chars: string[]): number[] {
let start = 0
const result: number[] = []
for (let i = 0; i < chars.length; i++) {
result[i] = start
if (/\S/.test(chars[i])) start = i + 1
}
return result
}
function makeWhitespaceEndMap(chars: string[]): number[] {
let end = chars.lengt... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/replaceRanges.ts | src/util/replaceRanges.ts | type Range = [number, number]
type ReplacerAPI = {
insert: (index: number, content: string) => void
delete: (range: Range) => void
replace: (range: Range, replacement: string) => void
}
export function replaceRanges(
code: string,
replacer: (api: ReplacerAPI) => void
): string {
const replacements: { rang... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/pipeline.ts | src/util/pipeline.ts | import lodashFp from 'lodash/fp'
const { flow } = lodashFp
function pipeline<T0, T1>(t: T0, t0: (t: T0) => T1): T1
function pipeline<T0, T1, T2>(t: T0, t0: (t: T0) => T1, t1: (t: T1) => T2): T2
function pipeline<T0, T1, T2, T3>(
t: T0,
t0: (t: T0) => T1,
t1: (t: T1) => T2,
t2: (t: T2) => T3
): T3
function pipe... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/ensureArray.ts | src/util/ensureArray.ts | export default function ensureArray<T>(x: T | readonly T[]): readonly T[] {
return Array.isArray(x as any) ? (x as any) : [x]
}
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/formatDiff.ts | src/util/formatDiff.ts | // Adapted from the print-diff package
// https://github.com/LinusU/node-print-diff/blob/master/LICENSE
// The MIT License (MIT)
// Copyright (c) 2015 Linus Unnebäck
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software")... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/util/detectChangedNodes.ts | src/util/detectChangedNodes.ts | import { Comment, Node, NodePath } from '../types'
import * as AstTypes from 'ast-types'
import { original } from './symbols'
function getFieldNames(t: typeof AstTypes, node: Node | Comment): string[] {
switch (node.type) {
case 'File':
case 'Program':
case 'CommentBlock':
case 'CommentLine':
r... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/importTransformFile.d.ts | src/node/importTransformFile.d.ts | import { Transform } from '../Astx'
export async function importTransformFile(
transformFile: string
): Promise<Transform>
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/minimatch.d.ts | src/node/minimatch.d.ts | export { Minimatch } from 'minimatch'
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/astxCosmiconfig.ts | src/node/astxCosmiconfig.ts | import { cosmiconfig } from 'cosmiconfig'
import { CosmiconfigResult } from 'cosmiconfig/dist/types'
import { AstxConfigType, debugConfig } from '../AstxConfig'
export const astxCosmiconfig = cosmiconfig('astx', {
transform: (result: CosmiconfigResult): CosmiconfigResult => {
debugConfig('astxCosmiconfig', 'raw ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/AsyncPool.ts | src/node/AsyncPool.ts | type Entry<E> = { elem: E; available: boolean }
export default class AsyncPool<E> {
entries: Entry<E>[] = []
callbacks: ((entry: Entry<E>) => void)[] = []
constructor(entries: E[]) {
this.entries = entries.map((elem) => ({ elem, available: true }))
}
get elements(): E[] {
return this.entries.map((e... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/AstxWorkerEntry.ts | src/node/AstxWorkerEntry.ts | #!/usr/bin/env node
import { makeIpcTransformResult } from './ipc'
import runTransformOnFile, {
RunTransformOnFileOptions,
} from './runTransformOnFile'
import { parentPort as _parentPort } from 'worker_threads'
const parentPort = _parentPort
if (!parentPort) process.exit(1)
const abortControllers: Map<number, Abo... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/astxGlob.ts | src/node/astxGlob.ts | import Gitignore from 'gitignore-fs'
import { Minimatch } from 'minimatch'
import path from 'path'
import glob, { Fs } from './glob'
export type AstxGlobOptions = {
include?: string
exclude?: string
includeMatcher?: Minimatch
excludeMatcher?: Minimatch
gitignore?: Gitignore | null
cwd?: string
fs?: Fs
... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/AstxWorkerPool.ts | src/node/AstxWorkerPool.ts | import { clearCache } from 'babel-parse-wild-code'
import { range } from 'lodash'
import { cpus } from 'os'
import { IpcTransformResult } from './ipc'
import astxGlob from './astxGlob'
import AstxWorker from './AstxWorker'
import AsyncPool from './AsyncPool'
import { astxCosmiconfig } from './astxCosmiconfig'
import { ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/ipc.ts | src/node/ipc.ts | import lodashFp from 'lodash/fp'
const { mapValues, map } = lodashFp
import { TransformResult } from '../Astx'
import { Backend } from '../backend/Backend'
import { Match } from '../find'
import { Location, Node, NodePath } from '../types'
import CodeFrameError, { SourceLocation } from '../util/CodeFrameError'
export ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/loadFile.ts | src/node/loadFile.ts | import { Backend } from '../backend/Backend'
import fs from 'fs-extra'
import chooseGetBackend from '../chooseGetBackend'
import Astx from '../Astx'
export default async function loadFile(
file: string,
{
source,
parser,
parserOptions,
}: {
source?: string
parser?: string | Backend
parser... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/AstxWorker.ts | src/node/AstxWorker.ts | #!/usr/bin/env node
import { Worker } from 'worker_threads'
import { RunTransformOnFileOptions } from './runTransformOnFile'
import emitted from 'p-event'
import { IpcTransformResult } from './ipc'
import AstxWorkerFile from './AstxWorkerFile'
export default class AstxWorker {
private worker: Worker | undefined
p... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/AstxWorkerFile.d.ts | src/node/AstxWorkerFile.d.ts | /* eslint-env commonjs */
export default require.resolve('./AstxWorkerEntry.ts')
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/runTransformOnFile.ts | src/node/runTransformOnFile.ts | import defaultFs from 'fs-extra'
import Path from 'path'
import { memoize } from 'lodash'
import { promisify } from 'util'
import _resolve from 'resolve'
import { Match } from '../find'
import omitBlankLineChanges from '../util/omitBlankLineChanges'
import CodeFrameError from '../util/CodeFrameError'
import { AstxConfi... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/runTransform.ts | src/node/runTransform.ts | import runTransformOnFile, {
Fs as RunTransformOnFileFs,
} from './runTransformOnFile'
import { clearCache } from 'babel-parse-wild-code'
import { AstxConfig, debugConfig } from '../AstxConfig'
import astxGlob from './astxGlob'
import { Fs as GlobFs } from './glob'
import { astxCosmiconfig } from './astxCosmiconfig'
... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/index.ts | src/node/index.ts | export { default as AstxWorkerPool } from './AstxWorkerPool'
export {
default as runTransform,
type RunTransformOptions,
type Progress,
} from './runTransform'
export {
default as runTransformOnFile,
type RunTransformOnFileOptions,
} from './runTransformOnFile'
export {
type IpcPath,
type IpcNode,
type ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/node/glob.ts | src/node/glob.ts | import fs from 'fs-extra'
import Gitignore from 'gitignore-fs'
import path from 'path'
import { Minimatch } from './minimatch'
interface FsEntry {
name: string
isDirectory(): boolean
}
export interface Fs {
readdir(dir: string): Promise<FsEntry[]>
realpath(path: string): Promise<string>
}
const defaultFs: Fs... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/GenericNodeReplacement.ts | src/compileReplacement/GenericNodeReplacement.ts | import { Node, NodePath } from '../types'
import compileReplacement, {
CompiledReplacement,
CompileReplacementOptions,
GenerateReplacementOptions,
ReplaceableMatch,
} from './index'
import indentDebug from '../compileMatcher/indentDebug'
import transferComments from '../util/transferComments'
export default fu... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ExpressionStatement.ts | src/compileReplacement/ExpressionStatement.ts | import { ExpressionStatement, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileExpressionStatementReplacement(
path: NodePath<ExpressionStatement, ExpressionStatement>,
compileOptio... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/CallExpression.ts | src/compileReplacement/CallExpression.ts | import { CallExpression, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compileRelativeSourceReplacement from './RelativeSource'
import * as t from '@babel/types'
export default function compileCallExpressionReplacement(
path: NodePath<CallExpression, CallExpress... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ObjectTypeProperty.ts | src/compileReplacement/ObjectTypeProperty.ts | import { ObjectTypeProperty, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileObjectTypePropertyReplacement(
path: NodePath<ObjectTypeProperty, ObjectTypeProperty>,
compileOptions: ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/JSXExpressionContainer.ts | src/compileReplacement/JSXExpressionContainer.ts | import { JSXExpressionContainer, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileJSXExpressionContainerReplacement(
path: NodePath<JSXExpressionContainer, JSXExpressionContainer>,
... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/StringLiteral.ts | src/compileReplacement/StringLiteral.ts | import { StringLiteral, NodePath } from '../types'
import { getPlaceholder } from '../compileMatcher/Placeholder'
import { CompiledReplacement, ReplaceableMatch } from './'
import { unescapeIdentifier } from './Placeholder'
import cloneNode from '../util/cloneNode'
import * as t from '@babel/types'
import transferComme... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/Identifier.ts | src/compileReplacement/Identifier.ts | import { Node, Identifier, NodePath } from '../types'
import {
CompiledReplacement,
CompileReplacementOptions,
GenerateReplacementOptions,
ReplaceableMatch,
} from './'
import compilePlaceholderReplacement from './Placeholder'
import compileGenericNodeReplacement from './GenericNodeReplacement'
import { unescap... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ExportDefaultSpecifier.ts | src/compileReplacement/ExportDefaultSpecifier.ts | import { ExportDefaultSpecifier, NodePath, ExportDeclaration } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileExportDefaultSpecifierReplacement(
path: NodePath<ExportDefaultSpecifier, ExportDe... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ExportNamedDeclaration.ts | src/compileReplacement/ExportNamedDeclaration.ts | import { ExportNamedDeclaration, NodePath, Node, StringLiteral } from '../types'
import {
CompiledReplacement,
CompileReplacementOptions,
GenerateReplacementOptions,
ReplaceableMatch,
} from '.'
import compileGenericNodeReplacement from './GenericNodeReplacement'
import transferComments from '../util/transferCo... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/TSPropertySignature.ts | src/compileReplacement/TSPropertySignature.ts | import { TSPropertySignature, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileTSPropertySignatureReplacement(
path: NodePath<TSPropertySignature, TSPropertySignature>,
compileOptio... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/GenericArrayReplacement.ts | src/compileReplacement/GenericArrayReplacement.ts | import { NodePath, Node } from '../types'
import compileReplacement, {
CompiledReplacement,
CompileReplacementOptions,
GenerateReplacementOptions,
ReplaceableMatch,
} from './index'
import indentDebug from '../compileMatcher/indentDebug'
export default function compileGenericArrayReplacement(
path: NodePath<... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/Property.ts | src/compileReplacement/Property.ts | import { NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
import * as t from 'ast-types'
export default function compilePropertyReplacement(
path: NodePath<t.namedTypes.Property, t.namedTypes.Property>,
compileOp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/FunctionTypeParam.ts | src/compileReplacement/FunctionTypeParam.ts | import { FunctionTypeParam, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileFunctionTypeParamReplacement(
path: NodePath<FunctionTypeParam, FunctionTypeParam>,
compileOptions: Comp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ImportDeclaration.ts | src/compileReplacement/ImportDeclaration.ts | import { ImportDeclaration, NodePath, Node, StringLiteral } from '../types'
import {
CompiledReplacement,
CompileReplacementOptions,
GenerateReplacementOptions,
ReplaceableMatch,
} from '.'
import compileGenericNodeReplacement from './GenericNodeReplacement'
import transferComments from '../util/transferComment... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/JSXIdentifier.ts | src/compileReplacement/JSXIdentifier.ts | import { JSXIdentifier, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement, {
unescapeIdentifier,
} from './Placeholder'
export default function compileJSXIdentifierReplacement(
path: NodePath<JSXIdentifier, JSXIdentifier>,
compileOp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ObjectProperty.ts | src/compileReplacement/ObjectProperty.ts | import { ObjectProperty, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileObjectPropertyReplacement(
path: NodePath<ObjectProperty, ObjectProperty>,
compileOptions: CompileReplaceme... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ImportDefaultSpecifier.ts | src/compileReplacement/ImportDefaultSpecifier.ts | import { ImportDefaultSpecifier, NodePath, ImportDeclaration } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileImportDefaultSpecifierReplacement(
path: NodePath<ImportDefaultSpecifier, ImportDe... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/GenericTypeAnnotation.ts | src/compileReplacement/GenericTypeAnnotation.ts | import { GenericTypeAnnotation, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileGenericTypeAnnotationReplacement(
path: NodePath<GenericTypeAnnotation, GenericTypeAnnotation>,
comp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ExportSpecifier.ts | src/compileReplacement/ExportSpecifier.ts | import { ExportSpecifier, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileExportSpecifierReplacement(
path: NodePath<ExportSpecifier, ExportSpecifier>,
compileOptions: CompileRepla... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ExportAllDeclaration.ts | src/compileReplacement/ExportAllDeclaration.ts | import { ExportAllDeclaration, NodePath, Node, StringLiteral } from '../types'
import {
CompiledReplacement,
CompileReplacementOptions,
GenerateReplacementOptions,
ReplaceableMatch,
} from '.'
import compileGenericNodeReplacement from './GenericNodeReplacement'
import transferComments from '../util/transferComm... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/TemplateLiteral.ts | src/compileReplacement/TemplateLiteral.ts | import { TemplateLiteral, NodePath } from '../types'
import { getPlaceholder } from '../compileMatcher/Placeholder'
import { CompiledReplacement, ReplaceableMatch } from './'
import { unescapeIdentifier } from './Placeholder'
import cloneNode from '../util/cloneNode'
import * as t from '@babel/types'
import transferCom... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/SpreadElement.ts | src/compileReplacement/SpreadElement.ts | import { SpreadElement, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import { compileArrayPlaceholderReplacement } from './Placeholder'
export default function compileSpreadElementReplacement(
path: NodePath<SpreadElement, SpreadElement>,
compileOptions: CompileRepl... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/VariableDeclarator.ts | src/compileReplacement/VariableDeclarator.ts | import { VariableDeclarator, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileVariableDeclaratorReplacement(
path: NodePath<VariableDeclarator, VariableDeclarator>,
compileOptions: ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/RelativeSource.ts | src/compileReplacement/RelativeSource.ts | import { CompiledReplacement, CompileReplacementOptions } from '.'
import { NodePath } from '../types'
import * as t from '@babel/types'
import Path from 'path'
export default function compileRelativeSourceReplacement(
pattern: NodePath<any, any>,
compileReplacementOptions: CompileReplacementOptions
): CompiledRep... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/TSTypeReference.ts | src/compileReplacement/TSTypeReference.ts | import { TSTypeReference, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileTSTypeReferenceReplacement(
path: NodePath<TSTypeReference, TSTypeReference>,
compileOptions: CompileRepla... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ClassProperty.ts | src/compileReplacement/ClassProperty.ts | import { ClassProperty, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileClassPropertyReplacement(
path: NodePath<ClassProperty, ClassProperty>,
compileOptions: CompileReplacementOp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/JSXAttribute.ts | src/compileReplacement/JSXAttribute.ts | import { JSXAttribute, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileJSXAttributeReplacement(
path: NodePath<JSXAttribute, JSXAttribute>,
compileOptions: CompileReplacementOption... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ImportSpecifier.ts | src/compileReplacement/ImportSpecifier.ts | import { ImportSpecifier, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileImportSpecifierReplacement(
path: NodePath<ImportSpecifier, ImportSpecifier>,
compileOptions: CompileRepla... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/Placeholder.ts | src/compileReplacement/Placeholder.ts | import {
CompileReplacementOptions,
CompiledReplacement,
ReplaceableMatch,
} from '.'
import { Node, NodePath, getAstxMatchInfo } from '../types'
import {
getArrayPlaceholder,
getPlaceholder,
getRestPlaceholder,
isCapturePlaceholder,
unescapeIdentifier,
} from '../compileMatcher/Placeholder'
import crea... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/TypeParameter.ts | src/compileReplacement/TypeParameter.ts | import { TypeParameter, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileTypeParameterReplacement(
path: NodePath<TypeParameter, TypeParameter>,
compileOptions: CompileReplacementOp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/TSExpressionWithTypeArguments.ts | src/compileReplacement/TSExpressionWithTypeArguments.ts | import { TSExpressionWithTypeArguments, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileTSExpressionWithTypeArgumentsReplacement(
path: NodePath<TSExpressionWithTypeArguments, TSExpr... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/index.ts | src/compileReplacement/index.ts | import { Node, NodePath, Debugger } from '../types'
import __debug from 'debug'
import compileGenericNodeReplacement from './GenericNodeReplacement'
import compileGenericArrayReplacement from './GenericArrayReplacement'
import CallExpression from './CallExpression'
import ClassImplements from './ClassImplements'
import... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/TSTypeParameter.ts | src/compileReplacement/TSTypeParameter.ts | import { TSTypeParameter, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileTSTypeParameterReplacement(
path: NodePath<TSTypeParameter, TSTypeParameter>,
compileOptions: CompileRepla... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileReplacement/ClassImplements.ts | src/compileReplacement/ClassImplements.ts | import { ClassImplements, NodePath } from '../types'
import { CompiledReplacement, CompileReplacementOptions } from '.'
import compilePlaceholderReplacement from './Placeholder'
export default function compileClassImplementsReplacement(
path: NodePath<ClassImplements, ClassImplements>,
compileOptions: CompileRepla... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/backend/Backend.ts | src/backend/Backend.ts | import { NodePath, Statement, Expression, Location, Comment } from '../types'
import { parsePatternToNodes, parsePattern } from './parse'
import * as template from './template'
import * as AstTypes from 'ast-types'
export type GetBackend = (
file: string,
options?: { [k in string]?: any }
) => Promise<Backend>
ex... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/backend/parse.ts | src/backend/parse.ts | import { Backend } from './Backend'
import { NodePath, Expression, Statement, Node, Comment } from '../types'
import ensureArray from '../util/ensureArray'
import forEachNode from '../util/forEachNode'
import transferComments from '../util/transferComments'
function parse0(
backend: Backend,
strings: TemplateStrin... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/backend/template.ts | src/backend/template.ts | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Backend } from './Backend'
import { Node, Expression, Statement } from '../types'
import compileReplacement from '../comp... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/sortFlags.ts | src/compileMatcher/sortFlags.ts | import { memoize } from 'lodash'
const sortFlags = memoize((flags: string): string =>
flags.split('').sort().join('')
)
export default sortFlags
| typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/And.ts | src/compileMatcher/And.ts | import { Node, NodePath } from '../types'
import compileMatcher, {
CompiledMatcher,
CompileOptions,
MatchOptions,
MatchResult,
} from '.'
import { NodeType } from '../types'
import indentDebug from './indentDebug'
export default function compileAndMatcher(
path: NodePath,
paths: NodePath<Node, Node[]>,
c... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/GenericArrayMatcher.ts | src/compileMatcher/GenericArrayMatcher.ts | import { NodePath, Node } from '../types'
import CompilePathError from '../util/CompilePathError'
import compileMatcher, {
CompiledMatcher,
CompileOptions,
MatchOptions,
MatchResult,
mergeCaptures,
} from '.'
import indentDebug from './indentDebug'
const defaultUnorderedFields: { [k in string]?: { [k in stri... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ExpressionStatement.ts | src/compileMatcher/ExpressionStatement.ts | import { ExpressionStatement, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileExpressionStatementMatcher(
path: NodePath<ExpressionStatement, ExpressionStatement>,
compileOptions: CompileOptions
): C... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/CallExpression.ts | src/compileMatcher/CallExpression.ts | import { NodePath, CallExpression } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compileSpecialMatcher from './SpecialMatcher'
import { compileRelativeSourceMatcher } from './RelativeSource'
export default function compileCallExpressionMatcher(
path: NodePath<CallExpression, CallExpress... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ObjectTypeProperty.ts | src/compileMatcher/ObjectTypeProperty.ts | import { ObjectTypeProperty, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileObjectTypePropertyMatcher(
path: NodePath<ObjectTypeProperty, ObjectTypeProperty>,
compileOptions: CompileOptions
): Compi... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/JSXExpressionContainer.ts | src/compileMatcher/JSXExpressionContainer.ts | import { JSXExpressionContainer, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileJSXExpressionContainerMatcher(
path: NodePath<JSXExpressionContainer, JSXExpressionContainer>,
compileOptions: Compile... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/StringLiteral.ts | src/compileMatcher/StringLiteral.ts | import { NodePath, StringLiteral } from '../types'
import { CompileOptions, convertPredicateMatcher, CompiledMatcher } from '.'
import {
compileStringPlaceholderMatcher,
unescapeIdentifier,
} from './Placeholder'
export default function matchStringLiteral(
path: NodePath<StringLiteral, StringLiteral>,
compileO... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ImportExpression.ts | src/compileMatcher/ImportExpression.ts | import { ImportExpression, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compileGenericNodeMatcher from './GenericNodeMatcher'
import { compileRelativeSourceMatcher } from './RelativeSource'
export default function compileImportExpressionMatcher(
path: NodePath<ImportExpressio... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/Identifier.ts | src/compileMatcher/Identifier.ts | import { Identifier, NodePath, setAstxMatchInfo } from '../types'
import compileMatcher, {
CompiledMatcher,
CompileOptions,
MatchOptions,
MatchResult,
} from '.'
import compilePlaceholderMatcher, { unescapeIdentifier } from './Placeholder'
import cloneNode from '../util/cloneNode'
export default function compi... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ExportNamedDeclaration.ts | src/compileMatcher/ExportNamedDeclaration.ts | import { ExportNamedDeclaration, NodePath } from '../types'
import { CompiledMatcher, CompileOptions, MatchResult } from '.'
import compileGenericNodeMatcher from './GenericNodeMatcher'
import { compileRelativeSourceMatcher } from './RelativeSource'
export default function compileImportSpecifierMatcher(
path: NodePa... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/TSPropertySignature.ts | src/compileMatcher/TSPropertySignature.ts | import { TSPropertySignature, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileTSPropertySignatureMatcher(
path: NodePath<TSPropertySignature, TSPropertySignature>,
compileOptions: CompileOptions
): C... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/JSXText.ts | src/compileMatcher/JSXText.ts | import { NodePath, JSXText } from '../types'
import { CompileOptions, convertPredicateMatcher, CompiledMatcher } from '.'
import normalizeJSXTextValue from '../util/normalizeJSXTextValue'
export default function matchJSXText(
path: NodePath<JSXText, JSXText>,
compileOptions: CompileOptions
): CompiledMatcher {
c... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/JSXElement.ts | src/compileMatcher/JSXElement.ts | import { JSXElement, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compileGenericNodeMatcher from './GenericNodeMatcher'
import compileGenericArrayMatcher from './GenericArrayMatcher'
import normalizeJSXTextValue from '../util/normalizeJSXTextValue'
export default function compi... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/TSTypeAnnotation.ts | src/compileMatcher/TSTypeAnnotation.ts | import { TSTypeAnnotation, NodePath } from '../types'
import { CompiledMatcher, CompileOptions, MatchOptions } from '.'
import compileMatcher, { MatchResult } from '.'
export default function compileTSTypeAnnotationMatcher(
path: NodePath<TSTypeAnnotation, TSTypeAnnotation>,
compileOptions: CompileOptions
): Compi... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/GenericNodeMatcher.ts | src/compileMatcher/GenericNodeMatcher.ts | import { Node, NodePath, NodeType } from '../types'
import compileMatcher, {
CompiledMatcher,
CompileOptions,
MatchOptions,
MatchResult,
} from './index'
import indentDebug from './indentDebug'
import areFieldValuesEqual from '../util/areFieldValuesEqual'
const equivalenceClassesArray: {
nodeTypes: Set<NodeT... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/FunctionTypeParam.ts | src/compileMatcher/FunctionTypeParam.ts | import { FunctionTypeParam, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileFunctionTypeParamMatcher(
path: NodePath<FunctionTypeParam, FunctionTypeParam>,
compileOptions: CompileOptions
): CompiledM... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ImportDeclaration.ts | src/compileMatcher/ImportDeclaration.ts | import { ImportDeclaration, NodePath } from '../types'
import { CompiledMatcher, CompileOptions, MatchResult } from '.'
import compileGenericNodeMatcher from './GenericNodeMatcher'
import { compileRelativeSourceMatcher } from './RelativeSource'
export default function compileImportSpecifierMatcher(
path: NodePath<Im... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/RegExpLiteral.ts | src/compileMatcher/RegExpLiteral.ts | import { NodePath, RegExpLiteral } from '../types'
import sortFlags from './sortFlags'
import { CompileOptions, convertPredicateMatcher, CompiledMatcher } from '.'
export default function matchRegExpLiteral(
path: NodePath<RegExpLiteral, RegExpLiteral>,
compileOptions: CompileOptions
): CompiledMatcher {
const p... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/JSXIdentifier.ts | src/compileMatcher/JSXIdentifier.ts | import { JSXIdentifier, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher, { unescapeIdentifier } from './Placeholder'
export default function compileJSXIdentifierMatcher(
path: NodePath<JSXIdentifier, JSXIdentifier>,
compileOptions: CompileOptions
): C... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/BooleanLiteral.ts | src/compileMatcher/BooleanLiteral.ts | import { NodePath, BooleanLiteral } from '../types'
import { CompiledMatcher, convertPredicateMatcher, CompileOptions } from '.'
export default function matchBooleanLiteral(
path: NodePath<BooleanLiteral, BooleanLiteral>,
compileOptions: CompileOptions
): CompiledMatcher {
const pattern = path.value
const n = ... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ObjectProperty.ts | src/compileMatcher/ObjectProperty.ts | import { ObjectProperty, NodePath, NodeType } from '../types'
import compileMatcher, {
CompiledMatcher,
CompileOptions,
MatchOptions,
MatchResult,
} from '.'
import compilePlaceholderMatcher from './Placeholder'
import indentDebug from './indentDebug'
const nodeTypes: NodeType[] = ['ObjectProperty']
export de... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/GenericTypeAnnotation.ts | src/compileMatcher/GenericTypeAnnotation.ts | import { GenericTypeAnnotation, NodePath, pathIs } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
import compileSpecialMatcher from './SpecialMatcher'
export default function compileGenericTypeAnnotationMatcher(
path: NodePath<GenericTypeAnno... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ExportSpecifier.ts | src/compileMatcher/ExportSpecifier.ts | import { ExportSpecifier, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileExportSpecifierMatcher(
path: NodePath<ExportSpecifier, ExportSpecifier>,
compileOptions: CompileOptions
): CompiledMatcher |... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/ExportAllDeclaration.ts | src/compileMatcher/ExportAllDeclaration.ts | import { ExportAllDeclaration, NodePath } from '../types'
import { CompiledMatcher, CompileOptions, MatchResult } from '.'
import compileGenericNodeMatcher from './GenericNodeMatcher'
import { compileRelativeSourceMatcher } from './RelativeSource'
export default function compileImportSpecifierMatcher(
path: NodePath... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/TemplateLiteral.ts | src/compileMatcher/TemplateLiteral.ts | import { TemplateLiteral, NodePath } from '../types'
import { CompileOptions, CompiledMatcher } from '.'
import {
compileStringPlaceholderMatcher,
unescapeIdentifier,
} from './Placeholder'
import { createStringLiteralMatcher } from './StringLiteral'
function generateValue(cooked: string): { raw: string; cooked: s... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/TypeAnnotation.ts | src/compileMatcher/TypeAnnotation.ts | import { NodePath, TypeAnnotation } from '../types'
import { CompiledMatcher, CompileOptions, MatchOptions } from '.'
import compileMatcher, { MatchResult } from '.'
export default function compileTypeAnnotationMatcher(
path: NodePath<TypeAnnotation, TypeAnnotation>,
compileOptions: CompileOptions
): CompiledMatch... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/SpreadElement.ts | src/compileMatcher/SpreadElement.ts | import { NodePath, SpreadElement } from '../types'
import { CompiledMatcher, CompileOptions, MatchResult } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileSpreadElementMatcher(
path: NodePath<SpreadElement, SpreadElement>,
compileOptions: CompileOptions
): CompiledMatc... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/VariableDeclarator.ts | src/compileMatcher/VariableDeclarator.ts | import { VariableDeclarator, NodePath } from '../types'
import { CompiledMatcher, CompileOptions } from '.'
import compilePlaceholderMatcher from './Placeholder'
export default function compileVariableDeclaratorMatcher(
path: NodePath<VariableDeclarator, VariableDeclarator>,
compileOptions: CompileOptions
): Compi... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/Or.ts | src/compileMatcher/Or.ts | import { Node, NodePath, NodeType } from '../types'
import compileMatcher, {
CompiledMatcher,
CompileOptions,
MatchOptions,
MatchResult,
} from '.'
export default function compileOrMatcher(
path: NodePath,
paths: NodePath<Node, Node[]>,
compileOptions: CompileOptions
): CompiledMatcher | void {
const m... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
codemodsquad/astx | https://github.com/codemodsquad/astx/blob/c76c2219fd40bdbd1c75dc8aa0ac13da14a56910/src/compileMatcher/NumericLiteral.ts | src/compileMatcher/NumericLiteral.ts | import { NodePath, NumericLiteral } from '../types'
import { CompileOptions, convertPredicateMatcher, CompiledMatcher } from '.'
export default function matchNumericLiteral(
path: NodePath<NumericLiteral, NumericLiteral>,
compileOptions: CompileOptions
): CompiledMatcher {
const pattern: NumericLiteral = path.va... | typescript | MIT | c76c2219fd40bdbd1c75dc8aa0ac13da14a56910 | 2026-01-05T05:01:15.024820Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.