@aeriajs/core 0.0.140 → 0.0.141

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/dist/database.js CHANGED
@@ -70,9 +70,16 @@ const getDatabaseSync = () => {
70
70
  };
71
71
  exports.getDatabaseSync = getDatabaseSync;
72
72
  const prepareCollectionName = (collectionName) => {
73
- const pluralized = collectionName.endsWith('s')
74
- ? `${collectionName}es`
75
- : `${collectionName}s`;
73
+ let pluralized;
74
+ if (collectionName.endsWith('y')) {
75
+ pluralized = collectionName.replace(/y$/, 'ies');
76
+ }
77
+ else if (collectionName.endsWith('s')) {
78
+ pluralized = `${collectionName}es`;
79
+ }
80
+ else {
81
+ pluralized = `${collectionName}s`;
82
+ }
76
83
  return pluralized.toLowerCase();
77
84
  };
78
85
  exports.prepareCollectionName = prepareCollectionName;
package/dist/database.mjs CHANGED
@@ -43,7 +43,14 @@ export const getDatabaseSync = () => {
43
43
  return dbMemo.db;
44
44
  };
45
45
  export const prepareCollectionName = (collectionName) => {
46
- const pluralized = collectionName.endsWith("s") ? `${collectionName}es` : `${collectionName}s`;
46
+ let pluralized;
47
+ if (collectionName.endsWith("y")) {
48
+ pluralized = collectionName.replace(/y$/, "ies");
49
+ } else if (collectionName.endsWith("s")) {
50
+ pluralized = `${collectionName}es`;
51
+ } else {
52
+ pluralized = `${collectionName}s`;
53
+ }
47
54
  return pluralized.toLowerCase();
48
55
  };
49
56
  export const getDatabaseCollection = (collectionName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/core",
3
- "version": "0.0.140",
3
+ "version": "0.0.141",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "aeriaMain": "tests/fixtures/aeriaMain.js",
@@ -42,11 +42,11 @@
42
42
  "mongodb-memory-server": "^9.2.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@aeriajs/builtins": "^0.0.140",
45
+ "@aeriajs/builtins": "^0.0.141",
46
46
  "@aeriajs/common": "^0.0.88",
47
47
  "@aeriajs/entrypoint": "^0.0.90",
48
48
  "@aeriajs/http": "^0.0.99",
49
- "@aeriajs/security": "^0.0.140",
49
+ "@aeriajs/security": "^0.0.141",
50
50
  "@aeriajs/types": "^0.0.76",
51
51
  "@aeriajs/validation": "^0.0.91"
52
52
  },
@@ -58,7 +58,7 @@
58
58
  "mongodb-memory-server": "^9.2.0"
59
59
  },
60
60
  "scripts": {
61
- "test": "TS_NODE_COMPILER_OPTIONS=\"$(cat ../compilerOptions.json)\" mocha --exit --timeout 10000 -r ts-node/register tests/*.spec.ts",
61
+ "test": "vitest run",
62
62
  "lint": "eslint src",
63
63
  "lint:fix": "eslint src --fix",
64
64
  "build": "pnpm build:cjs && pnpm build:esm",