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

ast-types

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-types - npm Package Compare versions

Comparing version 0.4.12 to 0.4.13

49

def/es6.js

@@ -63,7 +63,12 @@ require("./core");

// This would be the ideal definition for ModuleSpecifier, but alas we
// can't expect ASTs parsed by Esprima to use this custom subtype:
def("ModuleSpecifier")
.bases("Literal")
.build("value")
.bases("Specifier", "Literal")
// .build("value") // Make it abstract/non-buildable for now.
.field("value", isString);
// Instead we must settle for a cheap type alias:
var ModuleSpecifier = def("Literal");
def("ModuleDeclaration")

@@ -73,3 +78,3 @@ .bases("Declaration")

.field("id", or(def("Literal"), def("Identifier")))
.field("source", or(def("ModuleSpecifier"), null))
.field("source", or(ModuleSpecifier, null))
.field("body", or(def("BlockStatement"), null));

@@ -146,13 +151,10 @@

// Specifier and NamedSpecifier are abstract non-standard types that I
// introduced for definitional convenience.
// Specifier and NamedSpecifier are non-standard types that I introduced
// for definitional convenience.
def("Specifier").bases("Node");
def("NamedSpecifier")
.bases("Specifier")
// Note: this abstract type is intentionally not buildable.
.field("id", def("Identifier"))
.field("name", or(def("Identifier"), null), defaults["null"]);
// Like NamedSpecifier, except type:"ExportSpecifier" and buildable.
// export {<id [as name]>} [from ...];
def("ExportSpecifier")

@@ -162,3 +164,2 @@ .bases("NamedSpecifier")

// export <*> from ...;
def("ExportBatchSpecifier")

@@ -168,4 +169,2 @@ .bases("Specifier")

// Like NamedSpecifier, except type:"ImportSpecifier" and buildable.
// import {<id [as name]>} from ...;
def("ImportSpecifier")

@@ -175,14 +174,2 @@ .bases("NamedSpecifier")

// import <* as id> from ...;
def("ImportNamespaceSpecifier")
.bases("Specifier")
.build("id")
.field("id", def("Identifier"));
// import <id> from ...;
def("ImportDefaultSpecifier")
.bases("Specifier")
.build("id")
.field("id", def("Identifier"));
def("ExportDeclaration")

@@ -194,4 +181,3 @@ .bases("Declaration")

def("Declaration"),
def("Expression"), // Implies default.
null
def("Expression") // Implies default.
))

@@ -202,13 +188,10 @@ .field("specifiers", [or(

)], defaults.emptyArray)
.field("source", or(def("ModuleSpecifier"), null), defaults["null"]);
.field("source", or(ModuleSpecifier, null), defaults["null"]);
def("ImportDeclaration")
.bases("Declaration")
.build("specifiers", "source")
.field("specifiers", [or(
def("ImportSpecifier"),
def("ImportNamespaceSpecifier"),
def("ImportDefaultSpecifier")
)], defaults.emptyArray)
.field("source", def("ModuleSpecifier"));
.build("specifiers", "kind", "source")
.field("specifiers", [def("ImportSpecifier")])
.field("kind", or("named", "default", null))
.field("source", ModuleSpecifier);

@@ -215,0 +198,0 @@ def("TaggedTemplateExpression")

@@ -21,3 +21,3 @@ {

],
"version": "0.4.12",
"version": "0.4.13",
"homepage": "http://github.com/benjamn/ast-types",

@@ -24,0 +24,0 @@ "repository": {

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