@lenne.tech/nest-server 9.0.16 → 9.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "9.0.16",
3
+ "version": "9.0.17",
4
4
  "description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
5
5
  "keywords": [
6
6
  "node",
@@ -16,6 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "rimraf dist && tsc -p tsconfig.build.json",
18
18
  "build:pack": "npm pack && echo 'use file:/ROOT_PATH_TO_TGZ_FILE to integrate the package'",
19
+ "build:dev": "npm run build && yalc push --private",
19
20
  "docs": "npm run docs:ci && open ./public/index.html",
20
21
  "docs:bootstrap": "node extras/update-spectaql-version.mjs && npx -y spectaql ./spectaql.yml",
21
22
  "docs:ci": "ts-node ./scripts/init-server.ts && npm run docs:bootstrap",
@@ -45,7 +46,8 @@
45
46
  "prepack": "npm run prestart:prod",
46
47
  "prepare": "husky install",
47
48
  "prepublishOnly": "npm run format && npm run lint && npm run test:ci",
48
- "preversion": "npm run lint"
49
+ "preversion": "npm run lint",
50
+ "watch": "npm-watch"
49
51
  },
50
52
  "repository": {
51
53
  "type": "git",
@@ -119,6 +121,7 @@
119
121
  "grunt-sync": "0.8.2",
120
122
  "husky": "8.0.1",
121
123
  "jest": "29.2.1",
124
+ "npm-watch": "0.11.0",
122
125
  "pm2": "5.2.2",
123
126
  "prettier": "2.7.1",
124
127
  "pretty-quick": "3.1.3",
@@ -127,7 +130,8 @@
127
130
  "ts-morph": "16.0.0",
128
131
  "ts-node": "10.9.1",
129
132
  "tsconfig-paths": "4.1.0",
130
- "typescript": "4.8.4"
133
+ "typescript": "4.8.4",
134
+ "yalc": "^1.0.0-pre.53"
131
135
  },
132
136
  "jest": {
133
137
  "collectCoverage": true,
@@ -149,5 +153,8 @@
149
153
  "files": [
150
154
  "dist/**/*",
151
155
  "src/**/*"
152
- ]
156
+ ],
157
+ "watch": {
158
+ "build:dev": "src"
159
+ }
153
160
  }
@@ -626,3 +626,35 @@ export function instanceofArray(arr: any[], strict = false): string {
626
626
  }
627
627
  return constructor;
628
628
  }
629
+
630
+ /**
631
+ * Process data via function deep
632
+ * @param data
633
+ * @param func
634
+ * @param processedObjects
635
+ */
636
+ export function processDeep(data: any, func: (data: any) => any, processedObjects = new WeakMap()): any {
637
+ // Prevent circular processing
638
+ if (typeof data === 'object') {
639
+ if (processedObjects.get(data)) {
640
+ return data;
641
+ }
642
+ processedObjects.set(data, true);
643
+ }
644
+
645
+ // Process array
646
+ if (Array.isArray(data)) {
647
+ return data.map((item) => processDeep(item, func));
648
+ }
649
+
650
+ // Process object
651
+ if (typeof data === 'object') {
652
+ for (const [key, value] of Object.entries(data)) {
653
+ data[key] = processDeep(value, func, processedObjects);
654
+ }
655
+ return data;
656
+ }
657
+
658
+ // Process others
659
+ return func(data);
660
+ }