44 */
55
66import { DRIVE_PATH_REGEX } from '#internal/constants'
7- import validateURLString from '#internal/validate-url -string'
7+ import validateString from '#internal/validate-string'
88import dot from '#lib/dot'
99import isSep from '#lib/is-sep'
1010import resolveWith from '#lib/resolve-with'
1111import sep from '#lib/sep'
12- import toPath from '#lib/to-path'
1312import type { RelativeOptions } from '@flex-development/pathe'
1413
1514export default relative
@@ -24,40 +23,32 @@ export default relative
2423 * If a zero-length string is passed as `from` or `to`, the current working
2524 * directory will be used instead of the zero-length strings.
2625 *
27- * > 👉 **Note**: If `from` or `to` is a {@linkcode URL}, or can be parsed to a
28- * > `URL`, they'll be converted to paths using {@linkcode toPath}.
29- *
3026 * @see {@linkcode RelativeOptions }
3127 *
28+ * @todo url support
29+ *
3230 * @category
3331 * core
3432 *
3533 * @this {void}
3634 *
37- * @param {URL | string[] | string } from
38- * Start path, path segments, or URL
39- * @param {URL | string[] | string } to
40- * Destination path, path segments, or URL
35+ * @param {string[] | string } from
36+ * Start path or path segments
37+ * @param {string[] | string } to
38+ * Destination path or path segments
4139 * @param {RelativeOptions | null | undefined } [options]
4240 * Relative path generation options
4341 * @return {string }
4442 * Relative path from `from` to `to`
4543 */
4644function relative (
4745 this : void ,
48- from : URL | string [ ] | string ,
49- to : URL | string [ ] | string ,
46+ from : string [ ] | string ,
47+ to : string [ ] | string ,
5048 options ?: RelativeOptions | null | undefined
5149) : string {
52- if ( ! Array . isArray ( from ) ) {
53- validateURLString ( from , 'from' )
54- from = toPath ( from )
55- }
56-
57- if ( ! Array . isArray ( to ) ) {
58- validateURLString ( to , 'to' )
59- to = toPath ( to )
60- }
50+ if ( ! Array . isArray ( from ) ) validateString ( from , 'from' )
51+ if ( ! Array . isArray ( to ) ) validateString ( to , 'to' )
6152
6253 if ( from === to ) return ''
6354
0 commit comments