New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

restwave

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restwave - npm Package Compare versions

Comparing version
2.2.2
to
2.3.2
+13
-2
package.json
{
"name": "restwave",
"version": "2.2.2",
"version": "2.3.2",
"description": "simplified version of express",

@@ -15,3 +15,14 @@ "main": "./src/index.js",

},
"keywords": ["RestWave" ,"framework" ,"web", "http", "tcp", "rest", "restful", "router", "app", "api"],
"keywords": [
"RestWave",
"framework",
"web",
"http",
"tcp",
"rest",
"restful",
"router",
"app",
"api"
],
"author": "",

@@ -18,0 +29,0 @@ "license": "ISC",

@@ -97,2 +97,6 @@ import Methods from "./methods/method.js";

}
} else if (method === "PUT" && currentMiddleware.method === method) {
if (!this.#handleMethodRequests(currentMiddleware, next)) {
next();
}
} else if (currentMiddleware.method === "ANY") {

@@ -167,3 +171,3 @@ if (!this.#handleMethodRequests(currentMiddleware, next)) {

statusCodes[this.#response.statusCode]
}\r\nCache-Control: no-cache\r\nAccess-Control-Allow-Methods: POST\r\nAccess-Control-Allow-Origin: *\r\nContent-Type: application/json\r\nContent-Length: ${
}\r\nAccess-Control-Allow-Origin: *\r\nContent-Type: application/json\r\nContent-Length: ${
this.#contentLength

@@ -170,0 +174,0 @@ }${content}`;

+18
-15

@@ -74,18 +74,17 @@ import Router from "../router/router.js";

}
} else {
for (let i = 1; i < args.length; i++) {
if (args[i] instanceof Router) {
args[i].getRoutingMiddlewares().forEach((routingMiddleware) => {
this.#addMiddlewares(
routingMiddleware.method,
args[0] + routingMiddleware.route,
routingMiddleware.cb
);
});
} else {
this.#addMiddlewares("ANY", args[0], args[i]);
}
}
}
else{
for(let i=1;i<args.length;i++){
if (args[i] instanceof Router) {
args[i].getRoutingMiddlewares().forEach((routingMiddleware) => {
this.#addMiddlewares(
routingMiddleware.method,
args[0] + routingMiddleware.route,
routingMiddleware.cb
);
});
} else {
this.#addMiddlewares("ANY", args[0], args[i]);
}
}
}
}

@@ -133,2 +132,6 @@

put(route, cb) {
this.#addMiddlewares("PUT", route, cb);
}
/**

@@ -135,0 +138,0 @@ * Return the list of total middlewares.

@@ -35,9 +35,9 @@ class Router {

const function3 = (args)=>{
const route = args[0];
for(let i=1;i<args.length;i++){
const cb = args[i];
this.#routingMiddlewares.push({ method, route, cb });
}
}
const function3 = (args) => {
const route = args[0];
for (let i = 1; i < args.length; i++) {
const cb = args[i];
this.#routingMiddlewares.push({ method, route, cb });
}
};

@@ -48,6 +48,5 @@ if (args.length === 1) {

return funciton2(args[0], args[1]);
} else {
return function3(args);
}
else{
return function3(args);
}
}

@@ -103,4 +102,16 @@

}
put(...args) {
if (this.#isApp) {
this.#isApp.use({
method: "PUT",
route: this.#currentRoute,
cb: args[0],
});
return this;
}
return this.#addRoutingMiddleware(args, "PUT");
}
}
export default Router;

@@ -8,2 +8,15 @@ import RestWave from "./index.js";

});
app.route("/sike").put((req, res) => {
res.json("in put ");
});
const router = RestWave.router();
console.log(router);
router.route("/r").put((req, res) => {
res.json("in route put");
});
app.use(router);
app.post("/", (req, res) => {

@@ -10,0 +23,0 @@ res.json({ name: " adarsh", last: "shahi", age: 21 }, 201);