overleaf/services/web/frontend/js/utils/splitTestUtils.ts
Jakob Ackermann e63b90d288 Merge pull request #11624 from overleaf/jpa-hybrid-download-params
[web] add split tests for tweaking user content domain access check

GitOrigin-RevId: a5e6959098c10ea230634492b465c2b9dcdd909f
2023-02-02 18:22:34 +00:00

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
}