Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up factor range and add factor method #14037

Merged
merged 15 commits into from
Aug 27, 2024
Prev Previous commit
Next Next commit
any -> unknown
  • Loading branch information
bryevdv committed Aug 23, 2024
commit a8493ef184d288088f6306966859b6486f413602
4 changes: 2 additions & 2 deletions bokehjs/src/lib/models/ranges/factor_range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export function map_three_levels(
}

const is_l1 = isString
const is_l2 = (x: any) => isArray(x) && x.length == 2 && isString(x[0]) && isString(x[1])
const is_l3 = (x: any) => isArray(x) && x.length == 3 && isString(x[0]) && isString(x[1]) && isString(x[2])
const is_l2 = (x: unknown) => isArray(x) && x.length == 2 && isString(x[0]) && isString(x[1])
const is_l3 = (x: unknown) => isArray(x) && x.length == 3 && isString(x[0]) && isString(x[1]) && isString(x[2])

export function compute_levels(factors: Factor[]): 1 | 2 | 3 {
if (every(factors, is_l1)) {
Expand Down