ismx-nexo-node-app 0.4.82 → 0.4.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -159,14 +159,11 @@ class BusinessServer extends Business_1.default {
|
|
|
159
159
|
const { readdir } = yield Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
160
160
|
const pathModule = yield Promise.resolve().then(() => __importStar(require('path')));
|
|
161
161
|
const { fileURLToPath } = yield Promise.resolve().then(() => __importStar(require('url')));
|
|
162
|
-
|
|
163
|
-
const __dirname = pathModule.dirname(fileURLToPath(import.meta.url));
|
|
164
|
-
const servicesPath = pathModule.join(__dirname, path);
|
|
165
|
-
const files = yield readdir(servicesPath);
|
|
162
|
+
const files = yield readdir(path);
|
|
166
163
|
for (const file of files) {
|
|
167
164
|
if (!file.endsWith('.ts') && !file.endsWith('.js'))
|
|
168
165
|
continue;
|
|
169
|
-
const modulePath = pathModule.join(
|
|
166
|
+
const modulePath = pathModule.join(path, file);
|
|
170
167
|
const mod = yield Promise.resolve(`${modulePath}`).then(s => __importStar(require(s)));
|
|
171
168
|
const ServiceClass = Object.values(mod)[0];
|
|
172
169
|
// @ts-ignore
|
package/package.json
CHANGED
|
@@ -116,20 +116,16 @@ export default class BusinessServer extends Business
|
|
|
116
116
|
}
|
|
117
117
|
}}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
public async load(path: string): Promise<void>
|
|
120
120
|
{
|
|
121
121
|
const { readdir } = await import('fs/promises');
|
|
122
122
|
const pathModule = await import('path');
|
|
123
123
|
const { fileURLToPath } = await import('url');
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
const __dirname = pathModule.dirname(fileURLToPath(import.meta.url));
|
|
127
|
-
const servicesPath = pathModule.join(__dirname, path);
|
|
128
|
-
|
|
129
|
-
const files = await readdir(servicesPath);
|
|
125
|
+
const files = await readdir(path);
|
|
130
126
|
for (const file of files) {
|
|
131
127
|
if (!file.endsWith('.ts') && !file.endsWith('.js')) continue;
|
|
132
|
-
const modulePath = pathModule.join(
|
|
128
|
+
const modulePath = pathModule.join(path, file);
|
|
133
129
|
const mod = await import(modulePath);
|
|
134
130
|
const ServiceClass = Object.values(mod)[0];
|
|
135
131
|
// @ts-ignore
|