Home Manual Reference Source Test Repository
public class | source

Parser

Provides a convenience wrapper around babylon applying an ES Modules regex test to automatically set sourceType to script or module.

Static Method Summary

Static Public Methods
public static

parse(source: string, options: object): object

Parses the given source with babylon.

Static Public Methods

public static parse(source: string, options: object): object source

Parses the given source with babylon.

Params:

NameTypeAttributeDescription
source string

Javascript source code to parse.

options object

(Optional) overrides default babylon parser options.

Return:

object