@dnax/core 0.2.2 → 0.2.4
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/index.ts +7 -8
- package/driver/mongo/rest.ts +4 -0
- package/package.json +1 -1
package/bin/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import ch from "chokidar";
|
|
4
4
|
import { spinner } from "@clack/prompts";
|
|
5
|
+
import "@colors/colors";
|
|
5
6
|
var exec;
|
|
6
7
|
var s = spinner();
|
|
7
8
|
function runPkg(
|
|
@@ -26,21 +27,19 @@ function runPkg(
|
|
|
26
27
|
// Écoutez le signal SIGINT (Ctrl + C)
|
|
27
28
|
process.on("SIGINT", () => {
|
|
28
29
|
if (exec?.kill) exec.kill();
|
|
29
|
-
process.exit(); // Terminez le processus principal
|
|
30
|
+
process.exit(1); // Terminez le processus principal
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
ch.watch(".", {
|
|
33
34
|
cwd: process.cwd(),
|
|
34
35
|
ignored: [
|
|
35
|
-
// "**/*",
|
|
36
|
-
"!**/*.ts",
|
|
37
|
-
"!**/*.js",
|
|
38
|
-
"!**/*.env",
|
|
39
36
|
/.*\.(jpg|jpeg|png|gif|bmp|svg|webp|dump|zip|rar|.git)$/i,
|
|
40
37
|
/node_modules|node_modules\/.*/,
|
|
41
38
|
/node_modules/,
|
|
42
39
|
/(^|[\/\\])\../,
|
|
43
40
|
"*/node_modules",
|
|
41
|
+
"node_modules",
|
|
42
|
+
"dist",
|
|
44
43
|
"*/dist",
|
|
45
44
|
"*.zip",
|
|
46
45
|
"*.tar",
|
|
@@ -54,16 +53,16 @@ ch.watch(".", {
|
|
|
54
53
|
],
|
|
55
54
|
})
|
|
56
55
|
.on("change", (path) => {
|
|
56
|
+
console.log("Changed file:".gray, path.green);
|
|
57
57
|
let dev = process.argv.includes("--dev");
|
|
58
|
-
|
|
59
|
-
if (dev) {
|
|
58
|
+
if (dev && (path?.endsWith(".ts") || path?.endsWith(".js"))) {
|
|
60
59
|
s.start("Restarting due to changes ...");
|
|
61
60
|
if (exec?.kill) {
|
|
62
61
|
exec.kill();
|
|
63
62
|
}
|
|
64
63
|
setTimeout(() => {
|
|
65
64
|
runPkg({ stopSpinner: true });
|
|
66
|
-
},
|
|
65
|
+
}, 1000);
|
|
67
66
|
}
|
|
68
67
|
})
|
|
69
68
|
.on("ready", () => {
|
package/driver/mongo/rest.ts
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
setUUID,
|
|
28
28
|
} from "./utils";
|
|
29
29
|
import { Cfg } from "../../config";
|
|
30
|
+
import cleanDeep from "clean-deep";
|
|
30
31
|
|
|
31
32
|
type options = {
|
|
32
33
|
tenant_id: string;
|
|
@@ -420,6 +421,9 @@ class useRest {
|
|
|
420
421
|
): Promise<object[]> {
|
|
421
422
|
return new Promise(async (resolve, reject) => {
|
|
422
423
|
try {
|
|
424
|
+
if (options?.cleanDeep) {
|
|
425
|
+
params = cleanDeep(params);
|
|
426
|
+
}
|
|
423
427
|
let useHook = options?.useHook ?? this.#useHook;
|
|
424
428
|
let useCustomApi = options?.useCustomApi ?? this.#useCustomApi;
|
|
425
429
|
let sharedData = {};
|