autoformat code

This commit is contained in:
Martin Karkowski 2022-08-03 13:18:26 +02:00
parent ba752f4142
commit 3463f0f89f
9 changed files with 30 additions and 48 deletions

View File

@ -225,13 +225,11 @@ export class NopeInstanceManager implements INopeInstanceManager {
] of _this._rpcManager.services.originalData.entries()) { ] of _this._rpcManager.services.originalData.entries()) {
// Filter the Generators based on the existing services // Filter the Generators based on the existing services
const generators = services.services const generators = services.services
.filter((svc) => .filter((svc) => {
{
return svc?.id.startsWith( return svc?.id.startsWith(
`nope${SPLITCHAR}core${SPLITCHAR}constructor${SPLITCHAR}` `nope${SPLITCHAR}core${SPLITCHAR}constructor${SPLITCHAR}`
); );
} })
)
.map((item) => { .map((item) => {
return item.id; return item.id;
}); });
@ -276,8 +274,7 @@ export class NopeInstanceManager implements INopeInstanceManager {
instances: Array.from(this._internalInstances).map((identifier) => { instances: Array.from(this._internalInstances).map((identifier) => {
// Generate the Module Description for every identifier: // Generate the Module Description for every identifier:
return _this._instances.get(identifier).instance.toDescription(); return _this._instances.get(identifier).instance.toDescription();
} }),
),
}); });
// Update the Instances // Update the Instances

View File

@ -344,11 +344,9 @@ export class NopeRpcManager<T extends IFunctionOptions = IFunctionOptions>
typeof (_resultPromise as INopePromise<any>)?.cancel === "function" typeof (_resultPromise as INopePromise<any>)?.cancel === "function"
) { ) {
// Push the Callback to the Result. // Push the Callback to the Result.
cbs.push((reason) => cbs.push((reason) => {
{
return (_resultPromise as INopePromise<any>).cancel(reason); return (_resultPromise as INopePromise<any>).cancel(reason);
} });
);
} }
// Store, who has requested the task. // Store, who has requested the task.

View File

@ -78,13 +78,10 @@ export function generateSelector(
if (data.has(opts.serviceName)) { if (data.has(opts.serviceName)) {
const items = Array.from(data.get(opts.serviceName)); const items = Array.from(data.get(opts.serviceName));
const hosts = items.map( const hosts = items.map((id) => {
(id) => return core.connectivityManager.dispatchers.originalData.get(id)
{ ?.host.name;
return core.connectivityManager.dispatchers.originalData.get(id)?.host });
.name;
}
);
const idx = hosts.indexOf(host); const idx = hosts.indexOf(host);
if (idx >= 0) { if (idx >= 0) {
return items[idx]; return items[idx];

View File

@ -88,11 +88,9 @@ export class NopeDispatcher extends NopeCore implements INopeDispatcher {
throw Error("Invalid Type-Parameter"); throw Error("Invalid Type-Parameter");
} }
return items.filter( return items.filter((item) => {
(item) =>{
return comparePatternAndPath(pattern, item).affected; return comparePatternAndPath(pattern, item).affected;
} });
);
} }
// See interface description // See interface description

View File

@ -351,8 +351,7 @@ export class NopeEventEmitter<
public waitFor( public waitFor(
testCallback: IWaitForCallback<G, AD> = (value) => { testCallback: IWaitForCallback<G, AD> = (value) => {
return (value as any as boolean) == true; return (value as any as boolean) == true;
} },
,
options: INopeWaitForObservableChangeOptions = { testCurrent: true } options: INopeWaitForObservableChangeOptions = { testCurrent: true }
): Promise<G> { ): Promise<G> {
const _this = this; const _this = this;

View File

@ -173,13 +173,9 @@ export function countElements<T>(array: Array<T>): Map<T, number> {
* @param arrayToFlatten The Array * @param arrayToFlatten The Array
*/ */
export function flattenDeep<T>(arrayToFlatten) { export function flattenDeep<T>(arrayToFlatten) {
return arrayToFlatten.reduce( return arrayToFlatten.reduce((acc, val) => {
(acc, val) =>
{
return Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val); return Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val);
}, }, []) as T[];
[]
) as T[];
} }
/** /**

View File

@ -509,11 +509,7 @@ export class NopeBaseModule implements INopeModule {
// the registered properties and the regiestered functions. If the prop or the // the registered properties and the regiestered functions. If the prop or the
// function matches ==> return the name otherwise we throw an error. // function matches ==> return the name otherwise we throw an error.
for (const [ for (const [name, item] of this._registeredProperties.entries()) {
name,
item,
] of this._registeredProperties.entries()) {
const { observable, options } = item; const { observable, options } = item;
if (observable == propOrFunc) { if (observable == propOrFunc) {
@ -547,10 +543,7 @@ export class NopeBaseModule implements INopeModule {
} }
} }
} }
for (const [ for (const [name, item] of this._registeredFunctions.entries()) {
name,
item,
] of this._registeredFunctions.entries()) {
const { func, options } = item; const { func, options } = item;
if (func == propOrFunc) { if (func == propOrFunc) {
return options.id; return options.id;

View File

@ -398,7 +398,6 @@ export class PubSubSystemBase<
this._matched.clear(); this._matched.clear();
// Iterate through all Publishers and // Iterate through all Publishers and
for (const [emitter, item] of this._emitters.entries()) { for (const [emitter, item] of this._emitters.entries()) {
const { pubTopic, subTopic } = item; const { pubTopic, subTopic } = item;
// Now, lets Update the Matching for the specific Topics. // Now, lets Update the Matching for the specific Topics.
@ -607,7 +606,11 @@ export class PubSubSystemBase<
for (const [emitter, item] of this._emitters.entries()) { for (const [emitter, item] of this._emitters.entries()) {
if (item.subTopic) { if (item.subTopic) {
// Now lets determine the Path // Now lets determine the Path
this.__addMatchingEntryIfRequired(topicOfChange, item.subTopic, emitter); this.__addMatchingEntryIfRequired(
topicOfChange,
item.subTopic,
emitter
);
} }
} }
} }

View File

@ -2,4 +2,5 @@ set DIR=%~dp0
cd "%DIR%" cd "%DIR%"
cd .. cd ..
rm -rf temp
nope-py-prepare-code --input dist-py --output temp --type js nope-py-prepare-code --input dist-py --output temp --type js