esoftplay 0.0.114-a → 0.0.114-d
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/bin/router.js +19 -0
- package/esp.ts +27 -5
- package/package.json +1 -1
package/bin/router.js
CHANGED
|
@@ -401,6 +401,25 @@ declare module "esoftplay" {
|
|
|
401
401
|
function home(): any;
|
|
402
402
|
function log(message?: any, ...optionalParams: any[]): void;
|
|
403
403
|
function routes(): any;
|
|
404
|
+
const logColor : {
|
|
405
|
+
reset: string,
|
|
406
|
+
black: string,
|
|
407
|
+
red: string,
|
|
408
|
+
green: string,
|
|
409
|
+
yellow: string,
|
|
410
|
+
blue: string,
|
|
411
|
+
magenta: string,
|
|
412
|
+
cyan: string,
|
|
413
|
+
white: string,
|
|
414
|
+
backgroundBlack: string,
|
|
415
|
+
backgroundRed: string,
|
|
416
|
+
backgroundGreen: string,
|
|
417
|
+
backgroundYellow: string,
|
|
418
|
+
backgroundBlue: string,
|
|
419
|
+
backgroundMagenta: string,
|
|
420
|
+
backgroundCyan: string,
|
|
421
|
+
backgroundWhite: string,
|
|
422
|
+
}
|
|
404
423
|
}
|
|
405
424
|
interface useGlobalReturn<T> {
|
|
406
425
|
useState: () => [T, (newState: T | ((a:T) => T)) => T | undefined, () => void],
|
package/esp.ts
CHANGED
|
@@ -14,13 +14,13 @@ const ignoreWarns = [
|
|
|
14
14
|
"EventEmitter.removeListener",
|
|
15
15
|
"Got a component with the name 'm'",
|
|
16
16
|
"Did not receive response to shouldStartLoad in time",
|
|
17
|
-
"startLoadWithResult invoked with invalid lockldentifier
|
|
17
|
+
"startLoadWithResult invoked with invalid lockldentifier",
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
const err = console.error;
|
|
21
21
|
console.error = (...arg) => {
|
|
22
22
|
for (let i = 0; i < ignoreWarns.length; i++) {
|
|
23
|
-
|
|
23
|
+
if (arg[0].startsWith(ignoreWarns[i])) return;
|
|
24
24
|
}
|
|
25
25
|
err(...arg);
|
|
26
26
|
};
|
|
@@ -28,11 +28,14 @@ console.error = (...arg) => {
|
|
|
28
28
|
const warn = console.warn;
|
|
29
29
|
console.warn = (...arg) => {
|
|
30
30
|
for (let i = 0; i < ignoreWarns.length; i++) {
|
|
31
|
-
|
|
31
|
+
if (arg[0].startsWith(ignoreWarns[i])) return;
|
|
32
32
|
}
|
|
33
33
|
warn(...arg);
|
|
34
34
|
};
|
|
35
35
|
LogBox.ignoreLogs(ignoreWarns);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
36
39
|
let app = require('../../app.json');
|
|
37
40
|
let conf = require('../../config.json');
|
|
38
41
|
let lconf
|
|
@@ -201,10 +204,29 @@ export default (() => {
|
|
|
201
204
|
}
|
|
202
205
|
function log(message?: any, ...optionalParams: any[]) {
|
|
203
206
|
if (config("isDebug") == 1) {
|
|
204
|
-
console.log(message, ...optionalParams);
|
|
207
|
+
console.log(message, ...optionalParams, "\x1b[0m");
|
|
205
208
|
}
|
|
206
209
|
}
|
|
207
|
-
|
|
210
|
+
const logColor = {
|
|
211
|
+
reset: "\x1b[0m",
|
|
212
|
+
black: "\x1b[30m",
|
|
213
|
+
red: "\x1b[31m",
|
|
214
|
+
green: "\x1b[32m",
|
|
215
|
+
yellow: "\x1b[33m",
|
|
216
|
+
blue: "\x1b[34m",
|
|
217
|
+
magenta: "\x1b[35m",
|
|
218
|
+
cyan: "\x1b[36m",
|
|
219
|
+
white: "\x1b[37m",
|
|
220
|
+
backgroundBlack: "\x1b[40m",
|
|
221
|
+
backgroundRed: "\x1b[41m",
|
|
222
|
+
backgroundGreen: "\x1b[42m",
|
|
223
|
+
backgroundYellow: "\x1b[43m",
|
|
224
|
+
backgroundBlue: "\x1b[44m",
|
|
225
|
+
backgroundMagenta: "\x1b[45m",
|
|
226
|
+
backgroundCyan: "\x1b[46m",
|
|
227
|
+
backgroundWhite: "\x1b[47m",
|
|
228
|
+
}
|
|
229
|
+
return { appjson, log, home, isDebug, navigations, langId, lang, config, assets, routes, mod, versionName, logColor }
|
|
208
230
|
})()
|
|
209
231
|
|
|
210
232
|
// var a = esp.assets("bacground") // mengambil file dari folder images
|