From 696403d3fa79f79fa3340bb1fe11533d1fdaf0a4 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 13 Mar 2025 17:55:37 +0000
Subject: [PATCH] chore: bump version to 4.4.1
---
quartz/util/path.ts | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/quartz/util/path.ts b/quartz/util/path.ts
index 5835f15..6d99c36 100644
--- a/quartz/util/path.ts
+++ b/quartz/util/path.ts
@@ -1,9 +1,6 @@
import { slug as slugAnchor } from "github-slugger"
import type { Element as HastElement } from "hast"
-import rfdc from "rfdc"
-
-export const clone = rfdc()
-
+import { clone } from "./clone"
// this file must be isomorphic so it can't use node libs (e.g. path)
export const QUARTZ = "quartz"
@@ -39,7 +36,7 @@
export function isRelativeURL(s: string): s is RelativeURL {
const validStart = /^\.{1,2}/.test(s)
const validEnding = !endsWith(s, "index")
- return validStart && validEnding && ![".md", ".html"].includes(_getFileExtension(s) ?? "")
+ return validStart && validEnding && ![".md", ".html"].includes(getFileExtension(s) ?? "")
}
export function getFullSlug(window: Window): FullSlug {
@@ -64,7 +61,7 @@
export function slugifyFilePath(fp: FilePath, excludeExt?: boolean): FullSlug {
fp = stripSlashes(fp) as FilePath
- let ext = _getFileExtension(fp)
+ let ext = getFileExtension(fp)
const withoutFileExt = fp.replace(new RegExp(ext + "$"), "")
if (excludeExt || [".md", ".html", undefined].includes(ext)) {
ext = ""
@@ -275,10 +272,10 @@
}
function _hasFileExtension(s: string): boolean {
- return _getFileExtension(s) !== undefined
+ return getFileExtension(s) !== undefined
}
-function _getFileExtension(s: string): string | undefined {
+export function getFileExtension(s: string): string | undefined {
return s.match(/\.[A-Za-z0-9]+$/)?.[0]
}
--
Gitblit v1.10.0