mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-03 15:43:45 +00:00
chore: upgrade bun from 1.3.5 -> 1.3.6, also update types/bun from 1.3.4 -> 1.3.6 and fix type errs (#8499)
Co-authored-by: Github Action <action@github.com>
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
import { realpathSync } from "fs"
|
||||
import { exists } from "fs/promises"
|
||||
import { dirname, join, relative } from "path"
|
||||
|
||||
export namespace Filesystem {
|
||||
export const exists = (p: string) =>
|
||||
Bun.file(p)
|
||||
.stat()
|
||||
.then(() => true)
|
||||
.catch(() => false)
|
||||
|
||||
export const isDir = (p: string) =>
|
||||
Bun.file(p)
|
||||
.stat()
|
||||
.then((s) => s.isDirectory())
|
||||
.catch(() => false)
|
||||
/**
|
||||
* On Windows, normalize a path to its canonical casing using the filesystem.
|
||||
* This is needed because Windows paths are case-insensitive but LSP servers
|
||||
@@ -31,7 +41,7 @@ export namespace Filesystem {
|
||||
const result = []
|
||||
while (true) {
|
||||
const search = join(current, target)
|
||||
if (await exists(search).catch(() => false)) result.push(search)
|
||||
if (await exists(search)) result.push(search)
|
||||
if (stop === current) break
|
||||
const parent = dirname(current)
|
||||
if (parent === current) break
|
||||
@@ -46,7 +56,7 @@ export namespace Filesystem {
|
||||
while (true) {
|
||||
for (const target of targets) {
|
||||
const search = join(current, target)
|
||||
if (await exists(search).catch(() => false)) yield search
|
||||
if (await exists(search)) yield search
|
||||
}
|
||||
if (stop === current) break
|
||||
const parent = dirname(current)
|
||||
|
||||
Reference in New Issue
Block a user