chore: code formatting
This commit is contained in:
@@ -1,15 +1,16 @@
|
|||||||
//Imports
|
//Imports
|
||||||
import octicons from "@primer/octicons"
|
import octicons from "@primer/octicons"
|
||||||
|
import twemojis from "@twemoji/parser"
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import processes from "child_process"
|
import processes from "child_process"
|
||||||
import crypto from "crypto"
|
import crypto from "crypto"
|
||||||
import { minify as csso } from "csso"
|
import { minify as csso } from "csso"
|
||||||
import { JSDOM } from "jsdom"
|
|
||||||
import * as d3 from "d3"
|
import * as d3 from "d3"
|
||||||
import emoji from "emoji-name-map"
|
import emoji from "emoji-name-map"
|
||||||
import { fileTypeFromBuffer } from "file-type"
|
import { fileTypeFromBuffer } from "file-type"
|
||||||
import fss from "fs"
|
import fss from "fs"
|
||||||
import fs from "fs/promises"
|
import fs from "fs/promises"
|
||||||
|
import { JSDOM } from "jsdom"
|
||||||
import linguist from "linguist-js"
|
import linguist from "linguist-js"
|
||||||
import { marked } from "marked"
|
import { marked } from "marked"
|
||||||
import minimatch from "minimatch"
|
import minimatch from "minimatch"
|
||||||
@@ -27,7 +28,6 @@ import htmlsanitize from "sanitize-html"
|
|||||||
import sharp from "sharp"
|
import sharp from "sharp"
|
||||||
import git from "simple-git"
|
import git from "simple-git"
|
||||||
import SVGO from "svgo"
|
import SVGO from "svgo"
|
||||||
import twemojis from "@twemoji/parser"
|
|
||||||
import url from "url"
|
import url from "url"
|
||||||
import util from "util"
|
import util from "util"
|
||||||
import xmlformat from "xml-formatter"
|
import xmlformat from "xml-formatter"
|
||||||
@@ -804,7 +804,7 @@ export class D3node {
|
|||||||
|
|
||||||
createSVG(width, height) {
|
createSVG(width, height) {
|
||||||
const svg = this.element.append("svg").attr("xmlns", "http://www.w3.org/2000/svg")
|
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)
|
svg.attr("width", width).attr("height", height)
|
||||||
return svg
|
return svg
|
||||||
}
|
}
|
||||||
@@ -812,4 +812,4 @@ export class D3node {
|
|||||||
svgString() {
|
svgString() {
|
||||||
return this.element.select("svg").node()?.outerHTML || ""
|
return this.element.select("svg").node()?.outerHTML || ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ export default async function({login, data, imports, rest, q, account}, {enabled
|
|||||||
|
|
||||||
//Context
|
//Context
|
||||||
let context = {mode: "user"}
|
let context = {mode: "user"}
|
||||||
if (data.account) {
|
if (data.account)
|
||||||
context = {...context, mode: "organization"}
|
context = {...context, mode: "organization"}
|
||||||
}
|
|
||||||
else if (q.repo) {
|
else if (q.repo) {
|
||||||
console.debug(`metrics/compute/${login}/plugins > people > switched to repository mode`)
|
console.debug(`metrics/compute/${login}/plugins > people > switched to repository mode`)
|
||||||
context = {...context, mode: "repository"}
|
context = {...context, mode: "repository"}
|
||||||
@@ -38,7 +37,7 @@ export default async function({login, data, imports, rest, q, account}, {enabled
|
|||||||
return
|
return
|
||||||
//Compute changes
|
//Compute changes
|
||||||
repos[handle] = {added: 0, deleted: 0, changed: 0}
|
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) {
|
for (const contributor of contributors) {
|
||||||
let added = 0, changed = 0, deleted = 0
|
let added = 0, changed = 0, deleted = 0
|
||||||
contributor.weeks.forEach(({a = 0, d = 0, c = 0, w}) => {
|
contributor.weeks.forEach(({a = 0, d = 0, c = 0, w}) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { Client as Gmap } from "@googlemaps/google-maps-services-js"
|
import { Client as Gmap } from "@googlemaps/google-maps-services-js"
|
||||||
import color from "color"
|
import color from "color"
|
||||||
import * as d3 from "d3"
|
import * as d3 from "d3"
|
||||||
import {D3node} from "../../../app/metrics/utils.mjs"
|
import { D3node } from "../../../app/metrics/utils.mjs"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Worldmap
|
* Worldmap
|
||||||
|
|||||||
Reference in New Issue
Block a user