How to use the rambdax.remove 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 / toGithubURL.js View on Github external
async function toGithubURL(url) {
  const packageKey = last(url.split('/'))
  const command = `npm info --json ${ packageKey }`
  const packageInfoRaw = await execCommand(command)
  const packageInfo = JSON.parse(packageInfoRaw)
  
  if(packageInfo.error){
    console.log(packageKey, 'with error')
    return
  }
  const repoRaw = path('repository.url', packageInfo)
  if (!repoRaw) return false

  return remove([ 'git+', '.git' ], repoRaw)
}
github selfrefactor / rambda / files / createReadme / cleanTOC.js View on Github external
function cleanTOC(input){
  const removed = remove([
    '- [Rambda](#rambda)',
    '* [Rambda\'s advantages](#rambdas-advantages)',
  ], input).trim()

  return removed.split('\n').map(
    trim
  )
    .join('\n')
}
github selfrefactor / rambda / files / deprecated / createReadmex.js View on Github external
void function createReadmex(){
  const content = readFileSync(OUTPUT).toString()
  const [ apiRaw ] = match(/## API(.|\n)+## Benchmark/g, content)
  const [ links ] = match(/## Browse by category(.|\n)+/g, content)
  const api = remove('## Benchmark', apiRaw).trim()

  const docsify = `${ TITLE }\n\n${ api }\n\n${ links }`

  writeFileSync(OUTPUT, docsify)
}()
github selfrefactor / rambda / files / createReadme / createReadme.js View on Github external
const withFailingTestsResults = replace(
    'MARKER_FAILING_TESTS_SUMMARY',
    failingTestsSummary,
    withMissingRamdaMethods
  )
  const withBenchmarkSummary = replace(
    'MARKER_BENCHMARK_SUMMARY',
    benchmarkSummaryContent,
    withFailingTestsResults
  )
  const withChangelog = inject(
    changelog,
    '## Changelog\n\n',
    withBenchmarkSummary
  )
  const final = remove(
    '\n* [Example use](#example-use)\n',
    withChangelog
  )
  writeFileSync(outputPath, final)
}()
github selfrefactor / useful-javascript-libraries / src / indexProve.js View on Github external
map(x => {
      const replaced = replace(/(git:)|(ssh:)/, 'https:', x)

      return remove('git@', replaced)
    })
  )
github selfrefactor / rambda / files / createReadme / benchmarkSummary.js View on Github external
function parseMethodName(input){
  if (!input.endsWith('Curried')) return input

  const methodName = remove('Curried', input)

  return `${ methodName } (curried)`
}
github selfrefactor / useful-javascript-libraries / src / _modules / bookmarksToLinks.js View on Github external
function bookmarksToLinks(output){
  const content = readFileSync(FILE).toString()
  const matched = match(
    /href=".+" ICON/gmi,
    content
  )

  const filtered = matched.filter(x => anyTrue(
    x.includes(GITHUB_MARKER),
    x.includes(NPM_MARKER),
  ))

  const newLinks = filtered.map(
    remove([ 'HREF="', /".+/g ])
  ).join('\n')

  writeFileSync(output, newLinks)
}
github selfrefactor / rambda / files / createReadme / addToggleDetails.js View on Github external
\`\`\`javascript
  ${ CONTENT_MARKER }
  \`\`\`${ NEW_LINE }
    
  `, '\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)
  const withToggleDetails = replace('```\n', `\`\`\`\n\n${ details }\n`, withJavascriptTag)
  const withMethodContent = replace('', `\n\n${ finalMethodContent }`, withToggleDetails)

  const withoutSourceLink = remove(
    /\[Source.+/,
    withMethodContent
  )

  return withoutSourceLink
}