font-picker
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -174,3 +174,3 @@ (function (global, factory) { | ||
*/ | ||
function filterList(fontList, activeFont, options) { | ||
function filterList(fontList, defaultFont, options) { | ||
var filteredList = fontList; | ||
@@ -204,9 +204,2 @@ | ||
// Add default font to beginning of list if it is not already in it | ||
if (filteredList.filter(function (font) { | ||
return font.family === activeFont.family; | ||
}).length === 0) { | ||
filteredList.unshift(activeFont); | ||
} | ||
// 'limit' parameter (limit font list size) | ||
@@ -217,2 +210,14 @@ if (options.limit) { | ||
// Add default font to list if it is not already in it | ||
if (filteredList.filter(function (font) { | ||
return font.family === defaultFont.family; | ||
}).length === 0) { | ||
// Add default font to beginning of list | ||
filteredList.unshift(defaultFont); | ||
// Remove least popular font from list if limit parameter is set | ||
if (options.limit) { | ||
filteredList.pop(); | ||
} | ||
} | ||
// 'sort' parameter (list is already sorted by popularity) | ||
@@ -219,0 +224,0 @@ if (options.sort === 'alphabetical') { |
{ | ||
"name": "font-picker", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Font selector component for Google Fonts", | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"autoprefixer": "^8.6.5", | ||
"autoprefixer": "^9.1.2", | ||
"babel-core": "^6.26.3", | ||
@@ -36,11 +36,11 @@ "babel-plugin-external-helpers": "^6.22.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.13.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"husky": "^0.14.3", | ||
"node-sass": "^4.9.2", | ||
"node-sass": "^4.9.3", | ||
"npm-run-all": "^4.1.3", | ||
"postcss": "^6.0.23", | ||
"rollup": "^0.62.0", | ||
"postcss": "^7.0.2", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-babel": "^3.0.7", | ||
"rollup-plugin-postcss": "^1.6.2", | ||
"serve": "^9.2.0" | ||
"serve": "^9.6.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80440
5
741