/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
packages/devlow-bench/src/utils.ts
17 строк
594 B
Will Binns-Smith
Remove `turbopack/packages` and relocate devlow to `packages/` (#96860)
07 авг 2026, 06:39
Не верифицирован
07 авг 2026, 06:39
286169a
Код
Авторство
О чём код?
export function formatVariant( scenario: string, props: Record<string, string | number | boolean | null> ): string { const propsStr = formatVariantProps(props) return propsStr ? `${scenario} ${propsStr}` : scenario } // Just the props part (no scenario prefix). Stable key for snapshots/compare. export function formatVariantProps( props: Record<string, string | number | boolean | null> ): string { return Object.keys(props) .filter((key) => props[key] !== false && props[key] !== null) .map((key) => (props[key] === true ? key : `${key}=${props[key]}`)) .join(' ') }