Skip to content

Commit

Permalink
refactor: remove type assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed May 7, 2021
1 parent 9922e08 commit 3987a99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compile/selection/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const project: SelectionCompiler = {
};

const type = selCmpt.type;
const cfg = model.config.selection[type] as PointSelectionConfig;
const cfg = model.config.selection[type];
const init =
selDef.value !== undefined
? (array(selDef.value as any) as SelectionInitMapping[] | SelectionInitIntervalMapping[])
Expand Down Expand Up @@ -99,7 +99,9 @@ const project: SelectionCompiler = {
// to account for unprojected point selections that have scalar initial values
if (!fields && !encodings) {
encodings = cfg.encodings;
fields = cfg.fields;
if ('fields' in cfg) {
fields = cfg.fields;
}
}

for (const channel of encodings ?? []) {
Expand Down

0 comments on commit 3987a99

Please sign in to comment.