Refactoring deep scrape. Added tag posters.

This commit is contained in:
2020-03-16 04:10:52 +01:00
parent c8ebe7892a
commit 0f09fd53eb
31 changed files with 851 additions and 589 deletions

View File

@@ -1,13 +1,14 @@
'use strict';
function slugify(string, {
function slugify(string, delimiter = '-', {
encode = false,
delimiter = '-',
limit = 1000,
} = {}) {
const slugComponents = string.trim().toLowerCase().match(/\w+/g);
if (!slugComponents) return '';
if (!slugComponents) {
return '';
}
const slug = slugComponents.reduce((acc, component, index) => {
const accSlug = `${acc}${index > 0 ? delimiter : ''}${component}`;