File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,21 @@ export function dirname(path: string): string {
3838}
3939
4040/**
41- * Join path sections
41+ * Joins multiple path segments into a single path.
42+ *
43+ * @param args - The path segments to join
44+ * @deprecated use `join()` instead
4245 */
43- export function joinPaths ( ...args : string [ ] ) {
46+ export function joinPaths ( ...args : string [ ] ) : string {
47+ return join ( ...args )
48+ }
49+
50+ /**
51+ * Joins multiple path segments into a single path.
52+ *
53+ * @param args - The path segments to join
54+ */
55+ export function join ( ...args : string [ ] ) : string {
4456 if ( arguments . length < 1 ) {
4557 return ''
4658 }
Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: GPL-3.0-or-later
44 */
55import { describe , expect , it } from 'vitest' ;
6- import { joinPaths } from "../lib/index" ;
6+ import { joinPaths , join } from "../lib/index" ;
77
8- describe ( "joinPaths" , function ( ) {
8+ describe . for ( [ join , joinPaths ] ) ( "joinPaths" , ( joinPaths ) => {
99 it ( "returns empty string with no or empty arguments" , function ( ) {
1010 expect ( joinPaths ( ) ) . toEqual ( "" ) ;
1111 expect ( joinPaths ( "" ) ) . toEqual ( "" ) ;
You can’t perform that action at this time.
0 commit comments