aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/pathe/dist/utils.d.cts
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-13 21:34:48 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-13 21:34:48 -0800
commit76cb9c2a39d477a64824a985ade40507e3bbade1 (patch)
tree41e997aa9c6f538d3a136af61dae9424db2005a9 /vanilla/node_modules/pathe/dist/utils.d.cts
parent819a39a21ac992b1393244a4c283bbb125208c69 (diff)
downloadneko-76cb9c2a39d477a64824a985ade40507e3bbade1.tar.gz
neko-76cb9c2a39d477a64824a985ade40507e3bbade1.tar.bz2
neko-76cb9c2a39d477a64824a985ade40507e3bbade1.zip
feat(vanilla): add testing infrastructure and tests (NK-wjnczv)
Diffstat (limited to 'vanilla/node_modules/pathe/dist/utils.d.cts')
-rw-r--r--vanilla/node_modules/pathe/dist/utils.d.cts32
1 files changed, 32 insertions, 0 deletions
diff --git a/vanilla/node_modules/pathe/dist/utils.d.cts b/vanilla/node_modules/pathe/dist/utils.d.cts
new file mode 100644
index 0000000..af369d0
--- /dev/null
+++ b/vanilla/node_modules/pathe/dist/utils.d.cts
@@ -0,0 +1,32 @@
+/**
+ * Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
+ * This function also ensures that aliases do not resolve to themselves cyclically.
+ *
+ * @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
+ * @returns a set of normalised alias mappings.
+ */
+declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
+/**
+ * Resolves a path string to its alias if applicable, otherwise returns the original path.
+ * This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
+ *
+ * @param path - The path string to resolve.
+ * @param aliases - A set of alias mappings to use for resolution.
+ * @returns the resolved path as a string.
+ */
+declare function resolveAlias(path: string, aliases: Record<string, string>): string;
+/**
+ * Resolves a path string to its possible alias.
+ *
+ * Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
+ */
+declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
+/**
+ * Extracts the filename from a given path, excluding any directory paths and the file extension.
+ *
+ * @param path - The full path of the file from which to extract the filename.
+ * @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
+ */
+declare function filename(path: string): string | undefined;
+
+export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };