gslides-maker
Version:
Generate Google Slides from Wikipedia
21 lines (17 loc) • 576 B
JavaScript
Object.defineProperty(exports, "__esModule", {value: true});
function upperFirstChar (str) {
return str.charAt(0).toUpperCase() + str.slice(1)
}
function getKeyword (keywords, articleName) {
const nameSplit = articleName.split(' ')
nameSplit.push(articleName)
for (const name of nameSplit) {
for (const keyword of keywords) {
if (!keyword.includes(name)) {
return keyword
}
}
}
}
const subtitle = (keywords, articleName) => upperFirstChar(getKeyword(keywords, articleName))
exports. default = subtitle
;