Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-sitter-javascript

Package Overview
Dependencies
Maintainers
11
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter-javascript - npm Package Compare versions

Comparing version 0.16.0 to 0.19.0

.github/workflows/build.yml

527

grammar.js

@@ -1,27 +0,1 @@

const PREC = {
COMMENT: 1, // Prefer comments over regexes
STRING: 2, // In a string, prefer string characters over comments
COMMA: -1,
OBJECT: -1,
DECLARATION: 1,
ASSIGN: 0,
TERNARY: 1,
OR: 2,
AND: 3,
REL: 4,
PLUS: 5,
TIMES: 6,
EXP: 7,
TYPEOF: 8,
DELETE: 8,
VOID: 8,
NOT: 9,
NEG: 10,
INC: 11,
CALL: 12,
NEW: 13,
MEMBER: 14
};
module.exports = grammar({

@@ -41,6 +15,7 @@ name: 'javascript',

supertypes: $ => [
$._statement,
$._declaration,
$._expression,
$._destructuring_pattern,
$.statement,
$.declaration,
$.expression,
$.primary_expression,
$.pattern,
],

@@ -50,9 +25,6 @@

$._call_signature,
$._constructable_expression,
$._statement,
$._formal_parameter,
$.statement,
$._expressions,
$._semicolon,
$._formal_parameter,
$._destructuring_pattern,
$._identifier_reference,
$._reserved_identifier,

@@ -69,13 +41,45 @@ $._jsx_attribute,

precedences: $ => [
[
'member',
'call',
$.update_expression,
'unary_not',
'unary_void',
'binary_exp',
'binary_times',
'binary_plus',
'binary_compare',
'binary_relation',
'binary_in',
'binary_and',
'binary_or',
'ternary',
$.await_expression,
$.sequence_expression,
$.arrow_function
],
[$.rest_pattern, 'assign'],
['assign', $.primary_expression],
['member', 'new', 'call', $.expression],
['declaration', 'literal'],
[$.primary_expression, $.statement_block, 'object'],
[$.import_statement, $.import],
[$.export_statement, $.primary_expression],
],
conflicts: $ => [
[$._expression, $._property_name],
[$._expression, $._property_name, $.arrow_function],
[$._expression, $.arrow_function],
[$._expression, $.method_definition],
[$._expression, $.formal_parameters],
[$._expression, $.rest_parameter],
[$.primary_expression, $._property_name],
[$.primary_expression, $._property_name, $.arrow_function],
[$.primary_expression, $.arrow_function],
[$.primary_expression, $.method_definition],
[$.primary_expression, $.rest_pattern],
[$.primary_expression, $.pattern],
[$.primary_expression, $._for_header],
[$.array, $.array_pattern],
[$.object, $.object_pattern],
[$.assignment_expression, $.pattern],
[$.assignment_expression, $.object_assignment_pattern],
[$.labeled_statement, $._property_name],
[$.assignment_pattern, $.assignment_expression],
[$.computed_property_name, $.array],
[$._for_header, $._expression],
],

@@ -88,3 +92,3 @@

optional($.hash_bang_line),
repeat($._statement)
repeat($.statement)
),

@@ -111,6 +115,6 @@

choice(
field('declaration', $._declaration),
field('declaration', $.declaration),
seq(
'default',
field('value', $._expression),
field('value', $.expression),
$._semicolon

@@ -137,3 +141,3 @@ )

_declaration: $ => choice(
declaration: $ => choice(
$.function_declaration,

@@ -152,3 +156,3 @@ $.generator_function_declaration,

import_statement: $ => prec(1, seq(
import_statement: $ => seq(
'import',

@@ -160,3 +164,3 @@ choice(

$._semicolon
)),
),

@@ -197,3 +201,3 @@ import_clause: $ => choice(

_statement: $ => choice(
statement: $ => choice(
$.export_statement,

@@ -203,3 +207,3 @@ $.import_statement,

$.expression_statement,
$._declaration,
$.declaration,
$.statement_block,

@@ -248,3 +252,3 @@

'{',
repeat($._statement),
repeat($.statement),
'}',

@@ -254,10 +258,9 @@ optional($._automatic_semicolon)

else_clause: $ => seq('else', $.statement),
if_statement: $ => prec.right(seq(
'if',
field('condition', $.parenthesized_expression),
field('consequence', $._statement),
optional(seq(
'else',
field('alternative', $._statement)
))
field('consequence', $.statement),
optional(field('alternative', $.else_clause))
)),

@@ -286,3 +289,3 @@

')',
field('body', $._statement)
field('body', $.statement)
),

@@ -294,3 +297,3 @@

$._for_header,
field('body', $._statement)
field('body', $.statement)
),

@@ -300,4 +303,15 @@

'(',
optional(choice('var', 'let', 'const')),
field('left', choice($.parenthesized_expression, $._lhs_expression)),
choice(
field('left', choice(
$._lhs_expression,
$.parenthesized_expression,
)),
seq(
choice('var', 'let', 'const'),
field('left', choice(
$.identifier,
$._destructuring_pattern
))
)
),
choice('in', 'of'),

@@ -311,3 +325,3 @@ field('right', $._expressions),

field('condition', $.parenthesized_expression),
field('body', $._statement)
field('body', $.statement)
),

@@ -317,3 +331,3 @@

'do',
field('body', $._statement),
field('body', $.statement),
'while',

@@ -334,3 +348,3 @@ field('condition', $.parenthesized_expression),

field('object', $.parenthesized_expression),
field('body', $._statement)
field('body', $.statement)
),

@@ -372,3 +386,3 @@

':',
$._statement
$.statement
)),

@@ -390,3 +404,3 @@

':',
repeat($._statement)
repeat($.statement)
),

@@ -397,3 +411,3 @@

':',
repeat($._statement)
repeat($.statement)
),

