Refactoring deep scrape. Added tag posters.
This commit is contained in:
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user