build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,4 +1,4 @@
|
|||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
/**
|
||||
* Creates a lazy instance of modules that can't be required before the
|
||||
|
@ -16,23 +16,23 @@ export function createLazyInstance (
|
|||
holder: Object,
|
||||
isEventEmitter: Boolean
|
||||
) {
|
||||
let lazyModule: Object
|
||||
const module: any = {}
|
||||
let lazyModule: Object;
|
||||
const module: any = {};
|
||||
for (const method in (holder as any).prototype) { // eslint-disable-line guard-for-in
|
||||
module[method] = (...args: any) => {
|
||||
// create new instance of module at runtime if none exists
|
||||
if (!lazyModule) {
|
||||
lazyModule = creator()
|
||||
if (isEventEmitter) EventEmitter.call(lazyModule as any)
|
||||
lazyModule = creator();
|
||||
if (isEventEmitter) EventEmitter.call(lazyModule as any);
|
||||
}
|
||||
|
||||
// check for properties on the prototype chain that aren't functions
|
||||
if (typeof (lazyModule as any)[method] !== 'function') {
|
||||
return (lazyModule as any)[method]
|
||||
return (lazyModule as any)[method];
|
||||
}
|
||||
|
||||
return (lazyModule as any)[method](...args)
|
||||
}
|
||||
return (lazyModule as any)[method](...args);
|
||||
};
|
||||
}
|
||||
return module
|
||||
return module;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue