Skip to content

Commit

Permalink
Refactor to disallow space after object keys
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 8, 2014
1 parent 9232716 commit dcf7b09
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .jscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"disallowSpacesInsideParentheses": true,
"requireSpacesInsideObjectBrackets": "all",
"disallowDanglingUnderscores": true,
"requireSpaceAfterObjectKeys": true,
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"requireOperatorBeforeLineBreak": [
"?",
Expand Down
36 changes: 18 additions & 18 deletions script/build-languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ overrides = {
* characters/
*/

'cmn' : ['cmn_hans'],
'cmn': ['cmn_hans'],

/**
* Seems to be most popular in Nigeria:
Expand All @@ -134,13 +134,13 @@ overrides = {
* http://www.ethnologue.com/language/hau
*/

'hau' : ['hau_NG'],
'hau': ['hau_NG'],

/**
* Monotonic Greek is modern greek.
*/

'ell' : ['ell_monotonic'],
'ell': ['ell_monotonic'],

/**
* More popular, Farsi/Persian, instead of Dari
Expand All @@ -149,7 +149,7 @@ overrides = {
* http://www.ohchr.org/EN/UDHR/Pages/Language.aspx?LangID=prs1
*/

'pes' : ['pes_1'],
'pes': ['pes_1'],

/**
* Asante: 2,800,000; Fante: 1,900,000; Akuapem: 555,000.
Expand All @@ -158,22 +158,22 @@ overrides = {
* http://www.ethnologue.com/language/aka
*/

'aka' : ['aka_fante', 'aka_asante'],
'aka': ['aka_fante', 'aka_asante'],

/**
* Languages with one dated translation, pick the
* newest:
*/

'deu' : ['deu_1996'],
'ron' : ['ron_2006'],
'deu': ['deu_1996'],
'ron': ['ron_2006'],

/**
* Pick European Portuguese, maybe not fair, will
* have to investigate.
*/

'por' : ['por_PT'],
'por': ['por_PT'],

/**
* No real reason.
Expand All @@ -182,13 +182,13 @@ overrides = {
* http://www.ethnologue.com/language/nya
*/

'nya' : ['nya_chinyanja'],
'nya': ['nya_chinyanja'],

/**
* It says ``popular'' in the name?
*/

'hat' : ['hat_popular']
'hat': ['hat_popular']
};

function getUDHRKeysfromISO(iso) {
Expand Down Expand Up @@ -254,9 +254,9 @@ Object.keys(speakers).forEach(function (iso6393) {

if (language.speakers >= THRESHOLD) {
topLanguages.push({
'speakers' : language.speakers,
'name' : language.name,
'iso6393' : iso6393
'speakers': language.speakers,
'name': language.name,
'iso6393': iso6393
});
} else {
console.log(
Expand All @@ -283,10 +283,10 @@ topLanguages.forEach(function (language) {

udhrs.forEach(function (udhr) {
topLanguages.push({
'speakers' : language.speakers,
'name' : language.name,
'iso6393' : language.iso6393,
'udhr' : udhr
'speakers': language.speakers,
'name': language.name,
'iso6393': language.iso6393,
'udhr': udhr
});
});
}
Expand Down Expand Up @@ -386,7 +386,7 @@ topLanguages.forEach(function (language) {
topLanguages.forEach(function (language) {
if (language.iso6393 === 'jpn') {
language.script = {
'Hiragana, Katakana, and Han' : 0.8
'Hiragana, Katakana, and Han': 0.8
};
}
});
Expand Down
6 changes: 3 additions & 3 deletions script/build-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ table = require('markdown-table');
support = require('../data/support');

support.unshift({
'iso6393' : 'und',
'name' : '† **Special: Case for unknown language**'
'iso6393': 'und',
'name': '† **Special: Case for unknown language**'
});

fs.writeFileSync('Supported-Languages.md',
Expand All @@ -31,7 +31,7 @@ fs.writeFileSync('Supported-Languages.md',
];
})),
{
'align' : ['c', 'c', 'c', 'r']
'align': ['c', 'c', 'c', 'r']
}
) +

Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('franc()', function () {
language = franc(fixtures[MAGIC_NUMBER]);

result = franc(fixtures[MAGIC_NUMBER], {
'blacklist' : [language]
'blacklist': [language]
});

assert(result !== language);
Expand All @@ -102,7 +102,7 @@ describe('franc()', function () {
var result;

result = franc(fixtures[MAGIC_NUMBER], {
'whitelist' : [MAGIC_LANGUAGE]
'whitelist': [MAGIC_LANGUAGE]
});

assert(result === MAGIC_LANGUAGE);
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('franc.all()', function () {
shouldBeLanguage = franc(fixtures[MAGIC_NUMBER]);

result = franc.all(fixtures[MAGIC_NUMBER], {
'blacklist' : [shouldBeLanguage]
'blacklist': [shouldBeLanguage]
});

result.forEach(function (language) {
Expand All @@ -177,7 +177,7 @@ describe('franc.all()', function () {
var result;

result = franc.all(fixtures[MAGIC_NUMBER], {
'whitelist' : [MAGIC_LANGUAGE]
'whitelist': [MAGIC_LANGUAGE]
});

assert(result.length === 1);
Expand Down

0 comments on commit dcf7b09

Please sign in to comment.