mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
cf3ecc93eb
strictNullChecks was off for docs, which lets errors slip through and leads to incorrect required/optional typing on Zod-inferred types. This PR enables strictNullChecks and fixes all the existing violations.
31 lines
575 B
TypeScript
31 lines
575 B
TypeScript
import { type CSSProperties } from 'react'
|
|
|
|
/*
|
|
* As defined in @shikijs/core/dist/chunk-tokens.d.mts
|
|
*/
|
|
enum FontStyle {
|
|
NotSet = -1,
|
|
None = 0,
|
|
Italic = 1,
|
|
Bold = 2,
|
|
Underline = 4,
|
|
}
|
|
|
|
export function getFontStyle(styleFlags: number): CSSProperties {
|
|
let style: CSSProperties = {}
|
|
|
|
if (styleFlags & FontStyle.Italic) {
|
|
;(style ??= {}).fontStyle = 'italic'
|
|
}
|
|
|
|
if (styleFlags & FontStyle.Bold) {
|
|
;(style ??= {}).fontWeight = 'bold'
|
|
}
|
|
|
|
if (styleFlags & FontStyle.Underline) {
|
|
;(style ??= {}).textDecoration = 'underline'
|
|
}
|
|
|
|
return style
|
|
}
|