diff --git a/lib/analyzers/typescript/cli.ts b/lib/analyzers/typescript/cli.ts index eb8df03..71dd559 100644 --- a/lib/analyzers/typescript/cli.ts +++ b/lib/analyzers/typescript/cli.ts @@ -117,4 +117,6 @@ const main = async function () { logger.info("Defined config in " + args.file); }; -main().catch((e) => console.error(e)); +main().catch((e) => { + console.error(e); +}); diff --git a/lib/analyzers/typescript/defaults/defaultDecoratorFilter.ts b/lib/analyzers/typescript/defaults/defaultDecoratorFilter.ts index a3867f8..dcac53e 100644 --- a/lib/analyzers/typescript/defaults/defaultDecoratorFilter.ts +++ b/lib/analyzers/typescript/defaults/defaultDecoratorFilter.ts @@ -23,13 +23,15 @@ export function defaultDecoratorFilter( ): IDecoratorFilter { // Update the Decorators: if (!caseSensitive) { - decorators.class = decorators.class.map((item) => item.toLocaleLowerCase()); - decorators.methods = decorators.methods.map((item) => - item.toLocaleLowerCase() - ); - decorators.properties = decorators.properties.map((item) => - item.toLocaleLowerCase() - ); + decorators.class = decorators.class.map((item) => { + return item.toLocaleLowerCase(); + }); + decorators.methods = decorators.methods.map((item) => { + return item.toLocaleLowerCase(); + }); + decorators.properties = decorators.properties.map((item) => { + return item.toLocaleLowerCase(); + }); } return (declaration, decorator, mapping) => { diff --git a/lib/analyzers/typescript/helpers/getDeclarationByName.ts b/lib/analyzers/typescript/helpers/getDeclarationByName.ts index 53ea1db..e3cec4b 100644 --- a/lib/analyzers/typescript/helpers/getDeclarationByName.ts +++ b/lib/analyzers/typescript/helpers/getDeclarationByName.ts @@ -74,7 +74,10 @@ export function getDeclarationByName( } if (hasImport) { - type.typeImports.map(({ path, identifier }) => { + type.typeImports.map((item) => { + // We want to use our destructor in here + const { path, identifier } = item; + if (!tested.has(identifier)) { // Push the Elements to the Reverse Test. recursiveTest.push({ diff --git a/lib/analyzers/typescript/helpers/getDecorators.ts b/lib/analyzers/typescript/helpers/getDecorators.ts index b96cdcf..1abb9a9 100644 --- a/lib/analyzers/typescript/helpers/getDecorators.ts +++ b/lib/analyzers/typescript/helpers/getDecorators.ts @@ -37,11 +37,9 @@ export function getDecorators( decorators: [], }; - ret.decorators = declaration - .getDecorators() - .filter((usedDecorator) => - decoratorFilter(declaration, usedDecorator, mapping) - ); + ret.decorators = declaration.getDecorators().filter((usedDecorator) => { + return decoratorFilter(declaration, usedDecorator, mapping); + }); if (extractArgs) { ret.decorators.map((usedDecorator) => { diff --git a/lib/cli/createService.ts b/lib/cli/createService.ts index 05eb85b..1f2fcc7 100644 --- a/lib/cli/createService.ts +++ b/lib/cli/createService.ts @@ -502,5 +502,7 @@ node {{{pathToFolder}}}\\index.js`), // If requested As Main => Perform the Operation. if (require.main === module) { - createService().catch((e) => console.error(e)); + createService().catch((e) => { + console.error(e); + }); } diff --git a/lib/cli/generateDefaultConfig.ts b/lib/cli/generateDefaultConfig.ts index bbdf2bb..24e084b 100644 --- a/lib/cli/generateDefaultConfig.ts +++ b/lib/cli/generateDefaultConfig.ts @@ -78,5 +78,7 @@ export const generateDefaultConfig = async function ( }; if (require.main === module) { - generateDefaultConfig().catch((e) => console.error(e)); + generateDefaultConfig().catch((e) => { + console.error(e); + }); } diff --git a/lib/cli/generateDefaultPackageConfig.ts b/lib/cli/generateDefaultPackageConfig.ts index ff5aa8f..3e98b09 100644 --- a/lib/cli/generateDefaultPackageConfig.ts +++ b/lib/cli/generateDefaultPackageConfig.ts @@ -85,5 +85,7 @@ export const generateDefaultPackageConfig = async function ( }; if (require.main === module) { - generateDefaultPackageConfig().catch((e) => console.error(e)); + generateDefaultPackageConfig().catch((e) => { + console.error(e); + }); } diff --git a/lib/cli/ioServerService.ts b/lib/cli/ioServerService.ts index 2cf7ae2..f600cd4 100644 --- a/lib/cli/ioServerService.ts +++ b/lib/cli/ioServerService.ts @@ -9,7 +9,12 @@ const parser = new ArgumentParser({ const validModes = ["install", "uninstall", "restart"]; parser.add_argument(["-m", "--mode"], { help: - "Valid Modes are: " + validModes.map((item) => '"' + item + '"').join(", "), + "Valid Modes are: " + + validModes + .map((item) => { + return '"' + item + '"'; + }) + .join(", "), default: "install", type: "str", dest: "mode", diff --git a/lib/cli/runNopeBackend.ts b/lib/cli/runNopeBackend.ts index f97f930..8957d6b 100644 --- a/lib/cli/runNopeBackend.ts +++ b/lib/cli/runNopeBackend.ts @@ -125,7 +125,9 @@ export async function readInArgs( "The Communication Channel, which should be used. Possible Values are: " + // Display all Options: Object.getOwnPropertyNames(validLayers) - .map((item) => '"' + item + '"') + .map((item) => { + return '"' + item + '"'; + }) .join(", "), default: "event", type: "str", @@ -153,7 +155,9 @@ export async function readInArgs( "The default-selector to select the service providers. Possible Values are: " + // Display all Options: Object.getOwnPropertyNames(ValidDefaultSelectors) - .map((item) => '"' + item + '"') + .map((item) => { + return '"' + item + '"'; + }) .join(", "), default: "first", type: "str", @@ -307,14 +311,18 @@ export async function runNopeBackend( logger.error( "Invalid Channel. Please use the following values. " + Object.getOwnPropertyNames(validLayers) - .map((item) => '"' + item + '"') + .map((item) => { + return '"' + item + '"'; + }) .join(", ") ); const error = Error( "Invalid Channel. Please use the following values. " + Object.getOwnPropertyNames(validLayers) - .map((item) => '"' + item + '"') + .map((item) => { + return '"' + item + '"'; + }) .join(", ") ); diff --git a/lib/communication/bridge.ts b/lib/communication/bridge.ts index 89f617d..eecb92e 100644 --- a/lib/communication/bridge.ts +++ b/lib/communication/bridge.ts @@ -245,7 +245,7 @@ export class Bridge implements ICommunicationBridge { }); // Wait until the Layer is connected. - await layer.connected.waitFor((value) => value); + await layer.connected.waitFor(); // Register all know unspecific methods for (const [event, cbs] of this._callbacks.entries()) { diff --git a/lib/decorators/functionDecorators.ts b/lib/decorators/functionDecorators.ts index 73b8251..6d9ecb0 100644 --- a/lib/decorators/functionDecorators.ts +++ b/lib/decorators/functionDecorators.ts @@ -30,7 +30,9 @@ export function exportFunctionAsNopeService( // Only add the element if it doesnt exists. if (!CONTAINER.methods.has(options.id)) { CONTAINER.methods.set(options.id, { - callback: async (...args) => await (func as any)(...args), + callback: async (...args) => { + return await (func as any)(...args); + }, options, uri: options.id || (func as any).name, }); diff --git a/lib/dispatcher/ConnectivityManager/ConnectivityManager.ts b/lib/dispatcher/ConnectivityManager/ConnectivityManager.ts index b8dd88e..307477f 100644 --- a/lib/dispatcher/ConnectivityManager/ConnectivityManager.ts +++ b/lib/dispatcher/ConnectivityManager/ConnectivityManager.ts @@ -330,7 +330,9 @@ export class NopeConnectivityManager implements INopeConnectivityManager { */ public get master(): INopeStatusInfo { const candidates = this._getPossibleMasterCandidates(); - const masters = candidates.filter((item) => item.isMaster); + const masters = candidates.filter((item) => { + return item.isMaster; + }); if (masters.length === 0) { const idx = minOfArray(candidates, "connectedSince").index; @@ -397,12 +399,12 @@ export class NopeConnectivityManager implements INopeConnectivityManager { _this.dispatchers.update(); }); - await this._communicator.on("Bonjour", ({ dispatcherId }) => { - if (_this.id !== dispatcherId) { + await this._communicator.on("Bonjour", (opts) => { + if (_this.id !== opts.dispatcherId) { if (_this._logger?.enabledFor(DEBUG)) { // If there is a Logger: _this._logger.debug( - 'Remote Dispatcher "' + dispatcherId + '" went online' + 'Remote Dispatcher "' + opts.dispatcherId + '" went online' ); } @@ -411,9 +413,9 @@ export class NopeConnectivityManager implements INopeConnectivityManager { } }); - await this._communicator.on("Aurevoir", ({ dispatcherId }) => { + await this._communicator.on("Aurevoir", (msg) => { // Remove the Dispatcher. - _this._externalDispatchers.delete(dispatcherId); + _this._externalDispatchers.delete(msg.dispatcherId); _this.dispatchers.update(); }); @@ -652,19 +654,17 @@ export class NopeConnectivityManager implements INopeConnectivityManager { if (this._timeouts.checkInterval > 0) { // Define a Checker, which will test the status // of the external Dispatchers. - this._checkInterval = setInterval( - () => _this._checkDispatcherHealth(), - this._timeouts.checkInterval - ); + this._checkInterval = setInterval(() => { + _this._checkDispatcherHealth(); + }, this._timeouts.checkInterval); } if (this._timeouts.sendAliveInterval > 0) { // Define a Timer, which will emit Status updates with // the disered delay. - this._sendInterval = setInterval( - () => _this._sendStatus(), - this._timeouts.sendAliveInterval - ); + this._sendInterval = setInterval(() => { + _this._sendStatus(); + }, this._timeouts.sendAliveInterval); } } diff --git a/lib/dispatcher/InstanceManager/InstanceManager.ts b/lib/dispatcher/InstanceManager/InstanceManager.ts index d186c8d..b766cad 100644 --- a/lib/dispatcher/InstanceManager/InstanceManager.ts +++ b/lib/dispatcher/InstanceManager/InstanceManager.ts @@ -230,7 +230,9 @@ export class NopeInstanceManager implements INopeInstanceManager { `nope${SPLITCHAR}core${SPLITCHAR}constructor${SPLITCHAR}` ) ) - .map((item) => item.id); + .map((item) => { + return item.id; + }); // If the Dispatcher has a generator we will add it. if (generators.length) { @@ -315,7 +317,9 @@ export class NopeInstanceManager implements INopeInstanceManager { } if (changes.removed.length) { // Remove the dispatchers. - changes.removed.map((id) => _this.removeDispatcher(id)); + changes.removed.map((id) => { + _this.removeDispatcher(id); + }); } }); @@ -917,8 +921,12 @@ export class NopeInstanceManager implements INopeInstanceManager { ): Promise { const indentifier = this.instances.data .getContent() - .filter((item) => item.type == type) - .map((item) => item.identifier); + .filter((item) => { + return item.type == type; + }) + .map((item) => { + return item.identifier; + }); const promises: Promise[] = []; diff --git a/lib/dispatcher/RpcManager/NopeRpcManager.ts b/lib/dispatcher/RpcManager/NopeRpcManager.ts index f4f5693..ae9209d 100644 --- a/lib/dispatcher/RpcManager/NopeRpcManager.ts +++ b/lib/dispatcher/RpcManager/NopeRpcManager.ts @@ -230,14 +230,17 @@ export class NopeRpcManager const _this = this; const _handlerWithOptions = { get(target, name) { - return (options: ICallOptions, ...args) => - _this.performCall(name, args, options); + return (options: ICallOptions, ...args) => { + return _this.performCall(name, args, options); + }; }, }; // Define the Proxy without the Options const _handlerWithoutOptions = { get(target, name) { - return (...args) => _this.performCall(name, args); + return (...args) => { + return _this.performCall(name, args); + }; }, }; this.methodInterfaceWithOptions = new Proxy({}, _handlerWithOptions); @@ -317,7 +320,9 @@ export class NopeRpcManager const observer = _this.onCancelTask.subscribe((cancelEvent) => { if (cancelEvent.taskId == data.taskId) { // Call Every Callback. - cbs.map((cb) => cb(cancelEvent.reason)); + cbs.map((cb) => { + return cb(cancelEvent.reason); + }); // Although we are allowed to Cancel the Subscription observer.unsubscribe(); @@ -457,9 +462,9 @@ export class NopeRpcManager // Define the Message const message: IAvailableServicesMsg = { dispatcher: this._id, - services: Array.from(this._registeredServices.values()).map( - (item) => item.options - ), + services: Array.from(this._registeredServices.values()).map((item) => { + return item.options; + }), }; if (this._logger?.enabledFor(DEBUG)) { @@ -526,7 +531,9 @@ export class NopeRpcManager } if (changes.removed.length) { // Remove the dispatchers. - changes.removed.map((item) => _this.removeDispatcher(item)); + changes.removed.map((item) => { + return _this.removeDispatcher(item); + }); } }); @@ -806,7 +813,9 @@ export class NopeRpcManager (_func as any).id = _id; // Define the callback. - (_func as any).unregister = () => _this._unregisterService(_id); + (_func as any).unregister = () => { + return _this._unregisterService(_id); + }; // Reister the Function this._registeredServices.set((_func as any).id, { diff --git a/lib/dispatcher/RpcManager/selectors.ts b/lib/dispatcher/RpcManager/selectors.ts index ceb9866..676aa33 100644 --- a/lib/dispatcher/RpcManager/selectors.ts +++ b/lib/dispatcher/RpcManager/selectors.ts @@ -60,9 +60,7 @@ export function generateSelector( case "dispatcher": // Our selector compares the dispatcher - id return async (opts) => { - const ids = core.connectivityManager.dispatchers.data - .getContent() - .map((item) => item); + const ids = core.connectivityManager.dispatchers.data.getContent(); if (ids.includes(core.id)) { return core.id; diff --git a/lib/dispatcher/baseServices/connectivy.ts b/lib/dispatcher/baseServices/connectivy.ts index e57ab76..320ad86 100644 --- a/lib/dispatcher/baseServices/connectivy.ts +++ b/lib/dispatcher/baseServices/connectivy.ts @@ -241,7 +241,9 @@ export async function generateDefineMaster(dispatcher: INopeDispatcher) { const targets = Array.from(relevantDispatchers); await dispatcher.rpcManager.performCall( - targets.map((_) => service), + targets.map((_) => { + return service; + }), [false], targets.map((target) => { return { target, timeout: 200 }; diff --git a/lib/dispatcher/getLinkedDispatcher.ts b/lib/dispatcher/getLinkedDispatcher.ts index 47b17a0..d486580 100644 --- a/lib/dispatcher/getLinkedDispatcher.ts +++ b/lib/dispatcher/getLinkedDispatcher.ts @@ -37,21 +37,19 @@ export function getLinkedDispatcher( }); // If the Dispatcher has been connected, register all functions. - dispatcher.ready - .waitFor((value) => value === true) - .then(() => { - if (dispatcher.ready.getContent()) { - // Iterate over the Functions - for (const [uri, settings] of container.instance.entries()) { - dispatcher.rpcManager.registerService(settings.callback, { - ...settings.options, - id: uri, - }); - } - } else { - // Failed to Setup the Container. + dispatcher.ready.waitFor().then(() => { + if (dispatcher.ready.getContent()) { + // Iterate over the Functions + for (const [uri, settings] of container.instance.entries()) { + dispatcher.rpcManager.registerService(settings.callback, { + ...settings.options, + id: uri, + }); } - }); + } else { + // Failed to Setup the Container. + } + }); return dispatcher; } diff --git a/lib/dispatcher/nopeDispatcher.ts b/lib/dispatcher/nopeDispatcher.ts index 8fcc6bf..bcc432a 100644 --- a/lib/dispatcher/nopeDispatcher.ts +++ b/lib/dispatcher/nopeDispatcher.ts @@ -68,9 +68,9 @@ export class NopeDispatcher extends NopeCore implements INopeDispatcher { let items: string[] = []; switch (type) { case "instances": - items = this.instanceManager.instances.data - .getContent() - .map((item) => item.identifier); + items = this.instanceManager.instances.data.getContent().map((item) => { + return item.identifier; + }); break; case "services": items = Array.from( diff --git a/lib/eventEmitter/nopeEventEmitter.ts b/lib/eventEmitter/nopeEventEmitter.ts index 15c1dae..6550bff 100644 --- a/lib/eventEmitter/nopeEventEmitter.ts +++ b/lib/eventEmitter/nopeEventEmitter.ts @@ -299,7 +299,11 @@ export class NopeEventEmitter< if (options.pipe) { observable = options.pipe( options.scope, - this._emitter.pipe(map((value) => value.value)) + this._emitter.pipe( + map((value) => { + return value.value; + }) + ) ); } @@ -378,15 +382,21 @@ export class NopeEventEmitter< const prom = Promise.resolve(testCallback(data, opts)); // Now we link the element - prom.catch((e) => finish(e, false, data)); - prom.then((r) => finish(false, r, data)); + prom.catch((e) => { + finish(e, false, data); + }); + prom.then((r) => { + finish(false, r, data); + }); } first = false; }; try { - subscription = _this.subscribe((data, opts) => checkData(data, opts)); + subscription = _this.subscribe((data, opts) => { + checkData(data, opts); + }); } catch (e) { reject(e); } @@ -402,7 +412,9 @@ export class NopeEventEmitter< const _this = this; return new Promise((resolve, reject) => { try { - _this.once((content) => resolve(content), options); + _this.once((content) => { + resolve(content); + }, options); } catch (e) { reject(e); } diff --git a/lib/helpers/arrayMethods.ts b/lib/helpers/arrayMethods.ts index cc2d544..b414f7f 100644 --- a/lib/helpers/arrayMethods.ts +++ b/lib/helpers/arrayMethods.ts @@ -229,8 +229,12 @@ export function avgOfArray(arr: any[], path: string, defaultValue = 0): number { return defaultValue; } - const arrOfValues = arr.map((item) => rgetattr(item, path, defaultValue)); - const added = arrOfValues.reduce((prev, curr) => prev + curr) as number; + const arrOfValues = arr.map((item) => { + return rgetattr(item, path, defaultValue); + }); + const added = arrOfValues.reduce((prev, curr) => { + return prev + curr; + }) as number; return added / arr.length; } diff --git a/lib/helpers/async.ts b/lib/helpers/async.ts index 5d95207..a00337a 100644 --- a/lib/helpers/async.ts +++ b/lib/helpers/async.ts @@ -9,7 +9,9 @@ * @returns void */ export function sleep(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); + return new Promise((resolve) => { + setTimeout(resolve, delay); + }); } /** @@ -58,7 +60,9 @@ export function waitFor( let _resolve: () => void; if (_options.additionalDelay) { - _resolve = () => setTimeout(resolve, _options.additionalDelay); + _resolve = () => { + setTimeout(resolve, _options.additionalDelay); + }; } else { _resolve = resolve; } @@ -125,7 +129,9 @@ export function waitFor( const _func = () => { let _resolve: () => void; if (_options.additionalDelay) { - _resolve = () => setTimeout(resolve, _options.additionalDelay); + _resolve = () => { + setTimeout(resolve, _options.additionalDelay); + }; } else { _resolve = resolve; } diff --git a/lib/helpers/jsonSchemaMethods.ts b/lib/helpers/jsonSchemaMethods.ts index 5b337c2..dfe95d1 100644 --- a/lib/helpers/jsonSchemaMethods.ts +++ b/lib/helpers/jsonSchemaMethods.ts @@ -360,9 +360,24 @@ export function reduceSchema( const _isNopeDescriptor: Array< [keyof INopeDescriptor, (value: any) => boolean] > = [ - ["type", (value) => value === "function"], - ["inputs", (value) => typeof value === "object"], - ["outputs", (value) => typeof value === "object"], + [ + "type", + (value) => { + return value === "function"; + }, + ], + [ + "inputs", + (value) => { + return typeof value === "object"; + }, + ], + [ + "outputs", + (value) => { + return typeof value === "object"; + }, + ], ]; /** diff --git a/lib/helpers/mapMethods.ts b/lib/helpers/mapMethods.ts index 2028e6a..8a5809b 100644 --- a/lib/helpers/mapMethods.ts +++ b/lib/helpers/mapMethods.ts @@ -62,7 +62,9 @@ export function extractValues(map: Map, path = ""): Array { const data: D | typeof __sentinal = rgetattr(v, path, __sentinal); if (data !== __sentinal) { if (Array.isArray(data)) { - data.map((item) => s.push(item)); + data.map((item) => { + return s.push(item); + }); } else { s.push(data as D); } diff --git a/lib/helpers/objectMethods.ts b/lib/helpers/objectMethods.ts index 685f82d..e6af445 100644 --- a/lib/helpers/objectMethods.ts +++ b/lib/helpers/objectMethods.ts @@ -144,7 +144,9 @@ export function convertData( } = {}; const commonPattern = getLeastCommonPathSegment( - props.map((item) => item.query) + props.map((item) => { + return item.query; + }) ); if (!commonPattern) { diff --git a/lib/helpers/pathMatchingMethods.ts b/lib/helpers/pathMatchingMethods.ts index df63a20..82a1134 100644 --- a/lib/helpers/pathMatchingMethods.ts +++ b/lib/helpers/pathMatchingMethods.ts @@ -398,5 +398,7 @@ export function patternIsValid(str: string): boolean { } return false; }) - .reduce((prev, current) => prev && current, true); + .reduce((prev, current) => { + return prev && current; + }, true); } diff --git a/lib/loader/loadPackages.ts b/lib/loader/loadPackages.ts index 66fb2ce..d813544 100644 --- a/lib/loader/loadPackages.ts +++ b/lib/loader/loadPackages.ts @@ -187,7 +187,7 @@ export async function loadPackages( } } - await loader.dispatcher.ready.waitFor((value) => value === true); + await loader.dispatcher.ready.waitFor(); // Iterate over the Packages for (const thePackageToLoad of packages) { diff --git a/lib/loader/nopePackageLoader.ts b/lib/loader/nopePackageLoader.ts index 1fdabde..6602646 100644 --- a/lib/loader/nopePackageLoader.ts +++ b/lib/loader/nopePackageLoader.ts @@ -536,7 +536,9 @@ export class NopePackageLoader implements INopePackageLoader { // Firstly add all Descriptors: await this.addDescription( - element.providedClasses.map((item) => item.description) + element.providedClasses.map((item) => { + return item.description; + }) ); // Load the Activation Handlers: await this.addActivationHandler(element.activationHandlers); @@ -624,9 +626,9 @@ export class NopePackageLoader implements INopePackageLoader { const reuqiredPackages = Array.from( new Set( flatten( - availablePackages.map( - (name) => _this.packages[name].requiredPackages - ) + availablePackages.map((name) => { + return _this.packages[name].requiredPackages; + }) ) ) ); @@ -667,7 +669,9 @@ export class NopePackageLoader implements INopePackageLoader { } // Store the Function, that the instance will be disposed on leaving. - this._disposeDefaultInstance.push(() => instance.dispose()); + this._disposeDefaultInstance.push(() => { + return instance.dispose(); + }); if (definition.options.identifier in this.packages[name].autostart) { // There are autostart Tasks in the Package for the considered Instance, @@ -701,7 +705,9 @@ export class NopePackageLoader implements INopePackageLoader { async dispose(): Promise { // Start all dispose Values - const promises = this._disposeDefaultInstance.map((cb) => cb()); + const promises = this._disposeDefaultInstance.map((cb) => { + return cb(); + }); // Wait for all to finish! await Promise.all(promises); diff --git a/lib/logger/nopeLogger.ts b/lib/logger/nopeLogger.ts index 44d8760..9de8bae 100644 --- a/lib/logger/nopeLogger.ts +++ b/lib/logger/nopeLogger.ts @@ -140,14 +140,14 @@ const mapping: { [K in LoggerLevel]: any } = { }; const reverseOrder: { [index: number]: LoggerLevel } = {}; -Object.getOwnPropertyNames(order).map( - (key: LoggerLevel) => (reverseOrder[order[key]] = key) -); +Object.getOwnPropertyNames(order).map((key: LoggerLevel) => { + reverseOrder[order[key]] = key; +}); const reverseMapping: any = {}; -Object.getOwnPropertyNames(mapping).map( - (key: LoggerLevel) => (reverseMapping[mapping[key]] = key) -); +Object.getOwnPropertyNames(mapping).map((key: LoggerLevel) => { + reverseMapping[mapping[key]] = key; +}); function _selectLevel(master: LoggerLevel, slave: LoggerLevel) { const masterLevel = order[master]; diff --git a/lib/parsers/open-api/OpenApiParser.ts b/lib/parsers/open-api/OpenApiParser.ts index 084eb57..b6acbc3 100644 --- a/lib/parsers/open-api/OpenApiParser.ts +++ b/lib/parsers/open-api/OpenApiParser.ts @@ -106,7 +106,9 @@ export async function parseModuleToOpenAPI( (method as any).mode = method.schema.inputs.length > 0 ? "POST" : "GET"; (method as any).required = method.schema.inputs - .filter((param) => !param.optional) + .filter((param) => { + return !param.optional; + }) .map((param) => param.name); (method as any).hasInput = method.schema.inputs.length > 0; diff --git a/lib/pubSub/nopePubSubSystem.ts b/lib/pubSub/nopePubSubSystem.ts index b9ac5c9..500f499 100644 --- a/lib/pubSub/nopePubSubSystem.ts +++ b/lib/pubSub/nopePubSubSystem.ts @@ -363,7 +363,9 @@ export class PubSubSystemBase< } { return { publishers: Array.from(this._emitters.values()) - .filter((item) => item.pubTopic) + .filter((item) => { + return item.pubTopic; + }) .map((item) => { return { schema: item.options.schema as INopeDescriptor, @@ -371,7 +373,9 @@ export class PubSubSystemBase< }; }), subscribers: Array.from(this._emitters.values()) - .filter((item) => item.subTopic) + .filter((item) => { + return item.subTopic; + }) .map((item) => { return { schema: item.options.schema as INopeDescriptor, @@ -551,7 +555,9 @@ export class PubSubSystemBase< public dispose(): void { this._disposing = true; const emitters = Array.from(this._emitters.keys()); - emitters.map((emitter) => this.unregister(emitter as unknown as I)); + emitters.map((emitter) => { + this.unregister(emitter as unknown as I); + }); this.onIncrementalDataChange.dispose(); this.publishers.dispose(); diff --git a/package.json b/package.json index e2c2eec..fe1e20b 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "test": "mocha", "compile-nodejs": "tsc -p ./tsconfig.json", "compile-browser": "tsc -p ./tsconfig.browser.json", + "compile-py": "tsc -p ./tsconfig.py.json", "build": "npx webpack -c webpack-typescript.config.js", "doc": "npx typedoc", "start": "node ./dist/cli/repl.js", @@ -97,5 +98,9 @@ "bin": { "nope-js": "./bin/nope" }, - "main": "dist-nodejs/index.nodejs.js" + "main": "dist-nodejs/index.nodejs.js", + "prettier": { + "arrowParens": "always" + + } } \ No newline at end of file