auto formating

This commit is contained in:
Martin Karkowski 2022-08-02 22:31:48 +02:00
parent ba752f4142
commit fe66f41ddd
10 changed files with 33 additions and 52 deletions

View File

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

View File

@ -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.

View File

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

View File

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

View File

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

View File

@ -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[];
}
/**

View File

@ -152,7 +152,7 @@ export function generateResult(
* @export
* @param {string} pathPattern The pattern to test
* @param {string} contentPath The path to use as basis
* @return {*} {TPathCompareResult}
* @return {TPathCompareResult}
*/
export function comparePatternAndPath(
pathPattern: string,

View File

@ -40,9 +40,9 @@ export function replaceAll(
/**
* Function to Pad a String.
* @param num
* @param size
* @param maxLength
* @param num The Number to pad
* @param size the amount of zeros to add
* @param maxLength The max length of the number.
*/
export function padString(
num: number,

View File

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

View File

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