Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.

Commit 0dbd878

Browse files
refactor(util): isCommandCreator unknown lint fix (#38)
1 parent db4086b commit 0dbd878

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

docs/RELEASE-WORKFLOW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ In order to release follow the following procedure.
55
- Create a PR from `feature/xyz` to `master`
66

77
## Stable Versions
8-
- Create PR to version branch `3.x`
8+
- Create PR to version branch e.g. `3.x`
99
- Update version within `package.json`
1010
- Update `CHANGELOG.md`
1111
- Once merged it will auto `publish` and `git tag`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ssv/ngx.command",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"versionSuffix": "",
55
"description": "Command pattern implementation for angular. Command used to encapsulate information which is needed to perform an action.",
66
"keywords": [

src/command.util.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export function isCommand(arg: unknown): arg is ICommand {
1414
export function isCommandCreator(arg: unknown): arg is CommandCreator {
1515
if (arg instanceof Command) {
1616
return false;
17-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
18-
} else if ((arg as any).execute) {
17+
} else if (isUnknownObject(arg) && arg.execute) {
1918
return true;
2019
}
2120
return false;
@@ -44,3 +43,7 @@ export function canExecuteFromNgForm(
4443
)
4544
: of(true);
4645
}
46+
47+
function isUnknownObject(x: unknown): x is { [key in PropertyKey]: unknown } {
48+
return x !== null && typeof x === "object";
49+
}

0 commit comments

Comments
 (0)