How to use the ramda-adjunct.lensSatisfies function in ramda-adjunct

To help you get started, we’ve selected a few ramda-adjunct examples, based on popular ways it is used in public projects.

github Undistraction / gatsby-starter-skeleton / src / components / shared / MarkdownContent.jsx View on Github external
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
  }
github Undistraction / cssapi / src / utils / breakpointMap.js View on Github external
export const findBreakpointIndex = (breakpointMap, name) =>
  findIndex(lensSatisfies(equals(name), lensIndex(0)), breakpointMap)
github Undistraction / cssapi / src / resolvers / resolveKeyToValue.js View on Github external
const filterResolvingScopes = breakpointName =>
  filter(lensSatisfies(contains(breakpointName), lResolve))
github Undistraction / cssapi / src / utils / breakpointMap.js View on Github external
export const findBreakpointByName = curry((breakpointMap, name) =>
  pipe(
    find(lensSatisfies(equals(name), lensIndex(0))),
    throwWhenUndefined(noBreakpointWithNameError(name)),
    last
  )(breakpointMap)
)
github Undistraction / cssapi / src / utils / list.js View on Github external
export const hasIndex = curry((n, l) =>
  lensSatisfies(isNotUndefined, lensIndex(n))(l)
)