New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dependency-check

Package Overview
Dependencies
Maintainers
3
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-check - npm Package Compare versions

Comparing version 5.0.0-5 to 5.0.0-6

1

lib/check.d.ts

@@ -5,2 +5,3 @@ export type CheckOptions = {

noDefaultEntries?: boolean | undefined;
ignoreUnknownExtensions?: boolean | undefined;
extensions?: string[] | import("./extensions").ExtensionsInput | undefined;

@@ -7,0 +8,0 @@ detective?: string | import("./extensions").Detective | undefined;

@@ -16,2 +16,3 @@ 'use strict'

* @property {boolean} [noDefaultEntries]
* @property {boolean} [ignoreUnknownExtensions]
* @property {import('./extensions').ExtensionsInput|string[]} [extensions]

@@ -34,2 +35,3 @@ * @property {import('./extensions').Detective|string} [detective]

extensions,
ignoreUnknownExtensions,
noDefaultEntries,

@@ -56,2 +58,3 @@ path: targetPath

extensions: getExtensions(extensions, detective),
ignoreUnknownExtensions,
noDefaultEntries: noDefaultEntries || (targetEntries && targetEntries.length !== 0),

@@ -58,0 +61,0 @@ 'package': pkg,

@@ -16,8 +16,10 @@ /* eslint-disable no-console, unicorn/no-process-exit */

'default-entries': true,
'ignore-unknown-extensions': false,
verbose: false,
json: false,
},
'boolean': ['missing', 'unused', 'dev', 'version', 'ignore', 'default-entries', 'verbose', 'json'],
'boolean': ['missing', 'unused', 'dev', 'version', 'ignore', 'ignore-unknown-extensions', 'default-entries', 'verbose', 'json'],
alias: {
'ignore-module': 'i',
'ignore-unknown-extensions': 'u',
extensions: 'e',

@@ -42,2 +44,3 @@ json: 'j',

console.log("--ignore-module, -i Won't tell you about these module names when missing or unused. Supports globbing")
console.log("--ignore-unknown-extension, -u Won't fail on file extensions that are missing detectives")
console.log("--no-default-entries Won't parse your main and bin entries from package.json even when a package.json or module folder has been defined")

@@ -104,2 +107,3 @@ console.log('--detective Requireable path containing an alternative implementation of the detective module that supports alternate syntaxes')

entries: args._,
ignoreUnknownExtensions: args['ignore-unknown-extensions'],
noDefaultEntries: !args['default-entries'],

@@ -106,0 +110,0 @@ extensions: extensions(args['e']),

@@ -6,2 +6,3 @@ export type ParseOptions = {

builtins: undefined | boolean;
ignoreUnknownExtensions: undefined | boolean;
noDefaultEntries: undefined | boolean;

@@ -8,0 +9,0 @@ entries: undefined | string[];

4

lib/parse.js

@@ -13,2 +13,3 @@ 'use strict'

* @property {undefined|boolean} builtins
* @property {undefined|boolean} ignoreUnknownExtensions
* @property {undefined|boolean} noDefaultEntries

@@ -34,2 +35,3 @@ * @property {undefined|string[]} entries

extensions,
ignoreUnknownExtensions = false,
noDefaultEntries,

@@ -64,3 +66,3 @@ 'package': pkg,

for (const file of paths) {
lookups.push(resolveDep(file, extensions, { deps, seen, core }))
lookups.push(resolveDep(file, extensions, { core, deps, ignoreUnknownExtensions, seen }))
}

@@ -67,0 +69,0 @@

export type DependencyContext = {
core: Set<string>;
deps: Set<string>;
ignoreUnknownExtensions: boolean;
seen: Set<string>;
core: Set<string>;
};
export function resolveDep(file: string, extensions: import('./extensions').Extensions, { core, deps, seen }: DependencyContext): Promise<void>;
export function resolveDep(file: string, extensions: import('./extensions').Extensions, { core, deps, ignoreUnknownExtensions, seen }: DependencyContext): Promise<void>;
//# sourceMappingURL=resolve-dependency.d.ts.map

@@ -10,2 +10,10 @@ 'use strict'

/**
* @typedef DependencyContext
* @property {Set<string>} core
* @property {Set<string>} deps
* @property {boolean} ignoreUnknownExtensions
* @property {Set<string>} seen
*/
/** @type {(file: string, options: import('resolve').AsyncOpts) => Promise<string>} */

@@ -25,3 +33,2 @@ const promisedResolveModule = (file, options) => new Promise((resolve, reject) => {

const isNotRelative = (file) => isRelative(file) && file[0] !== '.'
/** @typedef {{ deps: Set<string>, seen: Set<string>, core: Set<string> }} DependencyContext */

@@ -34,3 +41,3 @@ /**

*/
const getDeps = async function (file, extensions, { core, deps, seen }) {
const getDeps = async function (file, extensions, { core, deps, ignoreUnknownExtensions, seen }) {
const ext = path.extname(file)

@@ -40,3 +47,7 @@ const detective = extensions[ext]

if (typeof detective !== 'function') {
throw new TypeError('Detective function missing for "' + file + '"')
if (ignoreUnknownExtensions) {
return
} else {
throw new TypeError('Detective function missing for "' + file + '"')
}
}

@@ -71,3 +82,3 @@

await Promise.all(relatives.map(name => resolveDep(name, extensions, { deps, seen, core })))
await Promise.all(relatives.map(name => resolveDep(name, extensions, { core, deps, ignoreUnknownExtensions, seen })))
}

@@ -81,3 +92,3 @@

*/
const resolveDep = async function (file, extensions, { core, deps, seen }) {
const resolveDep = async function (file, extensions, { core, deps, ignoreUnknownExtensions, seen }) {
if (isNotRelative(file)) return

@@ -90,3 +101,3 @@

return getDeps(resolvedPath, extensions, { deps, seen, core })
return getDeps(resolvedPath, extensions, { core, deps, ignoreUnknownExtensions, seen })
}

@@ -93,0 +104,0 @@

{
"name": "dependency-check",
"version": "5.0.0-5",
"version": "5.0.0-6",
"description": "checks which modules you have used in your code and then makes sure they are listed as dependencies in your package.json",

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

@@ -5,8 +5,7 @@ # dependency-check

![Node CI](https://github.com/dependency-check-team/dependency-check/workflows/Node%20CI/badge.svg)
![Static code analysis](https://github.com/dependency-check-team/dependency-check/workflows/Static%20code%20analysis/badge.svg)
[![dependencies Status](https://david-dm.org/dependency-check-team/dependency-check/status.svg)](https://david-dm.org/dependency-check-team/dependency-check)
[![Known Vulnerabilities](https://snyk.io/test/github/dependency-check-team/dependency-check/badge.svg?targetFile=package.json)](https://snyk.io/test/github/dependency-check-team/dependency-check?targetFile=package.json)
[![Node CI](https://github.com/dependency-check-team/dependency-check/actions/workflows/nodejs.yml/badge.svg)](https://github.com/dependency-check-team/dependency-check/actions/workflows/nodejs.yml)
[![Linting](https://github.com/dependency-check-team/dependency-check/actions/workflows/lint.yml/badge.svg)](https://github.com/dependency-check-team/dependency-check/actions/workflows/lint.yml)
[![Exits silently on unsupported](https://github.com/dependency-check-team/dependency-check/actions/workflows/exit-silently-on-unsupported.yml/badge.svg)](https://github.com/dependency-check-team/dependency-check/actions/workflows/exit-silently-on-unsupported.yml)
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)

@@ -17,3 +16,3 @@ ## requirements for maintained majors

* `5.x` supports Node.js 12 and later
* `5.x` supports Node.js 14 and later
* `4.x` supports Node.js 10 and later

@@ -83,2 +82,6 @@ * `3.x` supports Node.js 6 and later

### --ignore-unknown-extensions, -u
won't fail when finding imported files with file extensions that no detectives has been registered for
### --no-default-entries

@@ -85,0 +88,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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