Skip to content

Commit

Permalink
Optional chaining (lowlighter#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Jul 18, 2021
1 parent f22a6d6 commit d258f58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/plugins/languages/analyzers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function recent({login, data, imports, rest, account}, {skipped = [
]
.filter(({status}) => status === "fulfilled")
.map(({value}) => value)
.flatMap(files => files.map(file => ({name:imports.paths.basename(file.filename), directory:imports.paths.dirname(file.filename), patch:file.patch ?? "", repo:file.raw_url.match(/(?<=^https:..github.com\/)(?<repo>.*)(?=\/raw)/)?.groups.repo ?? "_"})))
.flatMap(files => files.map(file => ({name:imports.paths.basename(file.filename), directory:imports.paths.dirname(file.filename), patch:file.patch ?? "", repo:file.raw_url?.match(/(?<=^https:..github.com\/)(?<repo>.*)(?=\/raw)/)?.groups.repo ?? "_"})))
.map(({name, directory, patch, repo}) => ({name, directory:`${repo.replace(/[/]/g, "@")}/${directory}`, patch:patch.split("\n").filter(line => /^[+]/.test(line)).map(line => line.substring(1)).join("\n")}))

//Temporary directory
Expand Down Expand Up @@ -222,4 +222,4 @@ if (/languages.analyzers.mjs$/.test(process.argv[1])) {
await analyze({login:"cli", data, imports}, {results, path})
console.log(results)
})()
}
}

0 comments on commit d258f58

Please sign in to comment.