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

@poppinss/manager

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poppinss/manager - npm Package Compare versions

Comparing version 3.0.1 to 3.0.3

9

build/src/Contracts.d.ts
/**
* Shape of the extend callback
*/
export declare type ExtendCallback<Manager extends ManagerContract<any, any>, Driver extends any> = (manager: Manager, mappingName: string, config: any) => Driver;
export declare type ExtendCallback<Manager extends ManagerContract<any, any>, Driver extends any, Name extends any> = (manager: Manager, mappingName: Name, config: any) => Driver;
/**

@@ -17,7 +17,2 @@ * Manager class shape

/**
* Returns mapping value when an unknown key is defined. This will be done, when someone
* is trying to bypass static analysis
*/
use(name: string): MappingValue;
/**
* Return a overload of mapping when no key is defined

@@ -31,3 +26,3 @@ */

*/
extend(name: string, callback: ExtendCallback<this, DriverContract>): void;
extend(name: string, callback: ExtendCallback<this, DriverContract, keyof MappingsList>): void;
/**

@@ -34,0 +29,0 @@ * Release bindings from cache

@@ -29,3 +29,3 @@ import { ManagerContract, ExtendCallback } from './Contracts';

*/
protected abstract getDefaultMappingName(): string;
protected abstract getDefaultMappingName(): keyof MappingsList;
/**

@@ -35,7 +35,7 @@ * Getting config for the mapping. It is required for making

*/
protected abstract getMappingConfig(mappingName: string): any | undefined;
protected abstract getMappingConfig(mappingName: keyof MappingsList): any | undefined;
/**
* Getting the driver name for the mapping
*/
protected abstract getMappingDriver(mappingName: string): string | undefined;
protected abstract getMappingDriver(mappingName: keyof MappingsList): string | undefined;
constructor(container: Container);

@@ -67,3 +67,3 @@ /**

*/
protected wrapDriverResponse(_: string, value: DriverContract): MappingValue;
protected wrapDriverResponse(_: keyof MappingsList, value: DriverContract): MappingValue;
/**

@@ -74,3 +74,2 @@ * Returns the instance of a given driver. If `name` is not defined

use<K extends keyof MappingsList & string>(name: K): MappingsList[K];
use(name: string): MappingValue;
use(): {

@@ -88,3 +87,3 @@ [K in keyof MappingsList]: MappingsList[K];

*/
extend(name: string, callback: ExtendCallback<this, DriverContract>): void;
extend(name: string, callback: ExtendCallback<this, DriverContract, keyof MappingsList>): void;
}

@@ -89,4 +89,4 @@ "use strict";

use(name) {
name = name || this.getDefaultMappingName();
const cached = this.getFromCache(name);
const mappingName = name || this.getDefaultMappingName();
const cached = this.getFromCache(mappingName);
if (cached) {

@@ -98,3 +98,3 @@ return cached;

*/
const driver = this.getMappingDriver(name);
const driver = this.getMappingDriver(mappingName);
if (!driver) {

@@ -107,3 +107,3 @@ throw new Error(`Make sure to define driver for "${name}" mapping`);

if (this.extendedDrivers[driver]) {
return this.makeExtendedDriver(name, driver, this.getMappingConfig(name));
return this.makeExtendedDriver(mappingName, driver, this.getMappingConfig(mappingName));
}

@@ -113,3 +113,3 @@ /**

*/
return this.makeDriver(name, driver, this.getMappingConfig(name));
return this.makeDriver(mappingName, driver, this.getMappingConfig(mappingName));
}

@@ -116,0 +116,0 @@ release(name) {

{
"name": "@poppinss/manager",
"version": "3.0.1",
"version": "3.0.3",
"description": "The builder (Manager) pattern implementation",

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

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