Merge pull request #18 from Bouncey/feat/transitionIntros

Feat Transition Intros
This commit is contained in:
Stuart Taylor
2018-04-17 15:24:17 +01:00
committed by Mrugesh Mohapatra
parent fa68757553
commit 4d9f59f318
12 changed files with 243 additions and 85 deletions

View File

@@ -13,22 +13,16 @@ const preFormattedBlockNames = {
'the-dom': 'The DOM'
};
const noFormatting = [
'and',
'for',
'of',
'the',
'up',
'with'
];
const noFormatting = ['and', 'for', 'of', 'the', 'up', 'with'];
exports.blockNameify = function blockNameify(phrase) {
const preFormatted = preFormattedBlockNames[phrase] || '';
if (preFormatted) {
return preFormatted;
}
return phrase.split('-')
.map((word) => {
return phrase
.split('-')
.map(word => {
if (noFormatting.indexOf(word) !== -1) {
return word;
}