mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
e60885aa88
Move CSS loading in Cypress to individual test spec files GitOrigin-RevId: 92bb5167cfa81b0bd54acc724efb23b397421ccb
22 lines
677 B
TypeScript
22 lines
677 B
TypeScript
import getMeta from '@/utils/meta'
|
|
|
|
// The reason this is a function to ensure that meta tag is read before any
|
|
// isBootstrap5 check is performed
|
|
export const isBootstrap5 = () => getMeta('ol-bootstrapVersion') === 5
|
|
|
|
export const bsVersion = ({ bs5, bs3 }: { bs5?: string; bs3?: string }) => {
|
|
return isBootstrap5() ? bs5 : bs3
|
|
}
|
|
|
|
// get all `aria-*` and `data-*` attributes
|
|
export const getAriaAndDataProps = (obj: Record<string, unknown>) => {
|
|
return Object.entries(obj).reduce(
|
|
(acc, [key, value]) => {
|
|
if (key.startsWith('aria-') || key.startsWith('data-')) {
|
|
acc[key] = value
|
|
}
|
|
return acc
|
|
},
|
|
{} as Record<string, unknown>
|
|
)
|
|
}
|