elysia-autoload 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7,15 +7,16 @@ const node_path_1 = require("node:path");
7
7
  const utils_1 = require("./utils");
8
8
  async function autoload({ pattern, dir, prefix, schema, } = {}) {
9
9
  const directoryPath = (0, utils_1.getPath)(dir || "./routes");
10
- if (!node_fs_1.default.existsSync(directoryPath))
10
+ if (!(0, node_fs_1.existsSync)(directoryPath))
11
11
  throw new Error(`Directory ${directoryPath} doesn't exists`);
12
- if (!node_fs_1.default.statSync(directoryPath).isDirectory())
12
+ if (!(0, node_fs_1.statSync)(directoryPath).isDirectory())
13
13
  throw new Error(`${directoryPath} isn't a directory`);
14
14
  const app = new elysia_1.default({
15
15
  name: "elysia-autoload",
16
16
  seed: {
17
17
  pattern,
18
18
  dir,
19
+ prefix,
19
20
  },
20
21
  });
21
22
  const glob = new Bun.Glob(pattern || "**/*.{ts,js,mjs,cjs}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elysia-autoload",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "author": "kravetsone",
5
5
  "description": "Plugin for Elysia which autoload all routes in directory",
6
6
  "keywords": [
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "main": "dist/index.js",
16
16
  "scripts": {
17
- "prepublishOnly": "npm run lint:fix && tsc",
17
+ "prepublishOnly": "tsc",
18
18
  "lint": "eslint \"src/**/*.{ts,tsx,js,mjs,cjs}\"",
19
19
  "lint:fix": "eslint \"src/**/*.{ts,tsx,js,mjs,cjs}\" --fix"
20
20
  },