How to use the @canopycanopycanopy/b-ber-shapes-directives.BLOCK_DIRECTIVES.indexOf function in @canopycanopycanopy/b-ber-shapes-directives

To help you get started, we’ve selected a few @canopycanopycanopy/b-ber-shapes-directives examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github triplecanopy / b-ber / packages / b-ber-grammar-attributes / src / index.js View on Github external
const _isUnsupportedAttribute = (genus, attr) => {
  let key
  if (BLOCK_DIRECTIVES.indexOf(genus) > -1) {
    // these are all containers which share the same attributes, so they're
    // grouped under a single property
    key = 'block'
  } else {
    // this will be the directive name, e.g., figure, video, etc
    key = genus
  }

  return SUPPORTED_ATTRIBUTES[key][attr] !== true // bool
}
github triplecanopy / b-ber / packages / b-ber-grammar-attributes / src / index.js View on Github external
const _directiveOrder = genus =>
  BLOCK_DIRECTIVES.indexOf(genus) > -1
    ? 'block'
    : INLINE_DIRECTIVES.indexOf(genus) > -1
    ? 'inline'
    : MISC_DIRECTIVES.indexOf(genus) > -1
    ? 'misc'
    : null