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

mvcjs

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mvcjs - npm Package Compare versions

Comparing version 0.1.0-beta-26 to 0.1.0-beta-27

23

framework/core/request.js

@@ -51,2 +51,3 @@ "use strict";

this.body = '';
this.isERROR = false;
// body and isForwarded can be overriden

@@ -60,3 +61,2 @@ core.extend(this, config);

this.isPromiseChainStopped = false;
this.isERROR = false;
this.isRendered = false;

@@ -415,2 +415,7 @@ this.id = this._uuid();

var request;
// stop current chain!!!
this.stopPromiseChain();
if (response instanceof Error && !this.isERROR && !!router.getErrorRoute()) {

@@ -422,5 +427,15 @@ if (response.code) {

}
this.isERROR = true;
this.module = null; // refresh module state because we are returning route
return this._resolveRoute([router.getErrorRoute(), response]);
// return new request
request = new Request({
request: this.request,
response: this.response,
isForwarded: true,
body: this.body,
isERROR: true
}, router.getErrorRoute());
// pass exception response over parsed url query as query parameter
request.parsedUrl.query.exception = response;
// return parsed request
return request.parse();
} else if (response.trace) {

@@ -427,0 +442,0 @@ this.addHeader('Content-Type', 'text/plain');

22

framework/di.js

@@ -130,2 +130,18 @@ "use strict";

* @author Igor Ivanovic
* @method DI#refereshNodeModuleCache
*
* @description
* Reset file cache
*/
refereshNodeModuleCache: function DI_refereshNodeModuleCache(file) {
var path = this.getFilePath(file),
key = require.resolve(path + '.js');
// because all modules in node are cached while executing tests we want to delete cached version
delete require.cache[key];
return path;
},
/**
* @since 0.0.1
* @author Igor Ivanovic
* @method DI#mockLoad

@@ -147,8 +163,4 @@ *

if (Type.isString(file)) {
// get file
path = this.getFilePath(file);
// because all modules in node are cached while executing tests we want to delete cached version
delete require.cache[require.resolve(path + '.js')];
// do require
return require(path);
return require(this.refereshNodeModuleCache(file));

@@ -155,0 +167,0 @@ } else if (Type.isFunction(file)) {

@@ -5,3 +5,3 @@ {

"description": "Powerful lightweight mvc framework for nodejs",
"version": "0.1.0-beta-26",
"version": "0.1.0-beta-27",
"dependencies" : {

@@ -8,0 +8,0 @@ "mongoose": "3.8.x",

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