summaryrefslogtreecommitdiff
path: root/docs/src/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src/util.ts')
-rw-r--r--docs/src/util.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/src/util.ts b/docs/src/util.ts
index 0ec91bce0..269373735 100644
--- a/docs/src/util.ts
+++ b/docs/src/util.ts
@@ -2,3 +2,13 @@ export function getLanguageFromURL(pathname: string) {
const langCodeMatch = pathname.match(/\/([a-z]{2}-?[A-Z]{0,2})\//);
return langCodeMatch ? langCodeMatch[1] : 'en';
}
+
+/** Remove \ and / from beginning of string */
+export function removeLeadingSlash(path: string) {
+ return path.replace(/^[/\\]+/, '');
+}
+
+/** Remove \ and / from end of string */
+export function removeTrailingSlash(path: string) {
+ return path.replace(/[/\\]+$/, '');
+}
mmit/scripts/package.json?h=@astrojs/vue@0.1.0&id=77c0be5b267418333c11c28d22dd600c9f62d5ef&follow=1'>update lockfile (#3059)Gravatar Fred K. Schott 29-914/+698 2022-04-10correct changesetsGravatar Fred K. Schott 3-3/+11 2022-04-10chore: webapi test now use chai (#3048)Gravatar Juan Martín Seery 16-814/+539 2022-04-10update test names containing spacesGravatar Fred K. Schott 26-17/+17 2022-04-11[ci] formatGravatar FredKSchott 2-8/+7 2022-04-10Fix SSR static build public file copying. fixes #3016 (#3037)Gravatar Steve Lee 8-5/+48 2022-04-10fix our weird beta release issues (#3031)Gravatar Fred K. Schott 4-6/+116 2022-04-10update tailwind integration readmeGravatar Fred K. Schott 2-9/+38 2022-04-10Fixed MD Lint issues (#3038)Gravatar Rafid Muhymin Wafi 1-12/+11