Skip to content

Commit

Permalink
feat: include color property
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastiaanYN committed Apr 6, 2020
1 parent e680815 commit 1a72be9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1a72be9

Please sign in to comment.