1
1
/**
2
2
* Test if the given input has a trailing slash.
3
- * @param {string = '' } input The string to test.
3
+ * @param {string } [ input] The string to test.
4
4
* @returns {boolean }
5
5
*/
6
6
export function hasTrailingSlash ( input = '' ) {
@@ -9,7 +9,7 @@ export function hasTrailingSlash(input = '') {
9
9
10
10
/**
11
11
* Make sure that a string does not end with a trailing slash.
12
- * @param {string = '' } input The string to test.
12
+ * @param {string } [ input] The string to test.
13
13
* @returns {string } The string without trailing slash.
14
14
*/
15
15
export function withoutTrailingSlash ( input = '' ) {
@@ -18,7 +18,7 @@ export function withoutTrailingSlash(input = '') {
18
18
19
19
/**
20
20
* Make sure the string given ends with a trailing slash.
21
- * @param {string = '' } input The string to test.
21
+ * @param {string } [ input] The string to test.
22
22
* @returns {string } The string with a trailing slash.
23
23
*/
24
24
export function withTrailingSlash ( input = '' ) {
@@ -27,7 +27,7 @@ export function withTrailingSlash(input = '') {
27
27
28
28
/**
29
29
* Test if the given input has a leading slash.
30
- * @param {string = '' } input The string to test.
30
+ * @param {string } [ input] The string to test.
31
31
* @returns {boolean }
32
32
*/
33
33
export function hasLeadingSlash ( input = '' ) {
@@ -36,7 +36,7 @@ export function hasLeadingSlash(input = '') {
36
36
37
37
/**
38
38
* Make sure the given string does not have a leading slash.
39
- * @param {string = '' } input The string to test.
39
+ * @param {string } [ input] The string to test.
40
40
* @returns {string } The string without leading slash.
41
41
*/
42
42
export function withoutLeadingSlash ( input = '' ) {
@@ -45,8 +45,8 @@ export function withoutLeadingSlash(input = '') {
45
45
46
46
/**
47
47
* Make sure the given string has a leading slash.
48
- * @param {string = '' } input The string to test.
49
- * @param {string } The string with a leading slash.
48
+ * @param {string } [ input] The string to test.
49
+ * @returns {string } The string with a leading slash.
50
50
*/
51
51
export function withLeadingSlash ( input = '' ) {
52
52
return hasLeadingSlash ( input ) ? input : `/${ input } ` ;
0 commit comments