autoformat code
This commit is contained in:
parent
ba752f4142
commit
3463f0f89f
@ -225,13 +225,11 @@ export class NopeInstanceManager implements INopeInstanceManager {
|
||||
] of _this._rpcManager.services.originalData.entries()) {
|
||||
// Filter the Generators based on the existing services
|
||||
const generators = services.services
|
||||
.filter((svc) =>
|
||||
{
|
||||
.filter((svc) => {
|
||||
return svc?.id.startsWith(
|
||||
`nope${SPLITCHAR}core${SPLITCHAR}constructor${SPLITCHAR}`
|
||||
);
|
||||
}
|
||||
)
|
||||
})
|
||||
.map((item) => {
|
||||
return item.id;
|
||||
});
|
||||
@ -276,8 +274,7 @@ export class NopeInstanceManager implements INopeInstanceManager {
|
||||
instances: Array.from(this._internalInstances).map((identifier) => {
|
||||
// Generate the Module Description for every identifier:
|
||||
return _this._instances.get(identifier).instance.toDescription();
|
||||
}
|
||||
),
|
||||
}),
|
||||
});
|
||||
|
||||
// Update the Instances
|
||||
|
@ -344,11 +344,9 @@ export class NopeRpcManager<T extends IFunctionOptions = IFunctionOptions>
|
||||
typeof (_resultPromise as INopePromise<any>)?.cancel === "function"
|
||||
) {
|
||||
// Push the Callback to the Result.
|
||||
cbs.push((reason) =>
|
||||
{
|
||||
cbs.push((reason) => {
|
||||
return (_resultPromise as INopePromise<any>).cancel(reason);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// Store, who has requested the task.
|
||||
|
@ -78,13 +78,10 @@ export function generateSelector(
|
||||
|
||||
if (data.has(opts.serviceName)) {
|
||||
const items = Array.from(data.get(opts.serviceName));
|
||||
const hosts = items.map(
|
||||
(id) =>
|
||||
{
|
||||
return core.connectivityManager.dispatchers.originalData.get(id)?.host
|
||||
.name;
|
||||
}
|
||||
);
|
||||
const hosts = items.map((id) => {
|
||||
return core.connectivityManager.dispatchers.originalData.get(id)
|
||||
?.host.name;
|
||||
});
|
||||
const idx = hosts.indexOf(host);
|
||||
if (idx >= 0) {
|
||||
return items[idx];
|
||||
|
@ -88,11 +88,9 @@ export class NopeDispatcher extends NopeCore implements INopeDispatcher {
|
||||
throw Error("Invalid Type-Parameter");
|
||||
}
|
||||
|
||||
return items.filter(
|
||||
(item) =>{
|
||||
return items.filter((item) => {
|
||||
return comparePatternAndPath(pattern, item).affected;
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// See interface description
|
||||
|
@ -351,8 +351,7 @@ export class NopeEventEmitter<
|
||||
public waitFor(
|
||||
testCallback: IWaitForCallback<G, AD> = (value) => {
|
||||
return (value as any as boolean) == true;
|
||||
}
|
||||
,
|
||||
},
|
||||
options: INopeWaitForObservableChangeOptions = { testCurrent: true }
|
||||
): Promise<G> {
|
||||
const _this = this;
|
||||
|
@ -173,13 +173,9 @@ export function countElements<T>(array: Array<T>): Map<T, number> {
|
||||
* @param arrayToFlatten The Array
|
||||
*/
|
||||
export function flattenDeep<T>(arrayToFlatten) {
|
||||
return arrayToFlatten.reduce(
|
||||
(acc, val) =>
|
||||
{
|
||||
return arrayToFlatten.reduce((acc, val) => {
|
||||
return Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val);
|
||||
},
|
||||
[]
|
||||
) as T[];
|
||||
}, []) as T[];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -255,7 +251,7 @@ export function minOfArray<T>(
|
||||
};
|
||||
}
|
||||
|
||||
const arrOfValues = arr.map((item) =>{
|
||||
const arrOfValues = arr.map((item) => {
|
||||
return rgetattr<number>(item, path as string, defaultValue);
|
||||
});
|
||||
const min = Math.min(...arrOfValues);
|
||||
@ -280,7 +276,7 @@ export function maxOfArray(
|
||||
};
|
||||
}
|
||||
|
||||
const arrOfValues = arr.map((item) =>{
|
||||
const arrOfValues = arr.map((item) => {
|
||||
return rgetattr<number>(item, path, defaultValue);
|
||||
});
|
||||
const max = Math.max(...arrOfValues);
|
||||
|
@ -509,11 +509,7 @@ export class NopeBaseModule implements INopeModule {
|
||||
// the registered properties and the regiestered functions. If the prop or the
|
||||
// function matches ==> return the name otherwise we throw an error.
|
||||
|
||||
for (const [
|
||||
name,
|
||||
item,
|
||||
] of this._registeredProperties.entries()) {
|
||||
|
||||
for (const [name, item] of this._registeredProperties.entries()) {
|
||||
const { observable, options } = item;
|
||||
|
||||
if (observable == propOrFunc) {
|
||||
@ -547,10 +543,7 @@ export class NopeBaseModule implements INopeModule {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const [
|
||||
name,
|
||||
item,
|
||||
] of this._registeredFunctions.entries()) {
|
||||
for (const [name, item] of this._registeredFunctions.entries()) {
|
||||
const { func, options } = item;
|
||||
if (func == propOrFunc) {
|
||||
return options.id;
|
||||
|
@ -398,7 +398,6 @@ export class PubSubSystemBase<
|
||||
this._matched.clear();
|
||||
// Iterate through all Publishers and
|
||||
for (const [emitter, item] of this._emitters.entries()) {
|
||||
|
||||
const { pubTopic, subTopic } = item;
|
||||
|
||||
// Now, lets Update the Matching for the specific Topics.
|
||||
@ -607,7 +606,11 @@ export class PubSubSystemBase<
|
||||
for (const [emitter, item] of this._emitters.entries()) {
|
||||
if (item.subTopic) {
|
||||
// Now lets determine the Path
|
||||
this.__addMatchingEntryIfRequired(topicOfChange, item.subTopic, emitter);
|
||||
this.__addMatchingEntryIfRequired(
|
||||
topicOfChange,
|
||||
item.subTopic,
|
||||
emitter
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,4 +2,5 @@ set DIR=%~dp0
|
||||
cd "%DIR%"
|
||||
cd ..
|
||||
|
||||
rm -rf temp
|
||||
nope-py-prepare-code --input dist-py --output temp --type js
|
Loading…
Reference in New Issue
Block a user