From d258f58952f776110bd24e9de335e0511a1e10aa Mon Sep 17 00:00:00 2001 From: Nixinova Date: Sun, 18 Jul 2021 23:07:09 +1200 Subject: [PATCH] Optional chaining (#416) --- source/plugins/languages/analyzers.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/plugins/languages/analyzers.mjs b/source/plugins/languages/analyzers.mjs index 0ca5e8a5cd4..0723883d36b 100644 --- a/source/plugins/languages/analyzers.mjs +++ b/source/plugins/languages/analyzers.mjs @@ -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\/)(?.*)(?=\/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\/)(?.*)(?=\/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 @@ -222,4 +222,4 @@ if (/languages.analyzers.mjs$/.test(process.argv[1])) { await analyze({login:"cli", data, imports}, {results, path}) console.log(results) })() -} \ No newline at end of file +}