Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function generateLinks(bookmarksContent){
const allLinks = bookmarksContent
.split('\n')
.s(reject(includes('gist.')))
.s(reject(includes('?tab')))
.s(reject(includes('trending')))
.s(filter(x => x.includes('github.com') || x.includes('npmjs')))
const withCorrectLinks = await mapAsync(async x => {
if (x.includes('github.com')) return x
const url = await toGithubURL(x)
return url
}, allLinks)
return withCorrectLinks.s(filter(Boolean)).s(
map(x => {
const replaced = replace(/(git:)|(ssh:)/, 'https:', x)
return remove('git@', replaced)
})
)
async function generateLinks(bookmarksContent){
const allLinks = bookmarksContent
.split('\n')
.s(reject(includes('gist.')))
.s(reject(includes('?tab')))
.s(reject(includes('trending')))
.s(filter(x => x.includes('github.com') || x.includes('npmjs')))
const withCorrectLinks = await mapAsync(async x => {
if (x.includes('github.com')) return x
const url = await toGithubURL(x)
return url
}, allLinks)
return withCorrectLinks.s(filter(Boolean)).s(
map(x => {
const replaced = replace(/(git:)|(ssh:)/, 'https:', x)
return remove('git@', replaced)
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)
const jsTitle = template(TITLE, {