ee-core 1.5.2-beta.1 → 1.5.2-beta.2
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.
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/addon/window/index.js +91 -91
- package/bin/tools.js +18 -18
- package/config/config.default.js +280 -280
- package/core/index.js +12 -12
- package/core/lib/ee.js +218 -218
- package/core/lib/loader/context_loader.js +106 -106
- package/core/lib/loader/ee_loader.js +457 -457
- package/core/lib/loader/file_loader.js +325 -325
- package/core/lib/loader/mixin/addon.js +32 -32
- package/core/lib/loader/mixin/config.js +135 -135
- package/core/lib/loader/mixin/controller.js +124 -124
- package/core/lib/loader/mixin/service.js +28 -28
- package/core/lib/utils/base_context_class.js +34 -34
- package/core/lib/utils/index.js +127 -127
- package/core/lib/utils/sequencify.js +59 -59
- package/core/lib/utils/timing.js +77 -77
- package/index.js +49 -49
- package/lib/appLoader.js +53 -53
- package/lib/application.js +84 -84
- package/lib/baseApp.js +131 -131
- package/lib/constant.js +9 -9
- package/lib/eeApp.js +359 -359
- package/lib/httpclient.js +136 -136
- package/lib/logger.js +46 -46
- package/lib/socket/httpServer.js +142 -142
- package/lib/socket/io.js +23 -23
- package/lib/socket/ipcServer.js +108 -108
- package/lib/socket/socketClient.js +50 -50
- package/lib/socket/socketServer.js +76 -76
- package/lib/socket/start.js +22 -22
- package/lib/storage/index.js +33 -33
- package/lib/storage/lowdb/adapters/Base.js +15 -15
- package/lib/storage/lowdb/adapters/FileAsync.js +41 -41
- package/lib/storage/lowdb/adapters/FileSync.js +39 -39
- package/lib/storage/lowdb/adapters/LocalStorage.js +20 -20
- package/lib/storage/lowdb/adapters/Memory.js +8 -8
- package/lib/storage/lowdb/adapters/_stringify.js +4 -4
- package/lib/storage/lowdb/common.js +33 -33
- package/lib/storage/lowdb/fp.js +23 -23
- package/lib/storage/lowdb/{is-promise.js → isPromise.js} +5 -5
- package/lib/storage/lowdb/main.js +46 -46
- package/lib/storage/lowdb/nano.js +5 -5
- package/lib/storage/lowdbStorage.js +98 -98
- package/lib/storage/sqliteStorage.js +127 -127
- package/package.json +48 -48
- package/tools/encrypt.js +274 -274
- package/tools/replaceDist.js +61 -61
- package/utils/common.js +90 -90
- package/utils/index.js +246 -246
- package/utils/wrap.js +37 -37
package/utils/wrap.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const assert = require('assert');
|
|
4
|
-
const is = require('is-type-of');
|
|
5
|
-
|
|
6
|
-
exports.getProperties = (filepath, { caseStyle }) => {
|
|
7
|
-
// if caseStyle is function, return the result of function
|
|
8
|
-
if (is.function(caseStyle)) {
|
|
9
|
-
const result = caseStyle(filepath);
|
|
10
|
-
assert(is.array(result), `caseStyle expect an array, but got ${result}`);
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
// use default camelize
|
|
14
|
-
return this.defaultCamelize(filepath, caseStyle);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.defaultCamelize = (filepath, caseStyle) => {
|
|
18
|
-
const properties = filepath.substring(0, filepath.lastIndexOf('.')).split('/');
|
|
19
|
-
return properties.map(property => {
|
|
20
|
-
if (!/^[a-z][a-z0-9_-]*$/i.test(property)) {
|
|
21
|
-
throw new Error(`${property} is not match 'a-z0-9_-' in ${filepath}`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
property = property.replace(/[_-][a-z]/ig, s => s.substring(1).toUpperCase());
|
|
25
|
-
let first = property[0];
|
|
26
|
-
switch (caseStyle) {
|
|
27
|
-
case 'lower':
|
|
28
|
-
first = first.toLowerCase();
|
|
29
|
-
break;
|
|
30
|
-
case 'upper':
|
|
31
|
-
first = first.toUpperCase();
|
|
32
|
-
break;
|
|
33
|
-
case 'camel':
|
|
34
|
-
default:
|
|
35
|
-
}
|
|
36
|
-
return first + property.substring(1);
|
|
37
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('assert');
|
|
4
|
+
const is = require('is-type-of');
|
|
5
|
+
|
|
6
|
+
exports.getProperties = (filepath, { caseStyle }) => {
|
|
7
|
+
// if caseStyle is function, return the result of function
|
|
8
|
+
if (is.function(caseStyle)) {
|
|
9
|
+
const result = caseStyle(filepath);
|
|
10
|
+
assert(is.array(result), `caseStyle expect an array, but got ${result}`);
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
// use default camelize
|
|
14
|
+
return this.defaultCamelize(filepath, caseStyle);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.defaultCamelize = (filepath, caseStyle) => {
|
|
18
|
+
const properties = filepath.substring(0, filepath.lastIndexOf('.')).split('/');
|
|
19
|
+
return properties.map(property => {
|
|
20
|
+
if (!/^[a-z][a-z0-9_-]*$/i.test(property)) {
|
|
21
|
+
throw new Error(`${property} is not match 'a-z0-9_-' in ${filepath}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
property = property.replace(/[_-][a-z]/ig, s => s.substring(1).toUpperCase());
|
|
25
|
+
let first = property[0];
|
|
26
|
+
switch (caseStyle) {
|
|
27
|
+
case 'lower':
|
|
28
|
+
first = first.toLowerCase();
|
|
29
|
+
break;
|
|
30
|
+
case 'upper':
|
|
31
|
+
first = first.toUpperCase();
|
|
32
|
+
break;
|
|
33
|
+
case 'camel':
|
|
34
|
+
default:
|
|
35
|
+
}
|
|
36
|
+
return first + property.substring(1);
|
|
37
|
+
});
|
|
38
38
|
}
|