build: enable JS semicolons (#22783)

This commit is contained in:
Samuel Attard 2020-03-20 13:28:31 -07:00 committed by GitHub
parent 24e21467b9
commit 5d657dece4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
354 changed files with 21512 additions and 21510 deletions

View file

@ -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;
}