diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index daefeadc..ea06ddc7 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -1,15 +1,16 @@ //Imports import octicons from "@primer/octicons" +import twemojis from "@twemoji/parser" import axios from "axios" import processes from "child_process" import crypto from "crypto" import { minify as csso } from "csso" -import { JSDOM } from "jsdom" import * as d3 from "d3" import emoji from "emoji-name-map" import { fileTypeFromBuffer } from "file-type" import fss from "fs" import fs from "fs/promises" +import { JSDOM } from "jsdom" import linguist from "linguist-js" import { marked } from "marked" import minimatch from "minimatch" @@ -27,7 +28,6 @@ import htmlsanitize from "sanitize-html" import sharp from "sharp" import git from "simple-git" import SVGO from "svgo" -import twemojis from "@twemoji/parser" import url from "url" import util from "util" import xmlformat from "xml-formatter" @@ -804,7 +804,7 @@ export class D3node { createSVG(width, height) { const svg = this.element.append("svg").attr("xmlns", "http://www.w3.org/2000/svg") - if ((width)&&(height)) + if ((width) && (height)) svg.attr("width", width).attr("height", height) return svg } @@ -812,4 +812,4 @@ export class D3node { svgString() { return this.element.select("svg").node()?.outerHTML || "" } -} \ No newline at end of file +} diff --git a/source/plugins/lines/index.mjs b/source/plugins/lines/index.mjs index e8ec75a7..8903681d 100644 --- a/source/plugins/lines/index.mjs +++ b/source/plugins/lines/index.mjs @@ -12,9 +12,8 @@ export default async function({login, data, imports, rest, q, account}, {enabled //Context let context = {mode: "user"} - if (data.account) { + if (data.account) context = {...context, mode: "organization"} - } else if (q.repo) { console.debug(`metrics/compute/${login}/plugins > people > switched to repository mode`) context = {...context, mode: "repository"} @@ -38,7 +37,7 @@ export default async function({login, data, imports, rest, q, account}, {enabled return //Compute changes repos[handle] = {added: 0, deleted: 0, changed: 0} - const contributors = stats.filter(({author}) => (context.mode === "repository")||(context.mode === "organization") ? true : author?.login?.toLocaleLowerCase() === login.toLocaleLowerCase()) + const contributors = stats.filter(({author}) => (context.mode === "repository") || (context.mode === "organization") ? true : author?.login?.toLocaleLowerCase() === login.toLocaleLowerCase()) for (const contributor of contributors) { let added = 0, changed = 0, deleted = 0 contributor.weeks.forEach(({a = 0, d = 0, c = 0, w}) => { diff --git a/source/plugins/stargazers/worldmap/index.mjs b/source/plugins/stargazers/worldmap/index.mjs index 0de86e2e..3a7ad590 100644 --- a/source/plugins/stargazers/worldmap/index.mjs +++ b/source/plugins/stargazers/worldmap/index.mjs @@ -2,7 +2,7 @@ import { Client as Gmap } from "@googlemaps/google-maps-services-js" import color from "color" import * as d3 from "d3" -import {D3node} from "../../../app/metrics/utils.mjs" +import { D3node } from "../../../app/metrics/utils.mjs" /** * Worldmap