@lenne.tech/nest-server 10.8.9 → 10.8.10

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": "10.8.9",
3
+ "version": "10.8.10",
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",
@@ -303,12 +303,27 @@ export class TestHelper {
303
303
  if (config.convertEnums) {
304
304
  if (Array.isArray(config.convertEnums)) {
305
305
  for (const key of Object.values(config.convertEnums)) {
306
- const regExpStr = `(${key}: )\\"([_A-Z][_0-9A-Z]*)\\"`;
306
+ const regExpStr = `(?<=${key}:\\s*)"([A-Z0-9_]+)"(?=\\s*[,\\]}])`;
307
307
  const regExp = new RegExp(regExpStr, 'g');
308
- query = query.replace(regExp, '$1$2');
308
+ query = query.replace(regExp, (match, group1) => {
309
+ // If group1 consists exclusively of digits, return original string
310
+ if (/^\d+$/.test(group1)) {
311
+ return match;
312
+ }
313
+ // Otherwise remove quotation marks
314
+ return group1;
315
+ });
309
316
  }
310
317
  } else {
311
- query = query.replace(/([_A-Za-z][_0-9A-Za-z]*:\s)\"([_A-Z][_0-9A-Z]*)\"/g, '$1$2');
318
+ const before = query.replace(/([_A-Za-z][_0-9A-Za-z]*:\s)\"([_A-Z][_0-9A-Z]*)\"/g, '$1$2');
319
+ query = query.replace(/(?<=[:\[,]\s*)"([A-Z0-9_]+)"(?=\s*[,\]\}])/g, (match, group1) => {
320
+ // If group1 only contains digits, the original string is returned
321
+ if (/^\d+$/.test(group1)) {
322
+ return match;
323
+ }
324
+ // Otherwise the quotation marks are removed
325
+ return group1;
326
+ });
312
327
  }
313
328
  }
314
329