Skip to content

Commit

Permalink
feat: add detailed type of plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 13, 2023
1 parent 68081c4 commit f25dd5a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:

steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordis",
"description": "AOP Framework for Modern JavaScript Applications",
"version": "3.2.3",
"version": "3.2.4",
"sideEffects": false,
"main": "lib/index.cjs",
"module": "lib/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class Registry<C extends Context = Context> {
if (plugin === null) return plugin
if (typeof plugin === 'function') return plugin
if (isApplicable(plugin)) return plugin.apply
throw new Error('invalid plugin, expect function or object with an "apply" method')
throw new Error('invalid plugin, expect function or object with an "apply" method, received ' + typeof plugin)
}

get(plugin: Plugin<C>) {
Expand Down
5 changes: 0 additions & 5 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ export class Service<C extends Context = Context> {
})
}

/** @deprecated use `Context.current` instead */
get caller() {
return this[Context.current] as C
}

[Context.filter](ctx: Context) {
return ctx[Context.shadow][this.name] === this.ctx[Context.shadow][this.name]
}
Expand Down

0 comments on commit f25dd5a

Please sign in to comment.