Skip to content

Commit

Permalink
fix: runtime accept
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Apr 3, 2020
1 parent c356c73 commit 2789df9
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 371 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@types/jest": "^25.1.4",
"@types/node": "^13.9.8",
"@types/jest": "^25.1.5",
"@types/node": "^13.11.0",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
"husky": "^4.2.3",
"jest": "^25.2.4",
"jest": "^25.2.7",
"lerna": "^3.20.2",
"ts-jest": "^25.3.0",
"typescript": "^3.8.3"
Expand Down
6 changes: 5 additions & 1 deletion packages/unit/src/Runtime/Runtime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {assert, isFunction, Logger} from "@typesafeunit/util";
import {assert, isFunction, isNull, isUndefined, Logger} from "@typesafeunit/util";
import {Promisify} from "../interfaces";
import {Heartbeat} from "./Heartbeat";
import {Disposable, IRunnable} from "./interfaces";
Expand Down Expand Up @@ -90,6 +90,10 @@ export class Runtime {
}

public accept(item: any) {
if (isUndefined(item) || isNull(item)) {
return;
}

if (isDisposable(item)) {
this.disposable.push(item);
}
Expand Down
Loading

0 comments on commit 2789df9

Please sign in to comment.