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

kequapp

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kequapp - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

20

dist/body/normalize-body.js

@@ -21,4 +21,3 @@ "use strict";

if (Array.isArray(result[key])) {
const value = result[key][0];
result[key] = value;
result[key] = result[key][0];
}

@@ -45,7 +44,7 @@ }

continue;
let failed = false;
if (arrays.includes(key)) {
const values = result[key].map(toNumber);
result[key] = values;
failed = values.some(value => isNaN(value));
if (!values.some(value => isNaN(value)))
continue;
}

@@ -55,10 +54,9 @@ else {

result[key] = value;
failed = isNaN(value);
if (!isNaN(value))
continue;
}
if (failed) {
throw ex_1.default.UnprocessableEntity(`Value ${key} must be a number`, {
body,
numbers
});
}
throw ex_1.default.UnprocessableEntity(`Value ${key} must be a number`, {
body,
numbers
});
}

@@ -65,0 +63,0 @@ for (const key of booleans) {

@@ -57,3 +57,3 @@ "use strict";

}
throw ex_1.default.NotFound();
throw ex_1.default.NotFound(undefined, { location });
}

@@ -73,3 +73,3 @@ "use strict";

return true;
if (parts[i][0] !== ':' && parts[i] !== clientParts[i])
if (parts[i] !== clientParts[i] && parts[i][0] !== ':')
return false;

@@ -76,0 +76,0 @@ }

@@ -7,6 +7,4 @@ /// <reference types="node" />

export interface IKequapp extends RequestListener {
(config: TConfigInput, ...handles: THandle[]): IKequapp;
(...handles: THandle[]): IKequapp;
add(...routers: IAddable[]): IKequapp;
config: TConfig;
}

@@ -13,0 +11,0 @@ export declare type TConfigInput = {

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

exports.validateType = validateType;
const PATHNAME_REGEX = /^(?:\/:[^/: *]+|\/[^/: *]*|\/\*{2})+$/;
function validatePathname(topic, name, isWild = false) {

@@ -51,2 +52,5 @@ if (topic !== undefined) {

}
if (!topic.match(PATHNAME_REGEX)) {
throw new Error(`${name} invalid format '${topic}'`);
}
}

@@ -53,0 +57,0 @@ }

{
"name": "kequapp",
"version": "0.4.1",
"version": "0.4.2",
"description": "Versatile, non-intrusive webapp framework",

@@ -5,0 +5,0 @@ "main": "dist/main.js",

@@ -11,3 +11,3 @@ <img alt="kequapp" src="https://github.com/Kequc/kequapp/blob/0.2-wip/logo.png?raw=true" width="142" height="85" />

Intended to be simple to learn and use. While also being powerful and letting us interject any time we need.
Intended to be simple to learn and use. While being powerful and allowing us to interject any time we need.

@@ -22,4 +22,4 @@ **Features**

* Async await everywhere
* Unit testing tool
* Does not modify Node features or functionality
* Unit testing tool
* No dependencies <3

@@ -33,19 +33,19 @@

**handle**
#### **handle**
A route is composed of one or more handles which run in sequence. Handles are responsible for all of the heavy lifting and contain most of our application code.
**route**
#### **route**
Each route is a self contained collection of handles, these direct the lifecycle of a request at a given url.
**branch**
#### **branch**
Used for distributing behavior across multiple routes and helping to stay organized during development. We might separate a json api from client facing pages for example, and want different behaviors which are common to either area.
**error handler**
#### **error handler**
An appropriate error handler is invoked whenever a handle throws an exception. They behave much the same as a handle but should not throw an exception.
**renderer**
#### **renderer**

@@ -275,3 +275,3 @@ An appropriate renderer is invoked whenever a handle or error handler returns a value apart from `undefined`. These behave much the same as a handle but are always the last step of a request and should deliver a response to the client.

* **`logger`**
#### **`logger`**

@@ -282,3 +282,3 @@ If a boolean is provided the app will use either the default logger (`console`) if `true`, or a silent logger. The silent logger ignores all logging inside the application.

* **`autoHead`**
#### **`autoHead`**

@@ -402,11 +402,11 @@ Disabling `autoHead` will mean that the application doesn't automatically use `GET` routes when `HEAD` is requested as described in [more detail](#head-requests) later.

* **`req`**
#### **`req`**
Node's [`ClientRequest`](https://nodejs.org/api/http.html#class-httpclientrequest) object. It is not modified by this framework so we can rely on the official documentation to use it. This represents the client request.
* **`res`**
#### **`res`**
Node's [`ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) object. It is not modified by this framework so we can rely on the official documentation to use it. This represents the server response.
* **`url`**
#### **`url`**

@@ -427,7 +427,7 @@ If we need to know more about what the client is looking at in the url bar we can do so here. It is a [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) instance generated from the `req` object.

* **`methods`**
#### **`methods`**
An array of methods available in our app at the current url.
* **`context`**
#### **`context`**

@@ -438,3 +438,3 @@ A place to store variables derived by handles, we might use these variables elsewhere in our code. Changes can be made here whenever we want and it may be populated with anything.

* **`params`**
#### **`params`**

@@ -445,7 +445,7 @@ When defining a route we can specify parameters to extract by prefixing a colon `'/:'` character in the url. If we specify a route such as `'/users/:userId'` we will have a parameter called `'userId'`. Use a double asterix `'/**'` to accept anything for the remainder of the url.

* **`logger`**
#### **`logger`**
The logger being used by the application.
* **`getBody()`**
#### **`getBody()`**

@@ -807,5 +807,4 @@ This method can be used in many ways so the next section will look at it in detail.

The following utilities [`Ex()`](#-ex), and [`inject()`](#-inject) are used throughout your application. They are almost essential for building a well working app.
The following utilities [`Ex()`](#-ex), and [`inject()`](#-inject) will likely be used throughout our application. These are very useful for building a well working app.
# # Ex.()

@@ -812,0 +811,0 @@

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