+1
-2
| language: node_js | ||
| node_js: | ||
| - "4" | ||
| - "6" | ||
| - "8" | ||
| before_script: | ||
@@ -6,0 +5,0 @@ - npm install grunt-cli -g |
+24
-20
@@ -1,5 +0,5 @@ | ||
| declare class Bottle { | ||
| static pop: (name?: string) => Bottle; | ||
| static clear: (name?: string) => void; | ||
| static list: (container?: Bottle.IContainer) => Array<string>; | ||
| declare class Bottle<EntryName extends string = string> { | ||
| static pop(name?: string): Bottle; | ||
| static clear(name?: string): void; | ||
| static list<T extends string = string>(container?: Bottle.IContainer<T>): Array<T>; | ||
| static config: Object; | ||
@@ -24,3 +24,4 @@ | ||
| */ | ||
| decorator(name: string|((service: any) => any), func?: (service: any) => any): this; | ||
| decorator(func: Bottle.Decorator): this; | ||
| decorator(name: EntryName, func: Bottle.Decorator): this; | ||
@@ -35,3 +36,3 @@ /** | ||
| */ | ||
| digest(services: Array<string>): Array<any>; | ||
| digest(services: EntryName[]): Array<any>; | ||
@@ -41,3 +42,3 @@ /** | ||
| */ | ||
| factory(name: string, Factory: (container: Bottle.IContainer) => any): this; | ||
| factory(name: EntryName, Factory: (container: Bottle.IContainer<EntryName>) => any): this; | ||
@@ -47,3 +48,3 @@ /** | ||
| */ | ||
| instanceFactory(name: string, Factory: (container: Bottle.IContainer) => any): this; | ||
| instanceFactory(name: EntryName, Factory: (container: Bottle.IContainer<EntryName>) => any): this; | ||
@@ -53,3 +54,3 @@ /** | ||
| */ | ||
| list(container?: Bottle.IContainer): Array<string>; | ||
| list<T extends string = EntryName>(container?: Bottle.IContainer<T>): Array<T>; | ||
@@ -59,4 +60,4 @@ /** | ||
| */ | ||
| middleware(name: string|((service: any, next: (error?: Error) => void) => void), | ||
| func?: (service: any, next: (error?: Error) => void) => void): this; | ||
| middleware(func: Bottle.Middleware): this; | ||
| middleware(name: EntryName, func: Bottle.Middleware): this; | ||
@@ -66,3 +67,3 @@ /** | ||
| */ | ||
| provider(name: string, Provider: ((...any: any[]) => void)): this; | ||
| provider(name: EntryName, Provider: ((...any: any[]) => void)): this; | ||
@@ -87,4 +88,4 @@ /** | ||
| */ | ||
| service(name: string, Constructor: ((...any: any[]) => any), ...dependency: string[]): this; | ||
| service<T>(name: string, Constructor: new (...any: any[]) => T, ...dependency: string[]): this; | ||
| service(name: EntryName, Constructor: ((...any: any[]) => any), ...dependency: EntryName[]): this; | ||
| service<T>(name: EntryName, Constructor: new (...any: any[]) => T, ...dependency: EntryName[]): this; | ||
@@ -94,4 +95,4 @@ /** | ||
| */ | ||
| serviceFactory(name: string, factoryService: ((...any: any[]) => any), ...dependency: string[]): this; | ||
| serviceFactory<T>(name: string, factoryService: ((...any: any[]) => T), ...dependency: string[]): this; | ||
| serviceFactory(name: EntryName, factoryService: ((...any: any[]) => any), ...dependency: EntryName[]): this; | ||
| serviceFactory<T>(name: EntryName, factoryService: ((...any: any[]) => T), ...dependency: EntryName[]): this; | ||
@@ -101,3 +102,3 @@ /** | ||
| */ | ||
| value(name: string, val: any): this; | ||
| value(name: EntryName, val: any): this; | ||
| } | ||
@@ -108,2 +109,5 @@ | ||
| declare module Bottle { | ||
| type Middleware = ((service: any, next: (error?: Error) => void) => void); | ||
| type Decorator = (service: any) => any; | ||
| interface IRegisterableObject { | ||
@@ -117,8 +121,8 @@ $name: string; | ||
| interface IContainer { | ||
| interface IContainer<EntryName extends string = string> { | ||
| [key: string]: any; | ||
| $decorator(name: string|((service: any) => any), func?: (service: any) => any): this; | ||
| $decorator(name: string | Decorator, func?: Decorator): this; | ||
| $register(Obj: Bottle.IRegisterableObject): this; | ||
| $list(container?: Bottle.IContainer): Array<string>; | ||
| $list(container?: Bottle.IContainer): EntryName[]; | ||
| } | ||
| } |
+2
-2
| ;(function(undefined) { | ||
| 'use strict'; | ||
| /** | ||
| * BottleJS v1.7.1 - 2018-05-03 | ||
| * BottleJS v1.7.2 - 2019-02-07 | ||
| * A powerful dependency injection micro container | ||
| * | ||
| * Copyright (c) 2018 Stephen Young | ||
| * Copyright (c) 2019 Stephen Young | ||
| * Licensed MIT | ||
@@ -9,0 +9,0 @@ */ |
+3
-3
| { | ||
| "name": "bottlejs", | ||
| "version": "1.7.1", | ||
| "version": "1.7.2", | ||
| "description": "A powerful dependency injection micro container", | ||
@@ -29,6 +29,6 @@ "main": "dist/bottle.js", | ||
| "devDependencies": { | ||
| "grunt": "^1.0.2", | ||
| "grunt": "^1.0.3", | ||
| "grunt-contrib-clean": "^1.1.0", | ||
| "grunt-contrib-concat": "^1.0.1", | ||
| "grunt-contrib-jasmine": "^1.2.0", | ||
| "grunt-contrib-jasmine": "^2.0.3", | ||
| "grunt-contrib-jshint": "^1.1.0", | ||
@@ -35,0 +35,0 @@ "grunt-contrib-uglify": "^3.3.0", |
+1
-3
@@ -11,3 +11,2 @@ | ||
| [](https://nodei.co/npm/bottlejs/) | ||
| [](https://nodei.co/npm/bottlejs/) | ||
@@ -45,5 +44,4 @@ > A powerful dependency injection micro container | ||
| ```html | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/bottlejs/VERSION/bottle.min.js"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/bottlejs/1.7.1/bottle.min.js"></script> | ||
| ``` | ||
| Replace `VERSION` in the above URL with a valid BottleJS version, e.g. `https://cdnjs.cloudflare.com/ajax/libs/bottlejs/1.6.1/bottle.min.js` | ||
@@ -50,0 +48,0 @@ ## Simple Example |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
718
0.42%46787
-0.03%455
-0.44%