Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.paths

Cross-platform path helpers. A LEAF namespace (no project deps) so any layer — core, extensions, tests — can normalize without a require cycle.

Cross-platform path helpers. A LEAF namespace (no project deps) so any
layer — core, extensions, tests — can normalize without a require cycle.
raw docstring

abbreviate-homeclj

(abbreviate-home path)

Shorten an absolute path for DISPLAY by replacing the user's home dir with ~, matching the footer/navigator/dialogs. Only rewrites when path is at or under home (so /etc/x is left alone); returns path unchanged otherwise. Nil-safe.

Shorten an absolute path for DISPLAY by replacing the user's home dir with
`~`, matching the footer/navigator/dialogs. Only rewrites when `path` is at
or under home (so `/etc/x` is left alone); returns `path` unchanged
otherwise. Nil-safe.
sourceraw docstring

pathological-index-root?clj

(pathological-index-root? dir)

True when dir MUST NOT be recursively indexed for fuzzy file-finding or content search: the user's HOME directory or a filesystem root (/, C:\). These are never project workspaces — on a real machine they carry Library/, ~/.m2, node_modules, and caches with millions of files, so a full fff scan never finishes and freezes the tool (observed: vis launched from ~ hangs). Callers degrade to a no-index path instead of walking the tree. dir is a java.io.File; comparison is canonical. Never throws.

True when `dir` MUST NOT be recursively indexed for fuzzy file-finding or
content search: the user's HOME directory or a filesystem root (`/`, `C:\`).
These are never project workspaces — on a real machine they carry Library/,
~/.m2, node_modules, and caches with millions of files, so a full fff scan
never finishes and freezes the tool (observed: `vis` launched from `~`
hangs). Callers degrade to a no-index path instead of walking the tree.
`dir` is a java.io.File; comparison is canonical. Never throws.
sourceraw docstring

unixifyclj

(unixify s)

Normalize a path string to / separators on every OS. Java's File/Path APIs yield \ on Windows, and there is no stdlib/fs call that hands back a /-string there — so this is the single canonical normalizer.

Use it ONLY where a path is DATA: compared, glob-matched, shown to the model, or embedded in a URL / wire / DB. NEVER for real filesystem I/O — io/file, .exists, JGit, nio all take native paths fine. Returns nil for nil input.

Normalize a path string to `/` separators on every OS. Java's `File`/`Path`
APIs yield `\` on Windows, and there is no stdlib/`fs` call that hands back
a `/`-string there — so this is the single canonical normalizer.

Use it ONLY where a path is DATA: compared, glob-matched, shown to the model,
or embedded in a URL / wire / DB. NEVER for real filesystem I/O — `io/file`,
`.exists`, JGit, nio all take native paths fine. Returns nil for nil input.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close