package js_printer
import "github.com/evanw/esbuild/internal/js_printer"
Index ¶
- func CanEscapeIdentifier(name string, unsupportedJSFeatures compat.JSFeature, asciiOnly bool) bool
- func QuoteForJSON(text string, asciiOnly bool) []byte
- func QuoteIdentifier(js []byte, name string, unsupportedFeatures compat.JSFeature) []byte
- type Options
- type PrintResult
- type RequireOrImportMeta
Functions ¶
func CanEscapeIdentifier ¶
func QuoteForJSON ¶
func QuoteIdentifier ¶
Types ¶
type Options ¶
type Options struct { OutputFormat config.Format RemoveWhitespace bool MangleSyntax bool ASCIIOnly bool LegalComments config.LegalComments AddSourceMappings bool Indent int ToModuleRef js_ast.Ref RuntimeRequireRef js_ast.Ref UnsupportedFeatures compat.JSFeature RequireOrImportMetaForSource func(uint32) RequireOrImportMeta // If we're writing out a source map, this table of line start indices lets // us do binary search on to figure out what line a given AST node came from LineOffsetTables []sourcemap.LineOffsetTable // This will be present if the input file had a source map. In that case we // want to map all the way back to the original input file(s). InputSourceMap *sourcemap.SourceMap }
type PrintResult ¶
type PrintResult struct { JS []byte // This source map chunk just contains the VLQ-encoded offsets for the "JS" // field above. It's not a full source map. The bundler will be joining many // source map chunks together to form the final source map. SourceMapChunk sourcemap.Chunk ExtractedLegalComments map[string]bool }
func Print ¶
func Print(tree js_ast.AST, symbols js_ast.SymbolMap, r renamer.Renamer, options Options) PrintResult
type RequireOrImportMeta ¶
type RequireOrImportMeta struct { // CommonJS files will return the "require_*" wrapper function and an invalid // exports object reference. Lazily-initialized ESM files will return the // "init_*" wrapper function and the exports object for that file. WrapperRef js_ast.Ref ExportsRef js_ast.Ref IsWrapperAsync bool }
Source Files ¶
- Version
- v0.13.14
- Published
- Nov 16, 2021
- Platform
- windows/amd64
- Imports
- 15 packages
- Last checked
- 2 hours ago –
Tools for package owners.