How to use the @mdx-js/util.paramCase function in @mdx-js/util

To help you get started, we’ve selected a few @mdx-js/util 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 mdx-js / mdx / packages / mdx / mdx-hast-to-jsx.js View on Github external
(properties, [key, value]) =>
        Object.assign({}, properties, {
          [paramCaseRe.test(key) ? paramCase(key) : key]: value
        }),
      {}
github mdx-js / mdx / packages / babel-plugin-html-attributes-to-jsx / index.js View on Github external
JSXAttribute(node) {
    if (node.node.name.name in TRANSLATIONS) {
      node.node.name.name = TRANSLATIONS[node.node.name.name]
    } else if (node.node.name.name === `props`) {
      node.traverse(propsKeysVisitor)
    } else if (
      node.node.name.name.startsWith(`data`) ||
      node.node.name.name.startsWith(`aria`)
    ) {
      const CAMEL_CASE_REGEX = /^(aria[A-Z])|(data[A-Z])/
      if (CAMEL_CASE_REGEX.test(node.node.name.name)) {
        node.node.name.name = camelCase(node.node.name.name)
      }
    } else if (
      node.node.name.name in ARRAY_TO_STRING &&
      node.node.value.type === 'JSXExpressionContainer' &&
      node.node.value.expression.type === 'ArrayExpression'
    ) {
      node.node.value = t.stringLiteral(
        node.node.value.expression.elements.map(el => el.value).join(' ')
      )
    }

    if (
      node.node.name.name === `style` &&
      node.node.value.type === `StringLiteral`
    ) {
      let styleArray = []

@mdx-js/util

Deprecated: this package is no longer maintained.

MIT
Latest version published 1 month ago

Package Health Score

69 / 100
Full package analysis

Similar packages