Skip to content

Commit b8b5b8f

Browse files
committed
refactor: remove fill fallback cast
1 parent e230a83 commit b8b5b8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/data/program_configuration.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ type SourceExpressionWithRawEvaluation = ZoomConstantExpression<'source'>;
6464
type CompositeExpressionWithRawEvaluation = ZoomDependentExpression<'composite'>;
6565

6666
function getFillColorFallback(layer: TypedStyleLayer, property: string): FillColorFallback {
67-
return property === 'fill-outline-color' ? (layer.paint as any).get('fill-color').value : null;
67+
if (property !== 'fill-outline-color' || layer.type !== 'fill') {
68+
return null;
69+
}
70+
71+
return layer.paint.get('fill-color').value;
6872
}
6973

7074
function isNullColorEvaluationError(error: unknown): boolean {

0 commit comments

Comments
 (0)