1
0
mirror of https://github.com/tabler/tabler.git synced 2026-08-07 03:42:27 +04:00
Files
tabler/shared/lib/include-args.ts
2026-08-03 00:55:32 +02:00

9 lines
375 B
TypeScript

/**
* Returns how many of the given prop keys are explicitly set (not undefined).
* Some components use this count as a class suffix when `size` (or similar) is
* omitted, e.g. `spinner-border-2` or `nav-2`.
*/
export function includeArgCount(props: Record<string, unknown>, keys: readonly string[]): number {
return keys.filter((k) => props[k] !== undefined).length
}