@oh-my-pi/pi-natives 12.4.0 → 12.5.1

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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-natives",
3
- "version": "12.4.0",
3
+ "version": "12.5.1",
4
4
  "description": "Native Rust functionality via N-API",
5
5
  "keywords": ["napi", "rust", "native", "grep", "text-processing"],
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/can1357/oh-my-pi/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@oh-my-pi/pi-utils": "12.4.0"
40
+ "@oh-my-pi/pi-utils": "12.5.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/bun": "^1.3.9"
package/src/glob/index.ts CHANGED
@@ -16,10 +16,6 @@ export { FileType } from "./types";
16
16
  export async function glob(options: GlobOptions, onMatch?: (match: GlobMatch) => void): Promise<GlobResult> {
17
17
  const searchPath = path.resolve(options.path);
18
18
  const pattern = options.pattern || "*";
19
-
20
- // Convert simple patterns to recursive globs if needed
21
- const globPattern = pattern.includes("/") || pattern.startsWith("**") ? pattern : `**/${pattern}`;
22
-
23
19
  // napi-rs ThreadsafeFunction passes (error, value) - skip callback on error
24
20
  const cb = onMatch ? (err: Error | null, m: GlobMatch) => !err && onMatch(m) : undefined;
25
21
 
@@ -27,9 +23,10 @@ export async function glob(options: GlobOptions, onMatch?: (match: GlobMatch) =>
27
23
  {
28
24
  ...options,
29
25
  path: searchPath,
30
- pattern: globPattern,
26
+ pattern,
31
27
  hidden: options.hidden ?? false,
32
28
  gitignore: options.gitignore ?? true,
29
+ recursive: options.recursive ?? true,
33
30
  },
34
31
  cb,
35
32
  );
package/src/glob/types.ts CHANGED
@@ -19,8 +19,10 @@ export interface GlobOptions extends Cancellable {
19
19
  pattern: string;
20
20
  /** Directory to search. */
21
21
  path: string;
22
- /** Filter by file type: "file", "dir", or "symlink". */
22
+ /** Filter by file type: "file", "dir", or "symlink". Symlinks match file/dir filters when their target type matches. */
23
23
  fileType?: FileType;
24
+ /** Match simple patterns recursively by default (example: *.ts -> recursive match). Set false to keep patterns relative to the search root only. */
25
+ recursive?: boolean;
24
26
  /** Include hidden files (default: false). */
25
27
  hidden?: boolean;
26
28
  /** Maximum number of results to return. */
@@ -39,7 +41,7 @@ export interface GlobOptions extends Cancellable {
39
41
  export interface GlobMatch {
40
42
  /** Relative path from the search root. */
41
43
  path: string;
42
- /** Resolved filesystem type for the match. */
44
+ /** Resolved filesystem type for the match (for fileType=file/dir filters, symlink targets are reported as file/dir). */
43
45
  fileType: FileType;
44
46
  /** Modification time in milliseconds since epoch, if available. */
45
47
  mtime?: number;