mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-14 19:30:54 -05:00
c6289cc67f
[web] Modify design-system-update split test GitOrigin-RevId: f28aeef5ba782006afd30fd2862d0ad129077f6c
18 lines
523 B
TypeScript
18 lines
523 B
TypeScript
import getMeta from './meta'
|
|
|
|
export function isSplitTestEnabled(name: string) {
|
|
return getMeta('ol-splitTestVariants')?.[name] === 'enabled'
|
|
}
|
|
|
|
export function getSplitTestVariant(name: string, fallback?: string) {
|
|
return getMeta('ol-splitTestVariants')?.[name] || fallback
|
|
}
|
|
|
|
export function parseIntFromSplitTest(name: string, defaultValue: number) {
|
|
const v = getMeta('ol-splitTestVariants')?.[name]
|
|
const n = parseInt(v, 10)
|
|
if (v === 'default' || Number.isNaN(n)) {
|
|
return defaultValue
|
|
}
|
|
return n
|
|
}
|