Added commas to languages
This commit is contained in:
parent
0561548ffa
commit
b25371f0d9
1 changed files with 12 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ const getLanguage = (key, worker) => ({
|
|||
const getLanguages = (key) => ({
|
||||
key: 'Languages',
|
||||
code: `navigator.${key}`,
|
||||
value: navigator[key],
|
||||
value: sortArr(navigator[key]),
|
||||
issues: [
|
||||
checkNavigatorProperties(key),
|
||||
checkNavigatorValue(key),
|
||||
|
|
@ -149,6 +149,17 @@ const getVendor = (key) => ({
|
|||
],
|
||||
});
|
||||
|
||||
// sorts array into comma separated list
|
||||
const sortArr = (arr) => {
|
||||
const arrLength = arr.length;
|
||||
let list = '';
|
||||
for (let i = 0; i < arrLength; i++) {
|
||||
if (i !== 0) list += ', ';
|
||||
list += arr[i];
|
||||
}
|
||||
return list;
|
||||
};
|
||||
|
||||
// sorts plugins object into comma separated list
|
||||
const sortPlugins = (data) => {
|
||||
const { length } = data;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue