🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

acorn

Package Overview
Dependencies
Maintainers
3
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn - npm Package Compare versions

Comparing version

to
8.15.0

14

CHANGELOG.md

@@ -0,1 +1,15 @@

## 8.15.0 (2025-06-08)
### New features
Support `using` and `await using` syntax.
The `AnyNode` type is now defined in such a way that plugins can extend it.
### Bug fixes
Fix an issue where the `bigint` property of literal nodes for non-decimal bigints had the wrong format.
The `acorn` CLI tool no longer crashes when emitting a tree that contains a bigint.
## 8.14.1 (2025-03-05)

@@ -2,0 +16,0 @@

23

dist/acorn.d.ts

@@ -172,3 +172,3 @@ export interface Node {

declarations: Array<VariableDeclarator>
kind: "var" | "let" | "const"
kind: "var" | "let" | "const" | "using" | "await using"
}

@@ -576,4 +576,21 @@

export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportAttribute | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
/**
* This interface is only used for defining {@link AnyNode}.
* It exists so that it can be extended by plugins:
*
* @example
* ```typescript
* declare module 'acorn' {
* interface NodeTypes {
* pluginName: FirstNode | SecondNode | ThirdNode | ... | LastNode
* }
* }
* ```
*/
interface NodeTypes {
core: Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportAttribute | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
}
export type AnyNode = NodeTypes[keyof NodeTypes]
export function parse(input: string, options: Options): Program

@@ -588,3 +605,3 @@

export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | "latest"
export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest"

@@ -591,0 +608,0 @@ export interface Options {

2

dist/bin.js

@@ -80,3 +80,3 @@ 'use strict';

}
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
if (!silent) { console.log(JSON.stringify(result, function (_, value) { return typeof value === "bigint" ? null : value; }, compact ? null : 2)); }
}

@@ -83,0 +83,0 @@

@@ -19,3 +19,3 @@ {

},
"version": "8.14.1",
"version": "8.15.0",
"engines": {

@@ -22,0 +22,0 @@ "node": ">=0.4.0"

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