fix(core): update
This commit is contained in:
@ -1,2 +1,8 @@
|
||||
const removeme = {};
|
||||
export { removeme };
|
||||
// pushrocks scope
|
||||
import * as smartnetwork from '@pushrocks/smartnetwork';
|
||||
import * as smarturl from '@pushrocks/smarturl';
|
||||
|
||||
export {
|
||||
smartnetwork,
|
||||
smarturl
|
||||
};
|
||||
|
23
ts/detectpr.classes.detector.ts
Normal file
23
ts/detectpr.classes.detector.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import * as plugins from './detector.plugins';
|
||||
|
||||
export class Detector {
|
||||
private smartnetworkInstance = new plugins.smartnetwork.SmartNetwork();
|
||||
private smarturlInstance = new plugins.smarturl.Smarturl();
|
||||
|
||||
public async isActive(urlArg: string): Promise<boolean> {
|
||||
const parsedUrl = this.smarturlInstance.parseUrl(urlArg);
|
||||
if (parsedUrl.host === 'localhost') {
|
||||
console.log(`detector target is localhost on port ${parsedUrl.port}`);
|
||||
const result = await this.smartnetworkInstance.isLocalPortAvailable(parseInt(parsedUrl.port, 10));
|
||||
return result;
|
||||
} else {
|
||||
console.log(`detector target is remote domain ${parsedUrl.host} on port ${parsedUrl.port}`);
|
||||
const result = await this.smartnetworkInstance.isRemotePortAvailable(parsedUrl.host, parseInt(parsedUrl.port, 10));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public detectType(urlArg: string) {
|
||||
console.log('TODO'); // TODO
|
||||
}
|
||||
}
|
@ -1,3 +1 @@
|
||||
import * as plugins from './detector.plugins';
|
||||
|
||||
export let standardExport = 'Hi there! :) This is an exported string';
|
||||
export * from './detectpr.classes.detector';
|
Reference in New Issue
Block a user