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

angular-estree-parser

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-estree-parser - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="2.2.1"></a>
## [2.2.1](https://github.com/ikatyang/angular-estree-parser/compare/v2.2.0...v2.2.1) (2020-09-09)
### Bug Fixes
* **peer-deps:** support `[@angular](https://github.com/angular)/compiler@10.1` ([#204](https://github.com/ikatyang/angular-estree-parser/issues/204)) ([ebe2679](https://github.com/ikatyang/angular-estree-parser/commit/ebe2679))
<a name="2.2.0"></a>

@@ -7,0 +17,0 @@ # [2.2.0](https://github.com/ikatyang/angular-estree-parser/compare/v2.1.0...v2.2.0) (2020-08-12)

@@ -7,2 +7,12 @@ "use strict";

switch (type) {
case 'Unary': {
// @ts-ignore: there is no `Unary` in `@angular/compiler@<10.1.0`
const { operator, expr } = node;
const tArgument = _t(expr);
return _c('UnaryExpression', {
prefix: true,
argument: tArgument,
operator: operator,
}, node.span, { hasParentParens: isInParentParens });
}
case 'Binary': {

@@ -12,2 +22,4 @@ const { left, operation, right } = node;

const isPrefixMinus = left.span.start === left.span.end; // -1 === 0 - 1
// `@angular/compiler` changed this to `Unary` since `v10.1.0`
// istanbul ignore next
if (isPrefixAdd || isPrefixMinus) {

@@ -14,0 +26,0 @@ const tArgument = left.span.start === left.span.end

12

lib/utils.js

@@ -50,5 +50,9 @@ "use strict";

const ast = rawAst.expressions[0];
const visited = new Set();
visitSpan(ast, span => {
span.start -= prefix.length;
span.end -= prefix.length;
if (!visited.has(span)) {
span.start -= prefix.length;
span.end -= prefix.length;
visited.add(span);
}
});

@@ -99,2 +103,6 @@ return { ast, comments };

function getNgType(node) {
// @ts-ignore: there is no `Unary` in `@angular/compiler@<10.1.0`
if (ng.Unary && node instanceof ng.Unary) {
return 'Unary';
}
if (node instanceof ng.Binary) {

@@ -101,0 +109,0 @@ return 'Binary';

4

package.json
{
"name": "angular-estree-parser",
"version": "2.2.0",
"version": "2.2.1",
"description": "A parser that converts Angular source code into an ESTree-compatible form",

@@ -29,3 +29,3 @@ "keywords": [],

"devDependencies": {
"@angular/compiler": "10.0.2",
"@angular/compiler": "10.1.0",
"@babel/code-frame": "7.8.3",

@@ -32,0 +32,0 @@ "@babel/parser": "7.6.4",

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