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

req-requires

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

req-requires - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

.idea/.name

4

lib/req-requires.js
var requiredProperty = require('./requiredProperty');
var defaultAssertions = require('./defaultAssertions');
require('./defaultAssertions');

@@ -24,3 +24,3 @@ module.exports.setup = function(req, res, next){

self.property = function(name){
return new requiredProperty(this, name);
return new requiredProperty(name, self.getProperty(name), self.assertFail);
}

@@ -27,0 +27,0 @@

@@ -1,13 +0,13 @@

var requiredProperty = function(requiresContext, propertyName){
this.context = requiresContext;
var requiredProperty = function(propertyName, propertyValue, assertFailed){
this.name = propertyName;
this.value = this.context.getProperty(this.name);
this.value = propertyValue;
this.assert = function(assertionText, assertion){
if(!assertion())
assertFailed('Expected '+this.name+' '+assertionText);
}
return this;
}
requiredProperty.prototype.assert = function(assertionText, assertion){
if(!assertion())
this.context.assertFail('Expected '+this.name+' '+assertionText);
}
module.exports = requiredProperty;
{
"name": "req-requires",
"version": "0.0.6",
"version": "0.0.7",
"description": "Add assertions to ExpressJS middleware",

@@ -5,0 +5,0 @@ "main": "./lib/req-requires.js",

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