mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 07:25:10 -05:00
e63b90d288
[web] add split tests for tweaking user content domain access check GitOrigin-RevId: a5e6959098c10ea230634492b465c2b9dcdd909f
14 lines
388 B
TypeScript
14 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
|
|
}
|