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

module-connector

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-connector - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

54

index.js

@@ -27,5 +27,57 @@ 'use strict'

};
writeMessageAndReponse( response, message) {
if( typeof response == "string" && typeof message != "string" ) {
message = response;
} else {
this.response = response;
};
if( typeof message != "undefined"){
this.message = message;
}
return this
};
successFunctions ( response, message, code ) {
this.code = code;
this.success = true;
return this.writeMessageAndReponse( response, message);
};
failedFunctions ( response, message, code ) {
this.code = code;
this.success = false;
return this.writeMessageAndReponse( response, message);
};
ok ( response, message) {
return this.successFunctions( response, message, 200);
};
created ( response, message) {
return this.successFunctions( response, message, 201);
};
badRequest ( response, message) {
return this.failedFunctions( response, message, 400);
};
unauthorized ( response, message) {
return this.failedFunctions( response, message, 401);
};
forbidden ( response, message) {
return this.failedFunctions( response, message, 403);
};
notFound ( response, message) {
return this.failedFunctions( response, message, 404);
};
conflict ( response, message) {
return this.failedFunctions( response, message, 409);
};
}
module.exports = moduleConnector;

4

package.json
{
"name": "module-connector",
"version": "1.0.2",
"version": "1.0.3",
"description": "object used to connect different backend and frontend components. in order to better control the different scenarios that could occur with the communication of these",
"main": "index.js",
"main": "./index.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

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