Unverified Commit 738fa7a4 authored by renovate[bot]'s avatar renovate[bot] Committed by GitHub
Browse files

fix(deps): update all non-major dependencies (#198)


Co-authored-by: default avatarRenovate Bot <bot@renovateapp.com>
parent 68d34c38
FROM ghcr.io/socialgouv/docker/nginx4spa:6.16.0
FROM ghcr.io/socialgouv/docker/nginx4spa:6.17.0
COPY ./public /usr/share/nginx/html
......@@ -24,23 +24,23 @@
"@material-ui/styles": "latest",
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@socialgouv/eslint-config-react": "^1.70.0",
"@socialgouv/eslint-config-react": "^1.75.0",
"axios": "^0.21.0",
"date-fns": "^2.21.3",
"deepmerge": "^4.2.2",
"gatsby": "^3.4.2",
"gatsby-image": "^3.4.0",
"gatsby-image": "^3.6.0",
"gatsby-plugin-material-ui": "^3.0.1",
"gatsby-plugin-matomo": "^0.9.0",
"gatsby-plugin-mdx": "^2.4.0",
"gatsby-plugin-matomo": "^0.10.0",
"gatsby-plugin-mdx": "^2.6.0",
"gatsby-plugin-offline": "latest",
"gatsby-plugin-react-helmet": "latest",
"gatsby-plugin-sharp": "^3.4.2",
"gatsby-plugin-typescript": "latest",
"gatsby-remark-autolink-headers": "^4.1.0",
"gatsby-source-filesystem": "^3.4.0",
"gatsby-transformer-remark": "^4.1.0",
"gatsby-transformer-sharp": "^3.4.0",
"gatsby-remark-autolink-headers": "^4.3.0",
"gatsby-source-filesystem": "^3.6.0",
"gatsby-transformer-remark": "^4.3.0",
"gatsby-transformer-sharp": "^3.6.0",
"lodash": "^4.17.21",
"react": "latest",
"react-dom": "latest",
......@@ -58,18 +58,18 @@
"@types/react-simple-maps": "^1.0.3",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"eslint": "^7.25.0",
"eslint": "^7.27.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"graphql": "15.5.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"prettier": "^2.3.0",
"source-map-support": "^0.5.19",
"ts-node": "^9.1.1",
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"repository": {
"type": "git",
......
......@@ -18,18 +18,17 @@ const findCountryValue = (
countryCode: string
): number | undefined => countries[countryCode.toLowerCase()];
const getCountryColor = (
countries: Record<string, number>,
primary: PaletteColor
) => (geo: any): string => {
const countryCode = geo.properties.ISO_A2.toLowerCase();
const countryValue = findCountryValue(countries, countryCode);
const countryColorGetter = getColorGradient(primary);
const maxValue = Math.max(...Object.values(countries));
return countryValue
? countryColorGetter(countryValue, maxValue)
: DEFAULT_COLOR;
};
const getCountryColor =
(countries: Record<string, number>, primary: PaletteColor) =>
(geo: any): string => {
const countryCode = geo.properties.ISO_A2.toLowerCase();
const countryValue = findCountryValue(countries, countryCode);
const countryColorGetter = getColorGradient(primary);
const maxValue = Math.max(...Object.values(countries));
return countryValue
? countryColorGetter(countryValue, maxValue)
: DEFAULT_COLOR;
};
type StatisticMapChartProps = {
statistic: MapChartStatisticConfig;
......
......@@ -67,8 +67,7 @@ export const timelineElements: TimelineElement[] = [
{
date: "11/2018",
icon: <SyncIcon />,
link:
"https://www.programmevitam.fr/ressources/Newsletter/2019_Newsletter%20Vitam_n10_janvier_2019.pdf",
link: "https://www.programmevitam.fr/ressources/Newsletter/2019_Newsletter%20Vitam_n10_janvier_2019.pdf",
title:
"Première entrée dans Adamant d’un versement traité dans Archifiltre",
},
......@@ -87,8 +86,7 @@ export const timelineElements: TimelineElement[] = [
{
date: "04/2019",
icon: <ForumIcon />,
link:
"https://forum.archivistes.org/wp-content/uploads/sites/13/2019/03/guide-150319-v3.pdf",
link: "https://forum.archivistes.org/wp-content/uploads/sites/13/2019/03/guide-150319-v3.pdf",
title:
"Présentation au forum de l’AAF (Association des archivistes français)",
},
......@@ -132,8 +130,7 @@ export const timelineElements: TimelineElement[] = [
{
date: "04/2020",
icon: <MenuBookIcon />,
link:
"https://www.lemondeinformatique.fr/actualites/lire-vitam-et-archifiltre-entrent-au-sill-referentiel-de-logiciels-libres-de-l-etat-79010.html",
link: "https://www.lemondeinformatique.fr/actualites/lire-vitam-et-archifiltre-entrent-au-sill-referentiel-de-logiciels-libres-de-l-etat-79010.html",
title: (
<span>
Article évoquant Archifiltre dans{" "}
......@@ -144,8 +141,7 @@ export const timelineElements: TimelineElement[] = [
{
date: "06/2020",
icon: <MenuBookIcon />,
link:
"https://blog-ica.org/fr/2020/06/13/presentation-darchifiltre-un-outil-libre/",
link: "https://blog-ica.org/fr/2020/06/13/presentation-darchifiltre-un-outil-libre/",
title: "Présentation d’Archifiltre sur le blog de l'ICA",
},
{
......
......@@ -28,22 +28,19 @@ export const tweetIds = [
export const homepageTweets = [
{
date: "28 avril 2020",
text:
"Je viens de télécharger @ArchiFiltre et j'ai fait analyser des répertoires. Des arborescences et métadonnées sont apparues dans une visualisation claire. Très chouette !",
text: "Je viens de télécharger @ArchiFiltre et j'ai fait analyser des répertoires. Des arborescences et métadonnées sont apparues dans une visualisation claire. Très chouette !",
url: "https://twitter.com/ItStartsWithARC/status/1255205190015254528",
username: "@ItStartsWithARC",
},
{
date: "24 avril 2020",
text:
"Découverte de #ArchiFiltre grâce à un super pote archiviste... Je vois le bout du tunnel et vais enfin me lancer dans le classement des archives électroniques sans peur ! Merci !!!!",
text: "Découverte de #ArchiFiltre grâce à un super pote archiviste... Je vois le bout du tunnel et vais enfin me lancer dans le classement des archives électroniques sans peur ! Merci !!!!",
url: "https://twitter.com/Marumotto93/status/1253683077664182272",
username: "@Marumotto93",
},
{
date: "19 avril 2018",
text:
"Très sympa comme outil @ArchiFiltre. Facile à prendre en main. La visualisation est intéressante. On voit bien la profondeur de l'arborescence et on repère facilement les dossiers les plus volumineux. ",
text: "Très sympa comme outil @ArchiFiltre. Facile à prendre en main. La visualisation est intéressante. On voit bien la profondeur de l'arborescence et on repère facilement les dossiers les plus volumineux. ",
url: "https://twitter.com/brullier7/status/986932580250505216",
username: "@brullier7",
},
......
......@@ -10,43 +10,37 @@ export default [
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-win64.sha512",
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.exe",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-win32.sha512",
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1-32bit.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1-32bit.exe",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-linux.sha512",
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.AppImage",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.AppImage",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-mac.sha512",
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.dmg",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-win64-msi.sha512",
id: OS.MSI64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1.msi",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-win32-msi.sha512",
id: OS.MSI32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1-32bit.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.1/archifiltre-3.2.1-32bit.msi",
},
],
},
......@@ -59,43 +53,37 @@ export default [
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-win64.sha512",
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.exe",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-win32.sha512",
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0-32bit.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0-32bit.exe",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-linux.sha512",
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.AppImage",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.AppImage",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-mac.sha512",
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.dmg",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-win64-msi.sha512",
id: OS.MSI64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0.msi",
},
{
hashUrl:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-win32-msi.sha512",
id: OS.MSI32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0-32bit.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.2.0/archifiltre-3.2.0-32bit.msi",
},
],
},
......@@ -106,33 +94,27 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.exe",
},
{
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.AppImage",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.AppImage",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.dmg",
},
{
id: OS.MSI64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.msi",
},
{
id: OS.MSI32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.msi",
},
],
},
......@@ -143,33 +125,27 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.exe",
},
{
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.AppImage",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.AppImage",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.dmg",
},
{
id: OS.MSI64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.msi",
},
{
id: OS.MSI32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.msi",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.msi",
},
],
},
......@@ -180,23 +156,19 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre.exe",
},
{
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre-32bit.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre-32bit.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre.tar.gz",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre.tar.gz",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v3.0.0/archifiltre.dmg",
},
],
},
......@@ -207,23 +179,19 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre.exe",
},
{
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre-32bit.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre-32bit.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre.tar.gz",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre.tar.gz",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.1/archifiltre.dmg",
},
],
},
......@@ -234,18 +202,15 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.0/archifiltre.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.0/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.0/archifiltre.tar.gz",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.0/archifiltre.tar.gz",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.1.0/archifiltre.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.1.0/archifiltre.dmg",
},
],
},
......@@ -256,18 +221,15 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.0.0/archifiltre.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.0.0/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.0.0/archifiltre.tar.gz",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.0.0/archifiltre.tar.gz",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v2.0.0/archifiltre.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v2.0.0/archifiltre.dmg",
},
],
},
......@@ -278,18 +240,15 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v13.1/archifiltre.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v13.1/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v13.1/archifiltre.tar.gz",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v13.1/archifiltre.tar.gz",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v13.1/archifiltre.dmg",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v13.1/archifiltre.dmg",
},
],
},
......@@ -300,13 +259,11 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v13/archifiltre.exe",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v13/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v13/archifiltre.tar.gz",
url: "https://github.com/SocialGouv/archifiltre/releases/download/v13/archifiltre.tar.gz",
},
],
},
......@@ -317,13 +274,11 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/archifiltre/v12/releases/download/windows/archifiltre.exe",
url: "https://github.com/archifiltre/v12/releases/download/windows/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/archifiltre/v12/releases/download/linux/archifiltre.tar.gz",
url: "https://github.com/archifiltre/v12/releases/download/linux/archifiltre.tar.gz",
},
],
},
......@@ -334,13 +289,11 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/archifiltre/v11/releases/download/windows/archifiltre.exe",
url: "https://github.com/archifiltre/v11/releases/download/windows/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/archifiltre/v11/releases/download/linux/archifiltre.tar.gz",
url: "https://github.com/archifiltre/v11/releases/download/linux/archifiltre.tar.gz",
},
],
},
......@@ -351,13 +304,11 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/archifiltre/v10/releases/download/windows/archifiltre.exe",
url: "https://github.com/archifiltre/v10/releases/download/windows/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/archifiltre/v10/releases/download/linux/archifiltre.tar.gz",
url: "https://github.com/archifiltre/v10/releases/download/linux/archifiltre.tar.gz",
},
],
},
......@@ -368,13 +319,11 @@ export default [
platforms: [
{
id: OS.WIN64,
url:
"https://github.com/archifiltre/v9/releases/download/windows/archifiltre.exe",
url: "https://github.com/archifiltre/v9/releases/download/windows/archifiltre.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/archifiltre/v9/releases/download/linux/archifiltre.tar.gz",
url: "https://github.com/archifiltre/v9/releases/download/linux/archifiltre.tar.gz",
},
],
},
......
import { PaletteColor } from "@material-ui/core/styles/createPalette";
export const getColorGradient = (paletteColor: PaletteColor) => (
value: number,
maxValue: number
): string => {
const ratio = value / maxValue;
if (ratio > 2 / 3) {
return paletteColor.dark;
}
if (ratio > 1 / 3) {
return paletteColor.main;
}
return paletteColor.light;
};
export const getColorGradient =
(paletteColor: PaletteColor) =>
(value: number, maxValue: number): string => {
const ratio = value / maxValue;
if (ratio > 2 / 3) {
return paletteColor.dark;
}
if (ratio > 1 / 3) {
return paletteColor.main;
}
return paletteColor.light;
};
......@@ -17,21 +17,21 @@ const spaceStart = (data: string): string => {
return `${data.slice(0, chunkSize)} ${spaceStart(data.slice(chunkSize))}`;
};
export const spaceNumber = ({ minDigits }: SpaceNumberConfig) => (
value: number
) => {
const stringNumber = value.toString();
return stringNumber.length < minDigits
? stringNumber
: spaceStart(stringNumber);
};
export const spaceNumberForAnyValue = <T>(config: SpaceNumberConfig) => (
value: T
): T | string => {
if (!_.isNumber(value)) {
return value;
}
return spaceNumber(config)(value);
};
export const spaceNumber =
({ minDigits }: SpaceNumberConfig) =>
(value: number) => {
const stringNumber = value.toString();
return stringNumber.length < minDigits
? stringNumber
: spaceStart(stringNumber);
};
export const spaceNumberForAnyValue =
<T>(config: SpaceNumberConfig) =>
(value: T): T | string => {
if (!_.isNumber(value)) {
return value;
}
return spaceNumber(config)(value);
};
......@@ -55,13 +55,13 @@ const extractCommonProps = ({
unit,
});
const formatAggregatedStatistic = (statistic: AggregatedStatisticConfig) => (