simple-folder-search 1.0.1 → 1.0.2
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/README.md +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -5
- package/eslint.config.mjs +2 -1
- package/package.json +1 -1
- package/src/index.ts +1 -5
- package/src/simple-folder-search.ts +1 -1
- package/tsup.config.ts +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ npm install simple-folder-search
|
|
|
23
23
|
Here is an example of how to use the package to search for files and play a file using `discord-player`'s search method:
|
|
24
24
|
|
|
25
25
|
```javascript
|
|
26
|
-
const simpleFolderSearch = require('simple-folder-search');
|
|
26
|
+
const { simpleFolderSearch } = require('simple-folder-search');
|
|
27
27
|
const { Player, QueryType } = require('discord-player');
|
|
28
28
|
|
|
29
29
|
// Initialize the player
|
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
|
|
33
|
+
simpleFolderSearch: () => simpleFolderSearch
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
@@ -74,7 +74,7 @@ function simpleFolderSearch(filepath, fileExtensions, search, minimumScore = 0.6
|
|
|
74
74
|
const results = fuse.search(search);
|
|
75
75
|
return results.filter((result) => result.score ? result.score <= 1 - minimumScore : false).map((result) => result.item.path);
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
+
0 && (module.exports = {
|
|
79
|
+
simpleFolderSearch
|
|
80
|
+
});
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -38,10 +38,6 @@ function simpleFolderSearch(filepath, fileExtensions, search, minimumScore = 0.6
|
|
|
38
38
|
const results = fuse.search(search);
|
|
39
39
|
return results.filter((result) => result.score ? result.score <= 1 - minimumScore : false).map((result) => result.item.path);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
// src/index.ts
|
|
43
|
-
var index_default = simpleFolderSearch;
|
|
44
|
-
module.exports = simpleFolderSearch;
|
|
45
41
|
export {
|
|
46
|
-
|
|
42
|
+
simpleFolderSearch
|
|
47
43
|
};
|
package/eslint.config.mjs
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ import Fuse from "fuse.js";
|
|
|
11
11
|
* @param {number} [minimumScore=0.6] - The minimum score for a match to be considered valid.
|
|
12
12
|
* @returns {string[]} An array of file paths that match the search query.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export function simpleFolderSearch(filepath: string, fileExtensions: string[], search: string, minimumScore: number = 0.6): string[] {
|
|
15
15
|
const absolutePath = path.resolve(process.cwd(), filepath);
|
|
16
16
|
|
|
17
17
|
if (!fs.existsSync(absolutePath)) throw new Error("Filepath does not exist.");
|