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

@curveball/core

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@curveball/core - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

8

changelog.md

@@ -0,1 +1,9 @@

0.6.0 (2018-09-05)
==================
* Request and Response object are now generic. `Response<T>` implies the body
property has type `T`.
* `ctx.status` is now writable.
0.5.0 (2018-08-31)

@@ -2,0 +10,0 @@ ==================

13

dist/context.d.ts

@@ -10,11 +10,11 @@ import { Middleware } from './application';

*/
export default class Context {
export default class Context<ReqT = any, ResT = any> {
/**
* HTTP Request
*/
request: Request;
request: Request<ReqT>;
/**
* HTTP Response
*/
response: Response;
response: Response<ResT>;
/**

@@ -73,4 +73,9 @@ * State information.

*/
readonly status: number;
/**
* Sets the HTTP response status code.
*
* This is a shortcut for response.status.
*/
status: number;
/**
* Sends an informational (1xx status code) response.

@@ -77,0 +82,0 @@ *

@@ -64,2 +64,10 @@ "use strict";

/**
* Sets the HTTP response status code.
*
* This is a shortcut for response.status.
*/
set status(value) {
this.response.status = value;
}
/**
* Sends an informational (1xx status code) response.

@@ -66,0 +74,0 @@ *

/// <reference types="node" />
import { HeadersInterface, HeadersObject } from './headers';
import Request from './request';
export declare class MemoryRequest implements Request {
export declare class MemoryRequest<T> implements Request<T> {
/**

@@ -13,3 +13,3 @@ * List of HTTP Headers

*/
body: any;
body: T;
constructor(method?: string, requestTarget?: string, headers?: HeadersInterface | HeadersObject, body?: any);

@@ -16,0 +16,0 @@ /**

import { Middleware } from './application';
import { Headers, HeadersInterface, HeadersObject } from './headers';
import Response from './response';
export declare class MemoryResponse implements Response {
export declare class MemoryResponse<T> implements Response<T> {
constructor();

@@ -17,3 +17,3 @@ /**

*/
body: null | object | string;
body: T;
/**

@@ -20,0 +20,0 @@ * Returns the value of the Content-Type header, with any additional

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { NodeHttpRequest } from './http-utils';
export declare class NodeRequest implements Request {
export declare class NodeRequest<T> implements Request<T> {
/**

@@ -15,3 +15,3 @@ * List of HTTP Headers

*/
body: any;
body: T;
/**

@@ -18,0 +18,0 @@ * Node.js Request object

@@ -42,3 +42,3 @@ import { Middleware } from '../application';

}
export declare class NodeResponse implements Response {
export declare class NodeResponse<T> implements Response<T> {
private inner;

@@ -65,3 +65,3 @@ private bodyValue;

*/
body: null | object | string;
body: T;
/**

@@ -68,0 +68,0 @@ * Returns the value of the Content-Type header, with any additional

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

*/
export interface Request {
export interface Request<T = any> {
/**

@@ -52,3 +52,3 @@ * List of HTTP Headers

*/
body: any;
body: T;
/**

@@ -55,0 +55,0 @@ * This function returns the request body.

@@ -6,3 +6,3 @@ import { Middleware } from './application';

*/
export interface Response {
export interface Response<T = any> {
/**

@@ -19,3 +19,3 @@ * List of HTTP Headers.

*/
body: any;
body: T;
/**

@@ -22,0 +22,0 @@ * Returns the value of the Content-Type header, with any additional

{
"name": "@curveball/core",
"version": "0.5.0",
"version": "0.6.0",
"description": "Curveball is a framework writting in Typescript for Node.js",

@@ -61,3 +61,5 @@ "main": "dist/index.js",

},
"engines" : { "node" : ">=9.4" }
"engines": {
"node": ">=9.4"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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