@makano/rew 1.2.51 → 1.2.53
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/rew/functions/import.js +1 -3
- package/package.json +1 -1
- package/runtime.d.ts +3 -1
@@ -43,8 +43,6 @@ module.exports.imp = function (runPath, context) {
|
|
43
43
|
let filepath = path.resolve(path.dirname(context.module.filepath), filename);
|
44
44
|
if(path.extname(filepath) == '.qrew') options.qrew = true;
|
45
45
|
|
46
|
-
// console.log(typeof runPath);
|
47
|
-
|
48
46
|
const lookUp = () => {
|
49
47
|
const otherPath = lookUpInOtherApps(filename);
|
50
48
|
if (!otherPath) throw new Error('Module "' + filename + '" not found');
|
@@ -134,7 +132,7 @@ module.exports.imp = function (runPath, context) {
|
|
134
132
|
|
135
133
|
//** Mock imports section
|
136
134
|
/**/ if(!exports) exports = options.mock;
|
137
|
-
/**/ if(options.mock
|
135
|
+
/**/ if(options.mock === null) return null;
|
138
136
|
/**/ if(!exports) throw new Error('Import '+filename+' does not export anything. Use the "mock" option to mock a value.');
|
139
137
|
//**
|
140
138
|
|
package/package.json
CHANGED
package/runtime.d.ts
CHANGED
@@ -38,6 +38,7 @@ interface ModuleConfOptionCenter {
|
|
38
38
|
* @returns
|
39
39
|
*/
|
40
40
|
getAll: (() => string) | ((str?: false) => Record<string, any>)
|
41
|
+
root: string;
|
41
42
|
}
|
42
43
|
|
43
44
|
interface ModuleConf extends ModuleConfOptionCenter {
|
@@ -63,7 +64,7 @@ interface ModuleConf extends ModuleConfOptionCenter {
|
|
63
64
|
read: (to?: string | object) => string | object | Buffer,
|
64
65
|
fileRoot: string,
|
65
66
|
exists: boolean
|
66
|
-
}
|
67
|
+
};
|
67
68
|
}
|
68
69
|
|
69
70
|
interface ModuleEnv {
|
@@ -350,6 +351,7 @@ declare namespace print {
|
|
350
351
|
|
351
352
|
declare function input(prompt: string): string;
|
352
353
|
|
354
|
+
declare function genID(len: number = 15, charachters?: string): string;
|
353
355
|
|
354
356
|
declare const basename: (path: string) => string;
|
355
357
|
declare const dirname: (path: string) => string;
|