Switched to tabs. Adding missing actor entries when scraping actors, with batch ID.
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
function slugify(string, delimiter = '-', {
|
||||
encode = false,
|
||||
limit = 1000,
|
||||
encode = false,
|
||||
limit = 1000,
|
||||
} = {}) {
|
||||
if (!string) {
|
||||
return string;
|
||||
}
|
||||
if (!string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
const slugComponents = string.trim().toLowerCase().match(/\w+/g);
|
||||
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}`;
|
||||
const slug = slugComponents.reduce((acc, component, index) => {
|
||||
const accSlug = `${acc}${index > 0 ? delimiter : ''}${component}`;
|
||||
|
||||
if (accSlug.length < limit) {
|
||||
return accSlug;
|
||||
}
|
||||
if (accSlug.length < limit) {
|
||||
return accSlug;
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, '');
|
||||
return acc;
|
||||
}, '');
|
||||
|
||||
return encode ? encodeURI(slug) : slug;
|
||||
return encode ? encodeURI(slug) : slug;
|
||||
}
|
||||
|
||||
module.exports = slugify;
|
||||
|
||||
Reference in New Issue
Block a user