mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 20:41:17 +00:00
feat(parser): allow parser to find renderers by name
Now we can organize renderers in individual folders and fix the mess that `../contents/classes` is!
This commit is contained in:
@@ -9,7 +9,7 @@ glob.sync('../lib/parser/contents/classes/**/*.js', { cwd: __dirname })
|
||||
.forEach((file) => {
|
||||
// Trim path
|
||||
file = file.replace('../lib/parser/contents/classes/', '').replace('.js', '');
|
||||
json.push(`'${file}': () => require('./classes/${file}'),`);
|
||||
json.push(`'${file.split('/').pop()}': () => require('./classes/${file}'),`);
|
||||
});
|
||||
|
||||
json.push('}');
|
||||
|
||||
Reference in New Issue
Block a user