Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import FootnoteRef from './Footnotes/FootnoteRef'
import Footnotes from './Footnotes/Footnotes'
import HorizontalRule from './HorizontalRule'
import Table from './Table'
import ContentLink from './links/ContentLink'
import OrderedList from './lists/OrderedList'
import UnorderedList from './lists/UnorderedList'
import ContentTitlePrimary from './titles/ContentTitlePrimary'
import ContentTitleSecondary from './titles/ContentTitleSecondary'
import ContentTitleTertiary from './titles/ContentTitleTertiary'
const hrefIsBackref = test(/^#fnref/)
const isClassedAsFootnoteRef = test(/footnote-ref/)
const isClassedAsFootnotes = test(/footnotes/)
const idIsFootnote = test(/^fn-/)
const lhasIdProp = lensSatisfies(idIsFootnote, lensPath([`props`, `id`]))
const isListOfFootnotes = pipe(
filter(both(isPlainObj, lhasIdProp)),
isNotEmpty
)
/* eslint-disable react/display-name, react/prop-types */
const resolveAnchor = theme => ({ className, href, ...rest }) => {
let Component
if (isClassedAsFootnoteRef(className)) {
Component = FootnoteRef
}
if (hrefIsBackref(href)) {
return null
}
export const findBreakpointIndex = (breakpointMap, name) =>
findIndex(lensSatisfies(equals(name), lensIndex(0)), breakpointMap)
const filterResolvingScopes = breakpointName =>
filter(lensSatisfies(contains(breakpointName), lResolve))
export const findBreakpointByName = curry((breakpointMap, name) =>
pipe(
find(lensSatisfies(equals(name), lensIndex(0))),
throwWhenUndefined(noBreakpointWithNameError(name)),
last
)(breakpointMap)
)
export const hasIndex = curry((n, l) =>
lensSatisfies(isNotUndefined, lensIndex(n))(l)
)