Skip to content

Commit

Permalink
Merge pull request #14 from unitiweb/add-deconstruct-method
Browse files Browse the repository at this point in the history
Add deconstruct method to context
  • Loading branch information
unitiweb committed Aug 9, 2019
2 parents e120a38 + c20e47e commit d24fc21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unitiweb-express-microservice",
"version": "0.2.6",
"version": "0.2.7",
"description": "A simple microservice framework using express",
"main": "src/index.js",
"scripts": {
Expand Down
8 changes: 2 additions & 6 deletions src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ class Context {
this.list.push({ name, module })
}

get (name) {
const ctx = this.list.find(ctx => ctx.name === name)
if (!ctx) {
throw new Error('Tried to get context item that doesn\'t exists')
}
return ctx
deconstruct () {
return this.build()
}

build () {
Expand Down

0 comments on commit d24fc21

Please sign in to comment.