Skip to content

Commit 094a813

Browse files
committed
simplify
1 parent 2d76e0b commit 094a813

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/aggregate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export type NonArgAggregateOp = Exclude<AggregateOp, 'argmin' | 'argmax'>;
5050
export type Aggregate = NonArgAggregateOp | ArgmaxDef | ArgminDef;
5151

5252
export function isArgminDef(a: Aggregate | string): a is ArgminDef {
53-
return !!a && hasKey(a, 'argmin');
53+
return hasKey(a, 'argmin');
5454
}
5555

5656
export function isArgmaxDef(a: Aggregate | string): a is ArgmaxDef {
57-
return !!a && hasKey(a, 'argmax');
57+
return hasKey(a, 'argmax');
5858
}
5959

6060
export function isAggregateOp(a: string | ArgminDef | ArgmaxDef): a is AggregateOp {

src/compile/scale/parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function parseUnitScaleCore(model: UnitModel): ScaleComponentIndex {
5454
continue;
5555
}
5656

57-
let specifiedScale = (fieldOrDatumDef as any)?.scale;
57+
let specifiedScale = fieldOrDatumDef && (fieldOrDatumDef as any).scale;
5858
if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {
5959
specifiedScale ??= {};
6060
const hasNestedOffsetScale = channelHasNestedOffsetScale(encoding, channel);

src/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,10 @@ export function stripAndRedirectConfig(config: Config<SignalRef>) {
734734
redirectTitleConfig(config);
735735

736736
// Remove empty config objects.
737-
for (const prop of keys(config)) {
737+
for (const prop in config) {
738+
// @ts-ignore
738739
if (isObject(config[prop]) && isEmpty(config[prop])) {
740+
// @ts-ignore
739741
delete config[prop];
740742
}
741743
}

0 commit comments

Comments
 (0)