Skip to content

Commit

Permalink
fix: dropping unused notice keys
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Mar 10, 2024
1 parent 149eabd commit 28f68dc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const { installedCheck } = await import('installed-check-core');
## Syntax

```javascript
const { errors, warnings, notices } = await installedCheck({
const { errors, warnings } = await installedCheck({
path: 'path/to/module',
engineCheck: true,
engineIgnores: ['foo'],
Expand All @@ -58,7 +58,6 @@ A Promise resolving to:

```javascript
{
notices: ['123'],
warnings: ['Abc'],
errors: ['Xyz']
};
Expand Down
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { checkEngineVersions } from './lib/check-engine-versions.js';
* @typedef InstalledCheckResult
* @property {string[]} errors
* @property {string[]} warnings
* @property {string[]} notices
*/

/**
Expand Down Expand Up @@ -85,5 +84,5 @@ export async function installedCheck (options) {
warnings = [...warnings, ...engineResult.warnings];
}

return { errors, warnings, notices: [] };
return { errors, warnings };
}
3 changes: 1 addition & 2 deletions lib/check-engine-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { checkVersionRanges } from './check-version-ranges.js.js';
* @param {import('read-pkg').NormalizedPackageJson} mainPackage
* @param {Map<string, import('list-installed').NormalizedPackageJson>} installedDependencies
* @param {Omit<import('./check-version-ranges.js.js').VersionRangesOptions, 'expectedInDependencies'>} options
* @returns {{ errors: string[], warnings: string[], notices: string[] }}
* @returns {{ errors: string[], warnings: string[] }}
*/
export function checkEngineVersions (mainPackage, installedDependencies, options) {
/** @type {string[]} */
Expand Down Expand Up @@ -50,6 +50,5 @@ export function checkEngineVersions (mainPackage, installedDependencies, options
return {
errors: [...new Set(errors), ...summaries],
warnings: [...new Set(warnings)],
notices: [],
};
}
5 changes: 0 additions & 5 deletions test/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ describe('installedCheck()', () => {
})
.should.eventually.deep.equal({
errors: [],
notices: [],
warnings: [],
});
});
Expand All @@ -67,7 +66,6 @@ describe('installedCheck()', () => {
})
.should.eventually.deep.equal({
errors: [],
notices: [],
warnings: [],
});
});
Expand All @@ -89,7 +87,6 @@ describe('installedCheck()', () => {
'Combined "engines.node" needs to be narrower: >=10.0.0',
'Combined "engines.abc" needs to be narrower: >=1.0.0',
],
notices: [],
warnings: [
"invalid-alias-syntax: Invalid npm alias. Can't match against dependency version",
"invalid-dependency-definition: Target version is empty. Can't match against dependency version",
Expand Down Expand Up @@ -118,7 +115,6 @@ describe('installedCheck()', () => {
'foo: Narrower "engines.node" is needed: >=8.0.0',
'Combined "engines.node" needs to be narrower: >=8.0.0',
],
notices: [],
warnings: [
'Missing "engines.node" in main package',
],
Expand All @@ -136,7 +132,6 @@ describe('installedCheck()', () => {
'foo: Incompatible "engines.node" requirement: <6.0.0',
'Incompatible combined "engines.node" requirements.',
],
notices: [],
warnings: [],
});
});
Expand Down

0 comments on commit 28f68dc

Please sign in to comment.