How to use the rambdax.uniqWith 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 / indexProve.js View on Github external
repoDataSecondary,
    linksSecondary
  )

  const withRepoData = withRepoDataRaw.filter(Boolean)
  const withRepoDataSecondary = withRepoDataSecondaryRaw.filter(Boolean)

  const score = withRepoData.map(x => ({
    ...x,
    score : getScore(x, true),
  }))
  const scoreSecondary = withRepoDataSecondary.map(x => ({
    ...x,
    score : getScore(x, true),
  }))
  const toSave = uniqWith((a, b) => a.name === b.name, [
    ...score,
    ...scoreSecondary,
  ])

  writeJSONSync(REPO_DATA, { repoData : toSave }, { spaces : '\t' })
}
github selfrefactor / useful-javascript-libraries / src / indexProve.js View on Github external
createData,
  createReadme,
  score,
  updateSecondary,
  fromSelfrefactor,
}){
  if (bookmarks) bookmarksToLinks(BOOKMARKS)
  if (fromSelfrefactor) await updateFromSelfrefactor()
  if (updateSecondary) await updateSecondaryFn()
  if (createData) await createDataJSON()
  if (score) await createScores()
  if (!createReadme) return

  const { repoData } = readJSONSync(REPO_DATA)
  const sorted = sort((a, b) => b.score - a.score, repoData)
  const reposRaw = uniqWith((a, b) => a.name === b.name, sorted)
  const awesomeRepos = reposRaw.filter(isAwesomeRepo)
  const repos = reject(isAwesomeRepo, reposRaw)

  const jsRelated = repos.filter(isJS)
  const jsLibs = jsRelated.filter(isLibrary)
  const reactLibs = jsRelated.filter(prop('isReact'))
  const tsLibs = jsRelated.filter(prop('isTypescript'))
  const jsProjects = jsRelated.filter(complement(prop('isLibrary')))
  const otherLibs = repos.filter(complement(isJS))

  const jsContent = createReadmePartial(jsLibs)
  const awesomeContent = createReadmePartial(awesomeRepos)
  const reactContent = createReadmePartial(reactLibs)
  const tsContent = createReadmePartial(tsLibs)
  const jsProjectsContent = createReadmePartial(jsProjects)
  const otherContent = createReadmePartial(otherLibs)