Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async transformToResult(resultOrDeffered) {
if (resultOrDeffered && shared_utils_1.isFunction(resultOrDeffered.subscribe)) {
return await resultOrDeffered.toPromise();
}
return resultOrDeffered;
}
getStatusByMethod(requestMethod) {
public create(port: number, options?: any & { namespace?: string, server?: any}): any {
if (!options) {
return this.createIOServer(port);
}
const { namespace, server, ...opt } = options;
return server && isFunction(server.of)
? server.of(namespace)
: namespace
? this.createIOServer(port, opt).of(namespace)
: this.createIOServer(port, opt);
}
public async create(type: Type): Promise {
if (!(type && isFunction(type) && type.prototype)) {
throw new InvalidClassException(type);
}
return this.instantiateClass(type, self);
}
};
public close(server: any) {
server && isFunction(server.close) && server.close();
}
return (receiver, prop) => {
if (!(prop in receiver))
return;
if (shared_utils_1.isFunction(receiver[prop])) {
return (...args) => {
let result;
exceptions_zone_1.ExceptionsZone.run(() => {
result = receiver[prop](...args);
});
return result;
};
}
return receiver[prop];
};
}
async pickResult(defferedResult) {
const result = await defferedResult;
if (result && shared_utils_1.isFunction(result.subscribe)) {
return result;
}
if (result instanceof Promise) {
return rxjs_1.from(result);
}
return rxjs_1.of(result);
}
hookServerToProperties(instance, server) {
.filter((guard) => guard && guard.canActivate && isFunction(guard.canActivate))
.toArray() as R;
public async transformToResult(resultOrDeffered) {
if (resultOrDeffered instanceof Promise) {
return await resultOrDeffered;
} else if (resultOrDeffered && isFunction(resultOrDeffered.subscribe)) {
return await resultOrDeffered.toPromise();
}
return resultOrDeffered;
}
.filter(pipe => pipe && pipe.transform && isFunction(pipe.transform))
.map(pipe => pipe.transform.bind(pipe))
isObservable(result: any): boolean {
return result && isFunction(result.subscribe);
}
}