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

@loopback/core

Package Overview
Dependencies
Maintainers
20
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loopback/core - npm Package Compare versions

Comparing version 4.0.0-alpha.7 to 4.0.0-alpha.8

11

lib/application.d.ts

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

export declare class Application extends Context {
appConfig: AppConfig;
options: ApplicationOptions;
/**

@@ -29,3 +29,4 @@ * Handle incoming HTTP(S) request by invoking the corresponding

protected _httpHandler: HttpHandler;
constructor(appConfig?: AppConfig);
constructor(options?: ApplicationOptions);
protected _bindSequence(): void;
protected _handleHttpRequest(request: ServerRequest, response: ServerResponse): Promise<void>;

@@ -50,5 +51,5 @@ protected _setupHandlerIfNeeded(): void;

}
export interface AppConfig {
components: Array<Constructor<Component>>;
sequences: Array<Constructor<Sequence>>;
export interface ApplicationOptions {
components?: Array<Constructor<Component>>;
sequence?: Constructor<Sequence>;
}

@@ -13,7 +13,7 @@ "use strict";

class Application extends context_1.Context {
constructor(appConfig) {
constructor(options) {
super();
this.appConfig = appConfig;
if (appConfig && appConfig.components) {
for (const component of appConfig.components) {
this.options = options;
if (options && options.components) {
for (const component of options.components) {
// TODO(superkhau): Need to figure a way around this hack,

@@ -26,16 +26,13 @@ // `componentClassName.constructor.name` + `componentClassName.name`

}
if (appConfig && appConfig.sequences) {
for (const sequence of appConfig.sequences) {
// TODO(superkhau): Need to figure a way around this hack,
// `componentClassName.constructor.name` + `componentClassName.name`
// doesn't work
const sequenceClassName = sequence.toString().split(' ')[1];
this.bind(`sequence.${sequenceClassName}`).toClass(sequence);
}
}
this._bindSequence();
this.handleHttp = (req, res) => this._handleHttpRequest(req, res);
this.bind('logError').to(this._logError.bind(this));
}
_bindSequence() {
// TODO(bajtos, ritch, superkhau) figure out how to integrate this single
// sequence with custom sequences contributed by components
this.bind('sequence').toClass(sequence_1.Sequence);
const sequence = this.options && this.options.sequence ?
this.options.sequence :
sequence_1.Sequence;
this.bind('sequence').toClass(sequence);
}

@@ -42,0 +39,0 @@ _handleHttpRequest(request, response) {

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

export declare class Application extends Context {
appConfig: AppConfig;
options: ApplicationOptions;
/**

@@ -29,3 +29,4 @@ * Handle incoming HTTP(S) request by invoking the corresponding

protected _httpHandler: HttpHandler;
constructor(appConfig?: AppConfig);
constructor(options?: ApplicationOptions);
protected _bindSequence(): void;
protected _handleHttpRequest(request: ServerRequest, response: ServerResponse): Promise<void>;

@@ -50,5 +51,5 @@ protected _setupHandlerIfNeeded(): void;

}
export interface AppConfig {
components: Array<Constructor<Component>>;
sequences: Array<Constructor<Sequence>>;
export interface ApplicationOptions {
components?: Array<Constructor<Component>>;
sequence?: Constructor<Sequence>;
}

@@ -13,7 +13,7 @@ "use strict";

class Application extends context_1.Context {
constructor(appConfig) {
constructor(options) {
super();
this.appConfig = appConfig;
if (appConfig && appConfig.components) {
for (const component of appConfig.components) {
this.options = options;
if (options && options.components) {
for (const component of options.components) {
// TODO(superkhau): Need to figure a way around this hack,

@@ -26,16 +26,13 @@ // `componentClassName.constructor.name` + `componentClassName.name`

}
if (appConfig && appConfig.sequences) {
for (const sequence of appConfig.sequences) {
// TODO(superkhau): Need to figure a way around this hack,
// `componentClassName.constructor.name` + `componentClassName.name`
// doesn't work
const sequenceClassName = sequence.toString().split(' ')[1];
this.bind(`sequence.${sequenceClassName}`).toClass(sequence);
}
}
this._bindSequence();
this.handleHttp = (req, res) => this._handleHttpRequest(req, res);
this.bind('logError').to(this._logError.bind(this));
}
_bindSequence() {
// TODO(bajtos, ritch, superkhau) figure out how to integrate this single
// sequence with custom sequences contributed by components
this.bind('sequence').toClass(sequence_1.Sequence);
const sequence = this.options && this.options.sequence ?
this.options.sequence :
sequence_1.Sequence;
this.bind('sequence').toClass(sequence);
}

@@ -42,0 +39,0 @@ _handleHttpRequest(request, response) {

{
"name": "@loopback/core",
"version": "4.0.0-alpha.7",
"version": "4.0.0-alpha.8",
"description": "",

@@ -5,0 +5,0 @@ "scripts": {

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