How to use the rambdax.glue function in rambdax

To help you get started, we’ve selected a few rambdax 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 selfrefactor / useful-javascript-libraries / src / _modules / repoData.js View on Github external
async function repoData(input, secondaryFlag) {
  try {
    const splitted = input.split('/')
    if (splitted.length !== 5) return false
    const [ owner, repo ] = takeLast(2, splitted)
    console.log(repo)
    const url = glue(
      `
      https://api.github.com
      repos
      ${ owner }
      ${ repo }?access_token=${ process.env.GITHUB }  
    `,
      '/'
    )

    const { status, data } = await get(url)
    if (status > 200) return false

    const packageJsonUrl = glue(
      `
      https://api.github.com
      repos
github selfrefactor / useful-javascript-libraries / src / _modules / repoData.js View on Github external
const [ owner, repo ] = takeLast(2, splitted)
    console.log(repo)
    const url = glue(
      `
      https://api.github.com
      repos
      ${ owner }
      ${ repo }?access_token=${ process.env.GITHUB }  
    `,
      '/'
    )

    const { status, data } = await get(url)
    if (status > 200) return false

    const packageJsonUrl = glue(
      `
      https://api.github.com
      repos
      ${ owner }
      ${ repo }
      contents
      package.json?access_token=${ process.env.GITHUB }  
    `,
      '/'
    )

    let isLibrary
    let isReact = false
    let isTypescript = false
    try {
      const response = await get(packageJsonUrl)
github selfrefactor / rambda / files / createReadme / addToggleDetails.js View on Github external
function addToggleDetails(input){
  const [ methodName ] = input.split('\n')
  const testContent = getFileContent(`${ methodName }.spec`)
  const methodContent = getFileContent(methodName)
  if (!testContent || !methodContent) return input

  const rawDetails = glue(`
  <details>${ NEW_LINE }
  <summary>
  R.${ methodName } tests
  </summary>${ NEW_LINE }
  \`\`\`javascript
  ${ CONTENT_MARKER }
  \`\`\`${ NEW_LINE }
  </details>  
  `, '\n')

  const rawMethodContent = glue(`
  <details>${ NEW_LINE }
  <summary>
  R.${ methodName } source
  </summary>${ NEW_LINE }
  \`\`\`javascript</details>
github selfrefactor / rambda / files / createReadme / addToggleDetails.js View on Github external
const testContent = getFileContent(`${ methodName }.spec`)
  const methodContent = getFileContent(methodName)
  if (!testContent || !methodContent) return input

  const rawDetails = glue(`
  <details>${ NEW_LINE }
  <summary>
  R.${ methodName } tests
  </summary>${ NEW_LINE }
  \`\`\`javascript
  ${ CONTENT_MARKER }
  \`\`\`${ NEW_LINE }
  </details>  
  `, '\n')

  const rawMethodContent = glue(`
  <details>${ NEW_LINE }
  <summary>
  R.${ methodName } source
  </summary>${ NEW_LINE }
  \`\`\`javascript
  ${ CONTENT_MARKER }
  \`\`\`${ NEW_LINE }
  </details>  
  `, '\n')

  const stillRawDetails = replace(CONTENT_MARKER, testContent, rawDetails)
  const details = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawDetails)
  const stillRawMethodContent = replace(CONTENT_MARKER, methodContent, rawMethodContent)
  const finalMethodContent = replace(new RegExp(NEW_LINE, 'gm'), '\n', stillRawMethodContent)

  const withJavascriptTag = replace('```\n', '```javascript\n', input)