From 1a72be9fef660266c9475fe163ae151300d0ef8d Mon Sep 17 00:00:00 2001 From: SebastiaanYN Date: Mon, 6 Apr 2020 17:09:57 +0200 Subject: [PATCH] feat: include color property --- README.md | 1 + package.json | 2 +- src/index.js | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9f6266..7cc87cc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Small package that turns `github/linguist` [languages.yml](https://github.com/gi { "183": { "name": "JavaScript", + "color": "f1e05a", "extension": "js", "aliases": [ "js", diff --git a/package.json b/package.json index 6c43e15..0b66d56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sourcebin/linguist", - "version": "0.0.2", + "version": "0.0.3", "main": "dist/index.js", "scripts": { "build": "node src/index.js", diff --git a/src/index.js b/src/index.js index 69f6a54..e81725d 100644 --- a/src/index.js +++ b/src/index.js @@ -22,12 +22,17 @@ function mergeOverrides(linguist) { } function transformLanguage(name, data) { + const color = data.color + ? data.color.slice(1) + : undefined; + const extension = data.extensions ? data.extensions[0].replace(/^\./, '') : undefined; return { name, + color, extension, aliases: data.aliases, aceMode: data.ace_mode,