mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
[web] Update bsVersion to return its arguments types (#20963)
* [web] Update `bsVersion` to return its arguments types * [web] Remove `as string` after `bsVersion` calls GitOrigin-RevId: 604ce87aaccd709299124a986e98cf45874484bb
This commit is contained in:
@@ -4,7 +4,11 @@ import getMeta from '@/utils/meta'
|
||||
// any isBootstrap5 check is performed
|
||||
export const isBootstrap5 = () => getMeta('ol-bootstrapVersion') === 5
|
||||
|
||||
export const bsVersion = ({ bs5, bs3 }: { bs5?: string; bs3?: string }) => {
|
||||
/* eslint-disable no-redeclare */
|
||||
export function bsVersion<A>({ bs5 }: { bs5: A }): A | undefined
|
||||
export function bsVersion<B>({ bs3 }: { bs3: B }): B | undefined
|
||||
export function bsVersion<A, B>({ bs5, bs3 }: { bs5: A; bs3: B }): A | B
|
||||
export function bsVersion({ bs5, bs3 }: { bs5?: unknown; bs3?: unknown }) {
|
||||
return isBootstrap5() ? bs5 : bs3
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user