path-ops
v1.0.0
Published
Operators for node path.
Downloads
9
Readme
Path OPS
Operators for node path.
Alias
resolveWithAlias(path, aliasMap)
Resolve alias paths to source paths.
import { resolveWithAlias } from "path-ops";
resolveWithAlias("@/page/index", { "@": "src" });
// => src/page/index
// types
declare function resolveWithAlias(
path: string,
aliasMap: Record<string, string>
): string;
resolveToAlias
Resolve source paths to alias paths.
import { resolveToAlias } from "path-ops";
resolveToAlias("src/page/index", { "@": "src" });
// => @/page/index
// types
declare function resolveToAlias(
path: string,
aliasMap: Record<string, string>
): string;