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

eslint-module-utils

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-module-utils - npm Package Compare versions

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc