Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alangpierce/sucrase
/ functions
Functions
904 in github.com/alangpierce/sucrase
⨍
Functions
904
◇
Types & classes
118
↓ 1 callers
Function
parseWhileStatement
()
src/parser/traverser/statement.ts:539
↓ 1 callers
Function
parseYield
()
benchmark/sample/expression.ts:955
↓ 1 callers
Function
parseYield
()
src/parser/traverser/expression.ts:1006
↓ 1 callers
Method
preprocessExportAtIndex
(index: number)
src/CJSImportProcessor.ts:251
↓ 1 callers
Method
preprocessExportStarAtIndex
(index: number)
src/CJSImportProcessor.ts:336
↓ 1 callers
Method
preprocessImportAtIndex
(index: number)
src/CJSImportProcessor.ts:184
↓ 1 callers
Method
preprocessNamedExportAtIndex
* Walk this export statement just in case it's an export...from statement. * If it is, combine it into the import info for that path. Otherwise, ju
src/CJSImportProcessor.ts:312
↓ 1 callers
Method
preprocessVarExportAtIndex
(index: number)
src/CJSImportProcessor.ts:274
↓ 1 callers
Method
previousToken
()
src/TokenProcessor.ts:342
↓ 1 callers
Method
process
()
src/transformers/JSXTransformer.ts:44
↓ 1 callers
Method
processAssignment
()
src/transformers/CJSImportTransformer.ts:396
↓ 1 callers
Method
processChildTextElement
* Turn a JSX text element into a string literal, or nothing at all if the JSX * text resolves to the empty string. * * Returns true if a stri
src/transformers/JSXTransformer.ts:536
↓ 1 callers
Method
processClassBody
* We want to just handle class fields in all contexts, since TypeScript supports them. Later, * when some JS implementations support class fields,
src/transformers/RootTransformer.ts:269
↓ 1 callers
Function
processClassHeader
(tokens: TokenProcessor)
src/util/getClassInfo.ts:214
↓ 1 callers
Method
processComplexAssignment
* Process something like `a += 3`, where `a` might be an exported value.
src/transformers/CJSImportTransformer.ts:430
↓ 1 callers
Method
processComplexExportVar
* Transform normal declaration exports, including handling destructuring. * For example, this: * export const {x: [a = 2, b], c} = d; * becom
src/transformers/CJSImportTransformer.ts:683
↓ 1 callers
Method
processDefaultExportEnum
* Handle a declaration like: * export default enum E * * With the imports transform, this becomes: * const E = [[enum]]; exports.default =
src/transformers/FlowTransformer.ts:72
↓ 1 callers
Method
processEnumBody
* Transform an enum into equivalent JS. This has complexity in a few places: * - TS allows string enums, numeric enums, and a mix of the two styles
src/transformers/TypeScriptTransformer.ts:80
↓ 1 callers
Method
processEnumElement
* Process an individual enum element, producing either an array element or an * object element based on what type of enum this is.
src/transformers/FlowTransformer.ts:163
↓ 1 callers
Function
processEvent
(data: Message)
website/src/worker/Worker.worker.ts:72
↓ 1 callers
Method
processExplicitValueEnumMember
* Handle an enum member initialized with an expression on the right-hand side (other than a * string literal). In these cases, we should transform
src/transformers/TypeScriptTransformer.ts:220
↓ 1 callers
Method
processExport
()
src/transformers/CJSImportTransformer.ts:308
↓ 1 callers
Method
processExportBindings
* Transform this: * export {a, b as c}; * into this: * exports.a = a; exports.c = b; * * OR * * Transform this: * export {a, b
src/transformers/CJSImportTransformer.ts:830
↓ 1 callers
Method
processExportClass
* Transform this: * export class A {} * into this: * class A {} exports.A = A;
src/transformers/CJSImportTransformer.ts:805
↓ 1 callers
Method
processExportDefault
()
src/transformers/CJSImportTransformer.ts:521
↓ 1 callers
Method
processExportDefault
()
src/transformers/ESMImportTransformer.ts:304
↓ 1 callers
Method
processExportFunction
* Transform this: * export function foo() {} * into this: * function foo() {} exports.foo = foo;
src/transformers/CJSImportTransformer.ts:756
↓ 1 callers
Method
processExportStar
()
src/transformers/CJSImportTransformer.ts:896
↓ 1 callers
Method
processExportVar
* Transform a declaration like `export var`, `export let`, or `export const`.
src/transformers/CJSImportTransformer.ts:611
↓ 1 callers
Method
processIdentifier
()
src/transformers/CJSImportTransformer.ts:245
↓ 1 callers
Method
processImplicitValueEnumMember
* Handle an enum member with no right-hand side expression. In this case, the value is the * previous value plus 1, or 0 if there was no previous v
src/transformers/TypeScriptTransformer.ts:264
↓ 1 callers
Method
processImport
* Transform this: * import foo, {bar} from 'baz'; * into * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); * * The
src/transformers/CJSImportTransformer.ts:124
↓ 1 callers
Method
processImport
()
src/transformers/ESMImportTransformer.ts:156
↓ 1 callers
Method
processImportEquals
()
src/transformers/CJSImportTransformer.ts:103
↓ 1 callers
Method
processImportEquals
()
src/transformers/ESMImportTransformer.ts:133
↓ 1 callers
Method
processNamedExportEnum
* Handle a declaration like: * export enum E ... * * With this imports transform, this becomes: * const E = [[enum]]; exports.E = E; *
src/transformers/FlowTransformer.ts:49
↓ 1 callers
Method
processNamedExports
* Handle a statement with one of these forms: * export {a, type b}; * export {c, type d} from 'foo'; * * In both cases, any explicit type
src/transformers/ESMImportTransformer.ts:356
↓ 1 callers
Method
processObjectShorthand
()
src/transformers/CJSImportTransformer.ts:298
↓ 1 callers
Method
processPostIncDec
* Process something like `a++`, where `a` might be an exported value. * This starts at the `a`, not at the `++`.
src/transformers/CJSImportTransformer.ts:488
↓ 1 callers
Method
processPreIncDec
* Process something like `++a`, where `a` might be an exported value.
src/transformers/CJSImportTransformer.ts:456
↓ 1 callers
Method
processPropsObjectWithDevInfo
* Starting at the beginning of the props, add the props argument to * React.createElement, including the comma before it.
src/transformers/JSXTransformer.ts:355
↓ 1 callers
Method
processSimpleExportVar
* Transform an `export var` declaration initializing a single variable. * * For example, this: * export const f = () => {}; * becomes this
src/transformers/CJSImportTransformer.ts:656
↓ 1 callers
Method
processStringLiteralEnumMember
* Handle an enum member where the RHS is just a string literal (not omitted, not a number, and * not a complex expression). This is the typical for
src/transformers/TypeScriptTransformer.ts:173
↓ 1 callers
Method
processStringPropValue
()
src/transformers/JSXTransformer.ts:459
↓ 1 callers
Method
pruneTypeOnlyImports
* In TypeScript, import statements that only import types should be removed. * This includes `import {} from 'foo';`, but not `import 'foo';`.
src/CJSImportProcessor.ts:72
↓ 1 callers
Method
rawCodeForToken
(token: Token)
src/TokenProcessor.ts:95
↓ 1 callers
Function
readRadixNumber
()
src/parser/tokenizer/index.ts:855
↓ 1 callers
Function
readRegexp
()
src/parser/tokenizer/index.ts:808
↓ 1 callers
Function
readString
(quote: number)
src/parser/tokenizer/index.ts:928
↓ 1 callers
Function
readTmplToken
()
src/parser/tokenizer/index.ts:948
↓ 1 callers
Function
readToken
(code: number)
src/parser/tokenizer/index.ts:288
↓ 1 callers
Function
readToken_caret
()
src/parser/tokenizer/index.ts:478
↓ 1 callers
Function
readToken_dot
()
src/parser/tokenizer/index.ts:393
↓ 1 callers
Function
readToken_eq_excl
(code: number)
src/parser/tokenizer/index.ts:594
↓ 1 callers
Function
readToken_lt
()
src/parser/tokenizer/index.ts:507
↓ 1 callers
Function
readToken_mult_modulo
(code: number)
src/parser/tokenizer/index.ts:418
↓ 1 callers
Function
readToken_pipe_amp
(code: number)
src/parser/tokenizer/index.ts:443
↓ 1 callers
Function
readToken_plus_min
(code: number)
src/parser/tokenizer/index.ts:488
↓ 1 callers
Function
readToken_question
()
src/parser/tokenizer/index.ts:610
↓ 1 callers
Function
readToken_slash
()
src/parser/tokenizer/index.ts:409
↓ 1 callers
Function
readWord
()
src/parser/tokenizer/readWord.ts:14
↓ 1 callers
Function
registerJS
(hookOptions?: HookOptions)
src/register.ts:37
↓ 1 callers
Function
registerJSX
(hookOptions?: HookOptions)
src/register.ts:41
↓ 1 callers
Function
registerTS
(hookOptions?: HookOptions)
src/register.ts:45
↓ 1 callers
Function
registerTSX
(hookOptions?: HookOptions)
src/register.ts:49
↓ 1 callers
Method
removeBalancedCode
* Remove all code until the next }, accounting for balanced braces.
src/TokenProcessor.ts:213
↓ 1 callers
Method
removeImportAndDetectIfShouldElide
* Erase this import (since any CJS output would be completely different), and * return true if this import is should be elided due to being a type-
src/transformers/CJSImportTransformer.ts:178
↓ 1 callers
Method
removeImportTypeBindings
* Remove type bindings from this import, leaving the rest of the import intact. * * Return true if this import was ONLY types, and thus is eligi
src/transformers/ESMImportTransformer.ts:184
↓ 1 callers
Function
reportSummary
({numPassed, numFailed, numSkipped, failures}: ResultSummary)
spec-compliance-tests/babel-tests/check-babel-tests.ts:137
↓ 1 callers
Method
reset
()
src/TokenProcessor.ts:64
↓ 1 callers
Function
runBabel
(code: string, babelPlugins: Array<string>)
spec-compliance-tests/babel-tests/check-babel-tests.ts:258
↓ 1 callers
Function
runBabel
()
website/src/WorkerClient.ts:108
↓ 1 callers
Function
runBenchmarkComparison
(baseRef: string, branchRef: string)
benchmark/compare-performance.ts:60
↓ 1 callers
Function
runGlob
(options: CLIOptions)
src/cli.ts:164
↓ 1 callers
Function
runMicrobenchmark
(name: string, runTrial: () => void, times: number = 100)
benchmark/microbenchmark.ts:29
↓ 1 callers
Function
runProject
(project: string, shouldSave: boolean)
example-runner/example-runner.ts:62
↓ 1 callers
Function
runSucrase
(code: string, babelPlugins: Array<string>)
spec-compliance-tests/babel-tests/check-babel-tests.ts:250
↓ 1 callers
Function
runSucrase
()
website/src/WorkerClient.ts:104
↓ 1 callers
Function
runTypeScript
()
website/src/WorkerClient.ts:112
↓ 1 callers
Function
saveHashState
({ code, compressedCode, sucraseOptions, compareOptions, debugOptions, }: HashState)
website/src/URLHashState.ts:26
↓ 1 callers
Function
setConfig
(config: WorkerConfig)
website/src/WorkerClient.ts:100
↓ 1 callers
Method
shouldAutomaticallyElideImportedName
(name: string)
src/CJSImportProcessor.ts:94
↓ 1 callers
Method
shouldElideExportedIdentifier
(name: string)
src/transformers/CJSImportTransformer.ts:909
↓ 1 callers
Method
shouldElideExportedName
* ESM elides all imports with the rule that we only elide if we see that it's * a type and never see it as a value. This is in contrast to CJS, whi
src/transformers/ESMImportTransformer.ts:407
↓ 1 callers
Function
shouldParseArrow
()
benchmark/sample/expression.ts:610
↓ 1 callers
Function
shouldParseArrow
()
src/parser/traverser/expression.ts:683
↓ 1 callers
Function
shouldParseAsyncArrow
()
benchmark/sample/expression.ts:361
↓ 1 callers
Function
shouldParseAsyncArrow
()
src/parser/traverser/expression.ts:415
↓ 1 callers
Function
shouldParseDefaultImport
()
src/parser/traverser/statement.ts:1250
↓ 1 callers
Function
shouldParseExportDeclaration
()
src/parser/traverser/statement.ts:1116
↓ 1 callers
Function
shouldParseExportStar
()
src/parser/traverser/statement.ts:1082
↓ 1 callers
Function
skipBlockComment
()
src/parser/tokenizer/index.ts:302
↓ 1 callers
Function
skipFieldName
* The next token or set of tokens is either an identifier or an expression in square brackets, for * a method or field name.
src/util/getClassInfo.ts:338
↓ 1 callers
Function
skipWord
()
src/parser/tokenizer/index.ts:983
↓ 1 callers
Function
sleep
(timeMs: number)
script/sleep.ts:1
↓ 1 callers
Function
summarizeChange
( pessimisticComparison: Comparison, optimisticComparison: Comparison, )
benchmark/compare-performance.ts:116
↓ 1 callers
Method
transformTagToCreateElement
* Convert the current JSX element to a createElement call. In the classic * runtime, this is the only case. In the automatic runtime, this is calle
src/transformers/JSXTransformer.ts:185
↓ 1 callers
Method
transformTagToJSXFunc
* Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is * the primary transformation for the automatic transform. * * Ex
src/transformers/JSXTransformer.ts:124
↓ 1 callers
Function
truncate
(s: string, length: number)
src/util/formatTokens.ts:68
↓ 1 callers
Function
tsAfterParseClassSuper
(hasSuper: boolean)
src/parser/plugins/typescript.ts:1505
← previous
next →
601–700 of 904, ranked by callers