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

dep-validate

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dep-validate - npm Package Compare versions

Comparing version 1.1.5 to 1.2.0

9

lib/dep-validate.js

@@ -249,3 +249,4 @@ var PluginError = require('gulp-util').PluginError;

function _processDeps(deps, enforce, opts) {
var allowHardcoded = opts.allowHardcoded !== false;
var allowHardcoded = opts.hardcoded === 'allow' || opts.allowHardcoded;
var forceHardcoded = opts.hardcoded === 'force';
var excludedDeps = opts.excluded || [];

@@ -277,3 +278,3 @@

if (!rangeMatch.test(firstCharacter)) {
if (/^[a-zA-Z/.~]/.test(firstCharacter) || allowHardcoded) {
if (/^[a-zA-Z/.~]/.test(firstCharacter) || allowHardcoded || forceHardcoded) {
return;

@@ -284,2 +285,6 @@ }

if (forceHardcoded) {
return emitError(dependencyName, dependencyVersion, '');
}
if (dependencyVersion.slice(0, enforce.length) !== enforce) {

@@ -286,0 +291,0 @@ emitError(dependencyName, dependencyVersion, enforce);

{
"name": "dep-validate",
"version": "1.1.5",
"version": "1.2.0",
"description": "Dependency verification for npm packages with Gulp support",

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

@@ -18,3 +18,3 @@ # dep-validate

```bash
$ dep-validate --dependencies '~' --devDependencies '^' --exclude pkg1 --exclude pkg2 --hardcoded=allow --only production --only development --packageFile ./package.json
$ dep-validate --dependencies '~' --devDependencies '^' --exclude pkg1 --exclude pkg2 --hardcoded=allow --only production --only development --packageFile ./package.json
```

@@ -37,6 +37,6 @@

var opts = {
allowHardcoded: true, // allow hardcoded versions without verification
dependencies: '~', // the range to enforce on all "dependencies"
devDependencies: '^', // the range to enforce on all "devDependencies"
exluded: [ 'my-package' ], // packages to exclude from validation
hardcoded: 'allow|force', // allow or force hardcoded versions
packageFile: './package.json', // the package.json file to read and validate

@@ -43,0 +43,0 @@ only: [ 'production', 'development' ] // only check prod/dev dependencies

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