Skip to content

Commit

Permalink
⚡ Updating type guard so it doesn't use any type
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed Nov 8, 2022
1 parent 1073794 commit 6ffd13e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/editor-ui/src/components/NodeCredentials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default mixins(
return styles;
},
// TODO: Investigate if this can be solved using only the store data (storing selected flag in credentials objects, ...)
listenForNewCredentials() {
// Listen for credentials store changes so credential selection can be updated if creds are changed from the modal
this.credentialsStore.$subscribe((mutation, state) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export function isNotNull<T>(value: T | null): value is T {
return value !== null;
}

export function isValidCredentialResponse(value: Record<string, any>): value is ICredentialsResponse {
return 'id' in value && 'createdAt' in value && 'createdAt' in value;
export function isValidCredentialResponse(value: unknown): value is ICredentialsResponse {
return typeof value === 'object' && value !== null && 'id' in value && 'createdAt' in value && 'updatedAt' in value;
}

0 comments on commit 6ffd13e

Please sign in to comment.