Skip to content

Commit c77c677

Browse files
authored
refactor: inline withTrailingSlash util (#482)
1 parent 997497b commit c77c677

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"rollup-plugin-dts": "^6.1.1",
5353
"scule": "^1.3.0",
5454
"tinyglobby": "^0.2.10",
55-
"ufo": "^1.5.4",
5655
"untyped": "^1.5.2"
5756
},
5857
"devDependencies": {

Diff for: pnpm-lock.yaml

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Module from "node:module";
22
import { promises as fsp } from "node:fs";
33
import { resolve, relative, isAbsolute, normalize } from "pathe";
4-
import { withTrailingSlash } from "ufo";
54
import type { PackageJson } from "pkg-types";
65
import { colors } from "consola/utils";
76
import { consola } from "consola";
@@ -15,6 +14,7 @@ import {
1514
resolvePreset,
1615
removeExtension,
1716
inferPkgExternals,
17+
withTrailingSlash,
1818
} from "./utils";
1919
import type { BuildContext, BuildConfig, BuildOptions } from "./types";
2020
import { validatePackage, validateDependencies } from "./validate";

Diff for: src/utils.ts

+4
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,7 @@ function pathToRegex(path: string): string | RegExp {
202202
)
203203
: path;
204204
}
205+
206+
export function withTrailingSlash(path: string): string {
207+
return path.endsWith("/") ? path : `${path}/`;
208+
}

0 commit comments

Comments
 (0)