@gmickel/gno 0.13.2 → 0.14.0
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 +1 -1
- package/src/ingestion/walker.ts +9 -5
package/package.json
CHANGED
package/src/ingestion/walker.ts
CHANGED
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
|
|
20
20
|
import type { SkippedEntry, WalkConfig, WalkEntry, WalkerPort } from "./types";
|
|
21
21
|
|
|
22
|
+
import { SUPPORTED_EXTENSIONS } from "../converters/mime";
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Regex to detect dangerous patterns with parent directory traversal.
|
|
24
26
|
* Matches ".." at start, after "/", or after "\" (Windows).
|
|
@@ -108,18 +110,20 @@ function matchesExclude(relPath: string, excludes: string[]): boolean {
|
|
|
108
110
|
/**
|
|
109
111
|
* Check if a file extension matches the include list.
|
|
110
112
|
* Include list contains extensions like ".md" or "md" (normalized).
|
|
113
|
+
* When include is empty, falls back to SUPPORTED_EXTENSIONS to avoid
|
|
114
|
+
* walking files that can't be converted.
|
|
111
115
|
*/
|
|
112
116
|
function matchesInclude(relPath: string, include: string[]): boolean {
|
|
113
|
-
if (include.length === 0) {
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
117
|
const ext = extname(relPath).toLowerCase();
|
|
118
118
|
if (!ext) {
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
// Fallback to supported extensions when no explicit include list
|
|
123
|
+
const effectiveInclude =
|
|
124
|
+
include.length === 0 ? SUPPORTED_EXTENSIONS : include;
|
|
125
|
+
|
|
126
|
+
return effectiveInclude.some((inc) => {
|
|
123
127
|
const normalizedInc = inc.startsWith(".")
|
|
124
128
|
? inc.toLowerCase()
|
|
125
129
|
: `.${inc.toLowerCase()}`;
|