mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-05-30 02:22:10 +00:00
feat: hide specific languages in "Top languages" card (#150)
* add new query param to hide specific languages in top languages card * [top-langs] add function to clean out the provided lang name * [top-langs] rename 'hide_lang' => 'hide', refactor logic for parsing the list of provided languages to hide * [top-langs] take list of languages to hide, as a json array * chore: minor changes * docs: added docs for hide lang Co-authored-by: anuraghazra <hazru.anurag@gmail.com>
This commit is contained in:
+11
-1
@@ -44,6 +44,14 @@ function parseBoolean(value) {
|
||||
}
|
||||
}
|
||||
|
||||
function parseJSON(str) {
|
||||
try {
|
||||
return JSON.parse(str);
|
||||
} catch (err) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function clampValue(number, min, max) {
|
||||
return Math.max(min, Math.min(number, max));
|
||||
}
|
||||
@@ -118,7 +126,8 @@ function getCardColors({
|
||||
|
||||
const fn = () => {};
|
||||
// return console instance based on the environment
|
||||
const logger = process.env.NODE_ENV !== "test" ? console : { log: fn, error: fn };
|
||||
const logger =
|
||||
process.env.NODE_ENV !== "test" ? console : { log: fn, error: fn };
|
||||
|
||||
const CONSTANTS = {
|
||||
THIRTY_MINUTES: 1800,
|
||||
@@ -132,6 +141,7 @@ module.exports = {
|
||||
encodeHTML,
|
||||
isValidHexColor,
|
||||
request,
|
||||
parseJSON,
|
||||
parseBoolean,
|
||||
fallbackColor,
|
||||
FlexLayout,
|
||||
|
||||
Reference in New Issue
Block a user