mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-24 17:51:51 +02:00
Add Knip and remove a bunch of unused code GitOrigin-RevId: 42ab99fc65973c883d2361e0027e7181767e714e
20 lines
542 B
TypeScript
20 lines
542 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
|
|
}
|
|
|
|
/** @knipignore */
|
|
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
|
|
}
|