Socket
Socket
Sign inDemoInstall

eslint-module-utils

Package Overview
Dependencies
8
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.7.2 to 2.7.3

6

CHANGELOG.md

@@ -8,2 +8,7 @@ # Change Log

## v2.7.3 - 2022-01-26
### Fixed
- [Fix] `parse`: restore compatibility by making the return value `ast` again ([#2350], thanks [@ljharb])
## v2.7.2 - 2022-01-01

@@ -114,2 +119,3 @@

[#2350]: https://github.com/import-js/eslint-plugin-import/issues/2350
[#2343]: https://github.com/import-js/eslint-plugin-import/pull/2343

@@ -116,0 +122,0 @@ [#2261]: https://github.com/import-js/eslint-plugin-import/pull/2261

2

package.json
{
"name": "eslint-module-utils",
"version": "2.7.2",
"version": "2.7.3",
"description": "Core utilities to support eslint-plugin-import and other module-related plugins.",

@@ -5,0 +5,0 @@ "engines": {

@@ -35,2 +35,12 @@ 'use strict';

// this exists to smooth over the unintentional breaking change in v2.7.
// TODO, semver-major: avoid mutating `ast` and return a plain object instead.
function makeParseReturn(ast, visitorKeys) {
if (ast) {
ast.visitorKeys = visitorKeys;
ast.ast = ast;
}
return ast;
}
exports.default = function parse(path, content, context) {

@@ -77,6 +87,3 @@

ast = parserRaw.ast;
return {
ast,
visitorKeys: keysFromParser(parserPath, parser, parserRaw),
};
return makeParseReturn(ast, keysFromParser(parserPath, parser, parserRaw));
} catch (e) {

@@ -94,14 +101,8 @@ console.warn();

} else {
return {
ast,
visitorKeys: keysFromParser(parserPath, parser, undefined),
};
return makeParseReturn(ast, keysFromParser(parserPath, parser, undefined));
}
}
const keys = keysFromParser(parserPath, parser, undefined);
return {
ast: parser.parse(content, parserOptions),
visitorKeys: keys,
};
const ast = parser.parse(content, parserOptions);
return makeParseReturn(ast, keysFromParser(parserPath, parser, undefined));
};

@@ -108,0 +109,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc