@mstream/di
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -7,2 +7,3 @@ { | ||
}, | ||
"ignorePatterns": ["CHANGELOG.md"], | ||
"parserOptions": { | ||
@@ -9,0 +10,0 @@ "ecmaVersion": 2021, |
@@ -5,2 +5,4 @@ # Changelog | ||
### 2.0.1 (2023-01-18) | ||
## 2.0.0 (2023-01-18) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "@mstream/di", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "", | ||
@@ -9,2 +9,6 @@ "private": false, | ||
"scripts": { | ||
"format:docs": "prettier --write docs", | ||
"format": "npm run format:docs", | ||
"generate:docs": "rm -f docs/REFERENCE.md && jsdoc2md src/index.js > docs/REFERENCE.md && npm run format:docs", | ||
"generate": "npm run generate:docs", | ||
"lint:commits": "commitlint --to HEAD", | ||
@@ -36,3 +40,4 @@ "lint:example": "cd example && npm run lint", | ||
"eslint": "^8", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-config-prettier": "^8", | ||
"jsdoc-to-markdown": "^8", | ||
"markdown-link-check": "^3", | ||
@@ -39,0 +44,0 @@ "prettier": "^2", |
@@ -5,2 +5,6 @@ # DI | ||
## Documentation | ||
- [reference](docs/REFERENCE.md) | ||
## Usage Examples | ||
@@ -7,0 +11,0 @@ |
@@ -0,1 +1,35 @@ | ||
/** | ||
* @module | ||
*/ | ||
/** | ||
* @typedef {function} BuildFn | ||
* @returns {object} | ||
*/ | ||
/** | ||
* @typedef {function} RegisterFn | ||
* @param {string} name | ||
* @param {function} creator | ||
* @returns {ContextBuilder} | ||
*/ | ||
/** | ||
* @typedef {function} RegisterEagerFn | ||
* @param {string} name | ||
* @param {function} creator | ||
* @returns {ContextBuilder} | ||
*/ | ||
/** | ||
* @typedef {object} ContextBuilder | ||
* @property {BuildFn} build - builds a context with registered dependencies inside it | ||
* @property {RegisterFn} register - register a depenency | ||
* @property {RegisterEagerFn} registerEager - registers an eager dependency | ||
*/ | ||
/** Creates a builder which allow to register | ||
* dependency creators. | ||
* @returns {ContextBuilder} | ||
*/ | ||
export function contextBuilder() { | ||
@@ -46,3 +80,7 @@ let wasBuilt = false | ||
return { build, register, registerEager } | ||
return { | ||
build, | ||
register, | ||
registerEager, | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
178321
21
4700
13
10