mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 15:53:04 -05:00
15 lines
388 B
TypeScript
15 lines
388 B
TypeScript
|
import getMeta from './meta'
|
||
|
|
||
|
export function isSplitTestEnabled(name: string) {
|
||
|
return getMeta('ol-splitTestVariants')?.[name] === 'enabled'
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|