Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Handle string provider type in Description.getProviderDescription #1367

Merged
merged 4 commits into from
Apr 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/backend/utils/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ const getPropsIfTheyExist = (object: any, props: Array<any[]>): Array<any> => {
};
export abstract class Description {
public static getProviderDescription(provider, instance): Property {
if (typeof provider === 'string') {
return {
key: provider,
value: null
};
}
return {
id: Reflect.getMetadata(AUGURY_TOKEN_ID_METADATA_KEY, provider),
key: provider.name,
Expand Down