@@ -422,11 +436,10 @@

_expressions: $ => choice(
$._expression,
$.expression,
$.sequence_expression
),
_expression: $ => choice(
$._constructable_expression,
expression: $ => choice(
$.primary_expression,
$._jsx_element,
$.jsx_fragment,
$.assignment_expression,

@@ -439,14 +452,41 @@ $.augmented_assignment_expression,

$.update_expression,
$.call_expression,
$.new_expression,
$.yield_expression,
),
primary_expression: $ => choice(
$.subscript_expression,
$.member_expression,
$.parenthesized_expression,
$.identifier,
alias($._reserved_identifier, $.identifier),
$.this,
$.super,
$.number,
$.string,
$.template_string,
$.regex,
$.true,
$.false,
$.null,
$.undefined,
$.import,
$.object,
$.array,
$.function,
$.arrow_function,
$.generator_function,
$.class,
$.meta_property,
$.call_expression,
),
yield_expression: $ => prec.right(seq(
'yield',
choice(
seq('*', $._expression),
optional($._expression)
seq('*', $.expression),
optional($.expression)
))),
object: $ => prec(PREC.OBJECT, seq(
object: $ => prec('object', seq(
'{',

@@ -457,3 +497,2 @@ commaSep(optional(choice(

$.method_definition,
$.assignment_pattern,
alias(

@@ -467,9 +506,29 @@ choice($.identifier, $._reserved_identifier),

object_pattern: $ => prec('object', seq(
'{',
commaSep(optional(choice(
$.pair_pattern,
$.rest_pattern,
$.object_assignment_pattern,
alias(
choice($.identifier, $._reserved_identifier),
$.shorthand_property_identifier_pattern
)
))),
'}'
)),
assignment_pattern: $ => seq(
field('left', $.pattern),
'=',
field('right', $.expression)
),
object_assignment_pattern: $ => seq(
field('left', choice(
alias(choice($._reserved_identifier, $.identifier), $.shorthand_property_identifier),
alias(choice($._reserved_identifier, $.identifier), $.shorthand_property_identifier_pattern),
$._destructuring_pattern
)),
'=',
field('right', $._expression)
field('right', $.expression)
),

@@ -480,3 +539,3 @@

commaSep(optional(choice(
$._expression,
$.expression,
$.spread_element

@@ -487,2 +546,11 @@ ))),

array_pattern: $ => seq(
'[',
commaSep(optional(choice(
$.pattern,
$.assignment_pattern,
))),
']'
),
_jsx_element: $ => choice($.jsx_element, $.jsx_self_closing_element),

@@ -496,3 +564,3 @@

jsx_fragment: $ => seq('<', '>', repeat($._jsx_child), '<','/','>'),
jsx_fragment: $ => seq('<', '>', repeat($._jsx_child), '<', '/', '>'),

@@ -504,3 +572,3 @@ jsx_text: $ => /[^{}<>]+/,

optional(choice(
$._expression,
$.expression,
$.sequence_expression,

@@ -515,2 +583,3 @@ $.spread_element

$._jsx_element,
$.jsx_fragment,
$.jsx_expression

@@ -533,3 +602,3 @@ ),

nested_identifier: $ => prec(PREC.MEMBER, seq(
nested_identifier: $ => prec('member', seq(
choice($.identifier, $.nested_identifier),

@@ -582,3 +651,3 @@ '.',

class: $ => seq(
class: $ => prec('literal', seq(
repeat(field('decorator', $.decorator)),

@@ -589,5 +658,5 @@ 'class',

field('body', $.class_body)
),
)),
class_declaration: $ => prec(PREC.DECLARATION, seq(
class_declaration: $ => prec('declaration', seq(
repeat(field('decorator', $.decorator)),

@@ -601,5 +670,5 @@ 'class',

class_heritage: $ => seq('extends', $._expression),
class_heritage: $ => seq('extends', $.expression),
function: $ => seq(
function: $ => prec('literal', seq(
optional('async'),

@@ -610,5 +679,5 @@ 'function',

field('body', $.statement_block)
),
)),
function_declaration: $ => prec.right(PREC.DECLARATION, seq(
function_declaration: $ => prec.right('declaration', seq(
optional('async'),

@@ -622,3 +691,3 @@ 'function',

generator_function: $ => seq(
generator_function: $ => prec('literal', seq(
optional('async'),

@@ -630,5 +699,5 @@ 'function',

field('body', $.statement_block)
),
)),
generator_function_declaration: $ => prec.right(PREC.DECLARATION, seq(
generator_function_declaration: $ => prec.right('declaration', seq(
optional('async'),

@@ -654,3 +723,3 @@ 'function',

field('body', choice(
$._expression,
$.expression,
$.statement_block

@@ -661,62 +730,37 @@ ))

// Override
_call_signature: $ => seq(
field('parameters', $.formal_parameters)
_call_signature: $ => field('parameters', $.formal_parameters),
_formal_parameter: $ => choice($.pattern, $.assignment_pattern),
call_expression: $ => choice(
prec('call', seq(
field('function', $.expression),
field('arguments', choice($.arguments, $.template_string))
)),
prec('member', seq(
field('function', $.primary_expression),
'?.',
field('arguments', $.arguments)
))
),
call_expression: $ => prec(PREC.CALL, seq(
field('function', choice($._expression, $.super, $.function)),
field('arguments', choice($.arguments, $.template_string))
)),
new_expression: $ => prec.right(PREC.NEW, seq(
new_expression: $ => prec.right('new', seq(
'new',
field('constructor', $._constructable_expression),
field('arguments', optional($.arguments))
field('constructor', $.primary_expression),
field('arguments', optional(prec.dynamic(1, $.arguments)))
)),
_constructable_expression: $ => choice(
// Primary Expression
$.this,
$.identifier,
alias($._reserved_identifier, $.identifier),
$.number,
$.string,
$.template_string,
$.regex,
$.true,
$.false,
$.null,
$.undefined,
$.import,
$.object,
$.array,
$.function,
$.arrow_function,
$.generator_function,
$.class,
$.parenthesized_expression,
$.subscript_expression,
$.member_expression,
$.meta_property,
$.new_expression,
),
await_expression: $ => seq(
'await',
$._expression
$.expression
),
member_expression: $ => prec(PREC.MEMBER, seq(
field('object', choice(
$._expression,
$.identifier,
$.super,
alias($._reserved_identifier, $.identifier)
)),
'.',
member_expression: $ => prec('member', seq(
field('object', choice($.expression, $.primary_expression)),
choice('.', '?.'),
field('property', alias($.identifier, $.property_identifier))
)),
subscript_expression: $ => prec.right(PREC.MEMBER, seq(
field('object', choice($._expression, $.super)),
subscript_expression: $ => prec.right('member', seq(
field('object', choice($.expression, $.primary_expression)),
optional('?.'),
'[', field('index', $._expressions), ']'

@@ -733,18 +777,21 @@ )),

assignment_expression: $ => prec.right(PREC.ASSIGN, seq(
assignment_expression: $ => prec.right('assign', seq(
field('left', choice($.parenthesized_expression, $._lhs_expression)),
'=',
field('right', $._expression)
field('right', $.expression)
)),
augmented_assignment_expression: $ => prec.right(PREC.ASSIGN, seq(
field('left', choice(
$.member_expression,
$.subscript_expression,
alias($._reserved_identifier, $.identifier),
$.identifier,
$.parenthesized_expression,
)),
choice('+=', '-=', '*=', '/=', '%=', '^=', '&=', '|=', '>>=', '>>>=', '<<=', '**='),
field('right', $._expression)
_augmented_assignment_lhs: $ => choice(
$.member_expression,
$.subscript_expression,
alias($._reserved_identifier, $.identifier),
$.identifier,
$.parenthesized_expression,
),
augmented_assignment_expression: $ => prec.right('assign', seq(
field('left', $._augmented_assignment_lhs),
choice('+=', '-=', '*=', '/=', '%=', '^=', '&=', '|=', '>>=', '>>>=',
'<<=', '**=', '&&=', '||=', '??='),
field('right', $.expression)
)),

@@ -754,18 +801,18 @@

'=',
field('value', $._expression)
field('value', $.expression)
),
_destructuring_pattern: $ => choice(
alias($.object, $.object_pattern),
alias($.array, $.array_pattern)
$.object_pattern,
$.array_pattern
),
spread_element: $ => seq('...', $._expression),
spread_element: $ => seq('...', $.expression),
ternary_expression: $ => prec.right(PREC.TERNARY, seq(
field('condition', $._expression),
ternary_expression: $ => prec.right('ternary', seq(
field('condition', $.expression),
'?',
field('consequence', $._expression),
field('consequence', $.expression),
':',
field('alternative', $._expression)
field('alternative', $.expression)
)),

@@ -775,31 +822,32 @@

...[
['&&', PREC.AND],
['||', PREC.OR],
['>>', PREC.TIMES],
['>>>', PREC.TIMES],
['<<', PREC.TIMES],
['&', PREC.AND],
['^', PREC.OR],
['|', PREC.OR],
['+', PREC.PLUS],
['-', PREC.PLUS],
['*', PREC.TIMES],
['/', PREC.TIMES],
['%', PREC.TIMES],
['**', PREC.EXP],
['<', PREC.REL],
['<=', PREC.REL],
['==', PREC.REL],
['===', PREC.REL],
['!=', PREC.REL],
['!==', PREC.REL],
['>=', PREC.REL],
['>', PREC.REL],
['instanceof', PREC.REL],
['in', PREC.REL],
['&&', 'binary_and'],
['||', 'binary_or'],
['>>', 'binary_times'],
['>>>', 'binary_times'],
['<<', 'binary_times'],
['&', 'binary_and'],
['^', 'binary_or'],
['|', 'binary_or'],
['+', 'binary_plus'],
['-', 'binary_plus'],
['*', 'binary_times'],
['/', 'binary_times'],
['%', 'binary_times'],
['**', 'binary_exp'],
['<', 'binary_relation'],
['<=', 'binary_relation'],
['==', 'binary_relation'],
['===', 'binary_relation'],
['!=', 'binary_relation'],
['!==', 'binary_relation'],
['>=', 'binary_relation'],
['>', 'binary_relation'],
['??', 'ternary'],
['instanceof', 'binary_relation'],
['in', 'binary_in'],
].map(([operator, precedence]) =>
prec.left(precedence, seq(
field('left', $._expression),
field('left', $.expression),
field('operator', operator),
field('right', $._expression)
field('right', $.expression)
))

@@ -810,19 +858,19 @@ )

unary_expression: $ => choice(...[
['!', PREC.NOT],
['~', PREC.NOT],
['-', PREC.NEG],
['+', PREC.NEG],
['typeof', PREC.TYPEOF],
['void', PREC.VOID],
['delete', PREC.DELETE],
['!', 'unary_not'],
['~', 'unary_not'],
['-', 'unary_not'],
['+', 'unary_not'],
['typeof', 'unary_void'],
['void', 'unary_void'],
['delete', 'unary_void'],
].map(([operator, precedence]) =>
prec.left(precedence, seq(
field('operator', operator),
field('argument', $._expression)
field('argument', $.expression)
))
)),
update_expression: $ => prec.left(PREC.INC, choice(
update_expression: $ => prec.left(choice(
seq(
field('argument', $._expression),
field('argument', $.expression),
field('operator', choice('++', '--'))

@@ -832,11 +880,11 @@ ),

field('operator', choice('++', '--')),
field('argument', $._expression)
field('argument', $.expression)
),
)),
sequence_expression: $ => prec(PREC.COMMA, seq(
field('left', $._expression),
sequence_expression: $ => seq(
field('left', $.expression),
',',
field('right', choice($.sequence_expression, $._expression))
)),
field('right', choice($.sequence_expression, $.expression))
),

@@ -847,2 +895,8 @@ //

// Here we tolerate unescaped newlines in double-quoted and
// single-quoted string literals.
// This is legal in typescript as jsx/tsx attribute values (as of
// 2020), and perhaps will be valid in javascript as well in the
// future.
//
string: $ => choice(

@@ -852,3 +906,3 @@ seq(

repeat(choice(
token.immediate(prec(PREC.STRING, /[^"\\\n]+|\\\r?\n/)),
token.immediate(prec(1, /[^"\\]+/)),
$.escape_sequence

@@ -861,3 +915,3 @@ )),

repeat(choice(
token.immediate(prec(PREC.STRING, /[^'\\\n]+|\\\r?\n/)),
token.immediate(prec(1, /[^'\\]+/)),
$.escape_sequence

@@ -881,3 +935,3 @@ )),

// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => token(prec(PREC.COMMENT, choice(
comment: $ => token(choice(
seq('//', /.*/),

@@ -889,3 +943,3 @@ seq(

)
))),
)),

@@ -915,3 +969,3 @@ template_string: $ => seq(

regex_pattern: $ => token.immediate(
regex_pattern: $ => token.immediate(prec(-1,
repeat1(choice(

@@ -929,3 +983,3 @@ seq(

))
),
)),

@@ -941,3 +995,3 @@ regex_flags: $ => token.immediate(/[a-z]+/),

const decimal_digits = /\d(_?\d)*/
const signed_integer = seq(optional(choice('-','+')), decimal_digits)
const signed_integer = seq(optional(choice('-', '+')), decimal_digits)
const exponent_part = seq(choice('e', 'E'), signed_integer)

@@ -973,6 +1027,5 @@

identifier: $ => {
const alpha = /[^\s0-9:;`"'@#.,|^&<=>+\-*/\\%?!~()\[\]{}\uFEFF\u2060\u200B\u00A0]|\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]+\}/
const alpha_numeric = /[^\s:;`"'@#.,|^&<=>+\-*/\\%?!~()\[\]{}\uFEFF\u2060\u200B\u00A0]|\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]+\}/
return token(seq(alpha, repeat(alpha_numeric)))
const alpha = /[^\x00-\x1F\s0-9:;`"'@#.,|^&<=>+\-*/\\%?!~()\[\]{}\uFEFF\u2060\u200B\u00A0]|\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]+\}/
const alphanumeric = /[^\x00-\x1F\s:;`"'@#.,|^&<=>+\-*/\\%?!~()\[\]{}\uFEFF\u2060\u200B\u00A0]|\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]+\}/
return token(seq(alpha, repeat(alphanumeric)))
},

@@ -993,7 +1046,7 @@

arguments: $ => prec(PREC.CALL, seq(
arguments: $ => seq(
'(',
commaSep(optional(choice($._expression, $.spread_element))),
commaSep(optional(choice($.expression, $.spread_element))),
')'
)),
),

@@ -1003,3 +1056,3 @@ decorator: $ => seq(

choice(
$._identifier_reference,
$.identifier,
alias($.decorator_member_expression, $.member_expression),

@@ -1010,10 +1063,5 @@ alias($.decorator_call_expression, $.call_expression)

_identifier_reference: $ => choice(
$.identifier,
alias($._reserved_identifier, $.identifier)
),
decorator_member_expression: $ => prec(PREC.MEMBER, seq(
decorator_member_expression: $ => prec('member', seq(
field('object', choice(
$._identifier_reference,
$.identifier,
alias($.decorator_member_expression, $.member_expression)

@@ -1025,5 +1073,5 @@ )),

decorator_call_expression: $ => prec(PREC.CALL, seq(
decorator_call_expression: $ => prec('call', seq(
field('function', choice(
$._identifier_reference,
$.identifier,
alias($.decorator_member_expression, $.member_expression)

@@ -1058,11 +1106,13 @@ )),

_formal_parameter: $ => choice(
// This negative dynamic precedence ensures that during error recovery,
// unfinished constructs are generally treated as literal expressions,
// not patterns.
pattern: $ => prec.dynamic(-1, choice(
$.identifier,
alias($._reserved_identifier, $.identifier),
$._destructuring_pattern,
$.assignment_pattern,
$.rest_parameter
),
$.rest_pattern
)),
rest_parameter: $ => seq(
rest_pattern: $ => seq(
'...',

@@ -1088,5 +1138,11 @@ choice(

':',
field('value', $._expression)
field('value', $.expression)
),
pair_pattern: $ => seq(
field('key', $._property_name),
':',
field('value', $.pattern)
),
_property_name: $ => choice(

@@ -1104,3 +1160,3 @@ alias(choice(

'[',
$._expression,
$.expression,
']'

@@ -1114,2 +1170,3 @@ ),

'static',
'export'
),

@@ -1121,8 +1178,8 @@

function commaSep1 (rule) {
function commaSep1(rule) {
return seq(rule, repeat(seq(',', rule)));
}
function commaSep (rule) {
function commaSep(rule) {
return optional(commaSep1(rule));
}
{
"name": "tree-sitter-javascript",
"version": "0.16.0",
"version": "0.19.0",
"description": "Javascript grammar for node-tree-sitter",
"main": "index.js",
"main": "bindings/node",
"keywords": [

@@ -16,3 +16,3 @@ "parser",

"devDependencies": {
"tree-sitter-cli": "^0.16.1"
"tree-sitter-cli": "^0.19.1"
},

@@ -19,0 +19,0 @@ "scripts": {

tree-sitter-javascript
===========================
[![Build Status](https://travis-ci.org/tree-sitter/tree-sitter-javascript.svg?branch=master)](https://travis-ci.org/tree-sitter/tree-sitter-javascript)
[![Build Status](https://github.com/tree-sitter/tree-sitter-javascript/workflows/build/badge.svg)](https://github.com/tree-sitter/tree-sitter-javascript/actions?query=workflow%3Abuild)
[![Build status](https://ci.appveyor.com/api/projects/status/42kwnan77rtf8144/branch/master?svg=true)](https://ci.appveyor.com/project/maxbrunsfeld/tree-sitter-javascript/branch/master)

@@ -6,0 +6,0 @@

[
{
"type": "_declaration",
"type": "declaration",
"named": true,

@@ -29,12 +29,56 @@ "subtypes": [

{
"type": "_destructuring_pattern",
"type": "expression",
"named": true,
"subtypes": [
{
"type": "array_pattern",
"type": "assignment_expression",
"named": true
},
{
"type": "object_pattern",
"type": "augmented_assignment_expression",
"named": true
},
{
"type": "await_expression",
"named": true
},
{
"type": "binary_expression",
"named": true
},
{
"type": "jsx_element",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
},
{
"type": "new_expression",
"named": true
},
{
"type": "primary_expression",
"named": true
},
{
"type": "ternary_expression",
"named": true
},
{
"type": "unary_expression",
"named": true
},
{
"type": "update_expression",
"named": true
},
{
"type": "yield_expression",
"named": true
}

@@ -44,27 +88,33 @@ ]

{
"type": "_expression",
"type": "pattern",
"named": true,
"subtypes": [
{
"type": "array",
"type": "array_pattern",
"named": true
},
{
"type": "arrow_function",
"type": "identifier",
"named": true
},
{
"type": "assignment_expression",
"type": "object_pattern",
"named": true
},
{
"type": "augmented_assignment_expression",
"type": "rest_pattern",
"named": true
},
}
]
},
{
"type": "primary_expression",
"named": true,
"subtypes": [
{
"type": "await_expression",
"type": "array",
"named": true
},
{
"type": "binary_expression",
"type": "arrow_function",
"named": true

@@ -101,14 +151,2 @@ },

{
"type": "jsx_element",
"named": true
},
{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",
"named": true
},
{
"type": "member_expression",

@@ -122,6 +160,2 @@ "named": true

{
"type": "new_expression",
"named": true
},
{
"type": "null",

@@ -155,7 +189,7 @@ "named": true

{
"type": "template_string",
"type": "super",
"named": true
},
{
"type": "ternary_expression",
"type": "template_string",
"named": true

@@ -172,16 +206,4 @@ },

{
"type": "unary_expression",
"named": true
},
{
"type": "undefined",
"named": true
},
{
"type": "update_expression",
"named": true
},
{
"type": "yield_expression",
"named": true
}

@@ -191,10 +213,6 @@ ]

{
"type": "_statement",
"type": "statement",
"named": true,
"subtypes": [
{
"type": "_declaration",
"named": true
},
{
"type": "break_statement",

@@ -212,2 +230,6 @@ "named": true

{
"type": "declaration",
"named": true
},
{
"type": "do_statement",

@@ -287,3 +309,3 @@ "named": true

{
"type": "_expression",
"type": "expression",
"named": true

@@ -307,3 +329,3 @@ },

{
"type": "_expression",
"type": "expression",
"named": true

@@ -327,7 +349,7 @@ },

{
"type": "_expression",
"type": "assignment_pattern",
"named": true
},
{
"type": "spread_element",
"type": "pattern",
"named": true

@@ -347,3 +369,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -388,3 +410,3 @@ },

{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true

@@ -401,2 +423,6 @@ },

{
"type": "object_pattern",
"named": true
},
{
"type": "parenthesized_expression",

@@ -416,3 +442,3 @@ "named": true

{
"type": "_expression",
"type": "expression",
"named": true

@@ -433,8 +459,4 @@ }

{
"type": "_destructuring_pattern",
"type": "pattern",
"named": true
},
{
"type": "shorthand_property_identifier",
"named": true
}

@@ -448,3 +470,3 @@ ]

{
"type": "_expression",
"type": "expression",
"named": true

@@ -487,3 +509,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -504,3 +526,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -520,3 +542,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -607,2 +629,6 @@ }

{
"type": "??",
"named": false
},
{
"type": "^",

@@ -634,3 +660,3 @@ "named": false

{
"type": "_expression",
"type": "expression",
"named": true

@@ -681,20 +707,4 @@ }

{
"type": "_expression",
"type": "expression",
"named": true
},
{
"type": "function",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "member_expression",
"named": true
},
{
"type": "super",
"named": true
}

@@ -724,3 +734,3 @@ ]

{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true

@@ -731,2 +741,6 @@ },

"named": true
},
{
"type": "object_pattern",
"named": true
}

@@ -858,3 +872,3 @@ ]

{
"type": "_expression",
"type": "expression",
"named": true

@@ -874,3 +888,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -934,3 +948,3 @@ }

{
"type": "_statement",
"type": "statement",
"named": true

@@ -953,2 +967,17 @@ }

{
"type": "else_clause",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "statement",
"named": true
}
]
}
},
{
"type": "empty_statement",

@@ -974,2 +1003,28 @@ "named": true,

{
"type": "export_specifier",
"named": true,
"fields": {
"alias": {
"multiple": false,
"required": false,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
}
},
{
"type": "export_statement",

@@ -983,3 +1038,3 @@ "named": true,

{
"type": "_declaration",
"type": "declaration",
"named": true

@@ -1014,3 +1069,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -1041,3 +1096,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -1077,3 +1132,3 @@ },

{
"type": "_statement",
"type": "statement",
"named": true

@@ -1088,3 +1143,3 @@ }

{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true

@@ -1101,2 +1156,6 @@ },

{
"type": "object_pattern",
"named": true
},
{
"type": "parenthesized_expression",

@@ -1116,3 +1175,3 @@ "named": true

{
"type": "_expression",
"type": "expression",
"named": true

@@ -1137,3 +1196,3 @@ },

{
"type": "_statement",
"type": "statement",
"named": true

@@ -1162,3 +1221,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -1205,6 +1264,2 @@ },

{
"type": "_destructuring_pattern",
"named": true
},
{
"type": "assignment_pattern",

@@ -1214,8 +1269,4 @@ "named": true

{
"type": "identifier",
"type": "pattern",
"named": true
},
{
"type": "rest_parameter",
"named": true
}

@@ -1378,3 +1429,3 @@ ]

{
"type": "_statement",
"type": "else_clause",
"named": true

@@ -1399,3 +1450,3 @@ }

{
"type": "_statement",
"type": "statement",
"named": true

@@ -1436,2 +1487,28 @@ }

{
"type": "import_specifier",
"named": true,
"fields": {
"alias": {
"multiple": false,
"required": false,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
}
},
{
"type": "import_statement",

@@ -1442,3 +1519,3 @@ "named": true,

"multiple": false,
"required": false,
"required": true,
"types": [

@@ -1564,2 +1641,6 @@ {

{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",

@@ -1584,3 +1665,3 @@ "named": true

{
"type": "_expression",
"type": "expression",
"named": true

@@ -1616,2 +1697,6 @@ },

{
"type": "jsx_fragment",
"named": true
},
{
"type": "jsx_self_closing_element",

@@ -1738,3 +1823,3 @@ "named": true

{
"type": "_statement",
"type": "statement",
"named": true

@@ -1769,16 +1854,4 @@ }

{
"type": "_expression",
"type": "expression",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "member_expression",
"named": true
},
{
"type": "super",
"named": true
}

@@ -1930,88 +2003,4 @@ ]

{
"type": "array",
"type": "primary_expression",
"named": true
},
{
"type": "arrow_function",
"named": true
},
{
"type": "class",
"named": true
},
{
"type": "false",
"named": true
},
{
"type": "function",
"named": true
},
{
"type": "generator_function",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "import",
"named": true
},
{
"type": "member_expression",
"named": true
},
{
"type": "meta_property",
"named": true
},
{
"type": "new_expression",
"named": true
},
{
"type": "null",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "object",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
},
{
"type": "regex",
"named": true
},
{
"type": "string",
"named": true
},
{
"type": "subscript_expression",
"named": true
},
{
"type": "template_string",
"named": true
},
{
"type": "this",
"named": true
},
{
"type": "true",
"named": true
},
{
"type": "undefined",
"named": true
}

@@ -2031,6 +2020,2 @@ ]

{
"type": "assignment_pattern",
"named": true
},
{
"type": "method_definition",

@@ -2055,2 +2040,36 @@ "named": true

{
"type": "object_assignment_pattern",
"named": true,
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "array_pattern",
"named": true
},
{
"type": "object_pattern",
"named": true
},
{
"type": "shorthand_property_identifier_pattern",
"named": true
}
]
},
"right": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression",
"named": true
}
]
}
}
},
{
"type": "object_pattern",

@@ -2064,20 +2083,16 @@ "named": true,

{
"type": "assignment_pattern",
"type": "object_assignment_pattern",
"named": true
},
{
"type": "method_definition",
"type": "pair_pattern",
"named": true
},
{
"type": "pair",
"type": "rest_pattern",
"named": true
},
{
"type": "shorthand_property_identifier",
"type": "shorthand_property_identifier_pattern",
"named": true
},
{
"type": "spread_element",
"named": true
}

@@ -2118,3 +2133,3 @@ ]

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2127,2 +2142,40 @@ }

{
"type": "pair_pattern",
"named": true,
"fields": {
"key": {
"multiple": false,
"required": true,
"types": [
{
"type": "computed_property_name",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "property_identifier",
"named": true
},
{
"type": "string",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "pattern",
"named": true
}
]
}
}
},
{
"type": "parenthesized_expression",

@@ -2136,3 +2189,3 @@ "named": true,

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2156,7 +2209,7 @@ },

{
"type": "_statement",
"type": "hash_bang_line",
"named": true
},
{
"type": "hash_bang_line",
"type": "statement",
"named": true

@@ -2198,3 +2251,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2233,3 +2286,3 @@ }

{
"type": "rest_parameter",
"type": "rest_pattern",
"named": true,

@@ -2242,3 +2295,3 @@ "fields": {},

{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true

@@ -2249,2 +2302,6 @@ },

"named": true
},
{
"type": "object_pattern",
"named": true
}

@@ -2263,3 +2320,3 @@ ]

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2283,3 +2340,3 @@ },

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2294,3 +2351,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2315,3 +2372,3 @@ },

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2331,3 +2388,3 @@ }

{
"type": "_statement",
"type": "statement",
"named": true

@@ -2362,3 +2419,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2377,8 +2434,4 @@ },

{
"type": "_expression",
"type": "expression",
"named": true
},
{
"type": "super",
"named": true
}

@@ -2417,3 +2470,3 @@ ]

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2433,3 +2486,3 @@ },

{
"type": "_statement",
"type": "statement",
"named": true

@@ -2449,3 +2502,3 @@ }

{
"type": "_statement",
"type": "statement",
"named": true

@@ -2510,3 +2563,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2530,3 +2583,3 @@ },

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2541,3 +2594,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2552,3 +2605,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2569,3 +2622,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2625,3 +2678,3 @@ },

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2676,3 +2729,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2722,3 +2775,3 @@ }

{
"type": "_destructuring_pattern",
"type": "array_pattern",
"named": true

@@ -2729,2 +2782,6 @@ },

"named": true
},
{
"type": "object_pattern",
"named": true
}

@@ -2738,3 +2795,3 @@ ]

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2755,3 +2812,3 @@ }

{
"type": "_statement",
"type": "statement",
"named": true

@@ -2782,3 +2839,3 @@ }

{
"type": "_statement",
"type": "statement",
"named": true

@@ -2809,3 +2866,3 @@ }

{
"type": "_expression",
"type": "expression",
"named": true

@@ -2853,2 +2910,6 @@ }

{
"type": "&&=",
"named": false
},
{
"type": "&=",

@@ -2998,2 +3059,14 @@ "named": false

{
"type": "?.",
"named": false
},
{
"type": "??",
"named": false
},
{
"type": "??=",
"named": false
},
{
"type": "@",

@@ -3051,2 +3124,6 @@ "named": false

{
"type": "comment",
"named": true
},
{
"type": "const",

@@ -3188,2 +3265,6 @@ "named": false

{
"type": "shorthand_property_identifier_pattern",
"named": true
},
{
"type": "statement_identifier",

@@ -3269,2 +3350,6 @@ "named": true

{
"type": "||=",
"named": false
},
{
"type": "}",

@@ -3271,0 +3356,0 @@ "named": false

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc