mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-07 11:38:32 +00:00
Clean up a bunch of linting stuff. Clean up event listeners in tooltips to stop potential memory leaks.
This commit is contained in:
parent
f506b512b4
commit
7ecd45fcfb
23 changed files with 70 additions and 79 deletions
|
@ -521,9 +521,9 @@ export class Module extends EventEmitter {
|
|||
for(const raw_path of ctx.keys()) {
|
||||
const raw_module = ctx(raw_path),
|
||||
module = raw_module.module || raw_module.default,
|
||||
name = raw_path.slice(2, raw_path.length - (raw_path.endsWith('/index.jsx') ? 10 : raw_path.endsWith('/index.js') ? 9 : raw_path.endsWith('.jsx') ? 4 : 3));
|
||||
|
||||
// TODO: rewrite the name code to not have like 4 endsWith in it.
|
||||
lix = raw_path.lastIndexOf('.'),
|
||||
trimmed = lix > 2 ? raw_path.slice(2, lix) : raw_path,
|
||||
name = trimmed.endsWith('/index') ? trimmed.slice(0, -6) : trimmed;
|
||||
|
||||
try {
|
||||
added[name] = this.register(name, module);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue