@@ -14,7 +14,7 @@ TemplatePath.getWorkingDir = function () {
14
14
* Returns the directory portion of a path.
15
15
* Works for directory and file paths and paths ending in a glob pattern.
16
16
*
17
- * @param {String } path A path
17
+ * @param {String } path - A path
18
18
* @returns {String } the directory portion of a path.
19
19
*/
20
20
TemplatePath . getDir = function ( path ) {
@@ -33,8 +33,8 @@ TemplatePath.getDir = function (path) {
33
33
*
34
34
* [1]: https://nodejs.org/api/path.html#path_path_parse_path
35
35
*
36
- * @param {String } path A path
37
36
* @returns {String } the directory portion of a path.
37
+ * @param {String } filePath - A path
38
38
*/
39
39
TemplatePath . getDirFromFilePath = function ( filePath ) {
40
40
return path . parse ( filePath ) . dir || "." ;
@@ -47,7 +47,7 @@ TemplatePath.getDirFromFilePath = function (filePath) {
47
47
*
48
48
* [1]: https://nodejs.org/api/path.html#path_path_parse_path
49
49
*
50
- * @param {String } path A path
50
+ * @param {String } path - A path
51
51
* @returns {String } the last path segment in a path
52
52
*/
53
53
TemplatePath . getLastPathSegment = function ( path ) {
@@ -62,7 +62,7 @@ TemplatePath.getLastPathSegment = function (path) {
62
62
} ;
63
63
64
64
/**
65
- * @param {String } path A path
65
+ * @param {String } path - A path
66
66
* @returns {String[] } an array of paths pointing to each path segment of the
67
67
* provided `path`.
68
68
*/
@@ -88,7 +88,7 @@ TemplatePath.getAllDirs = function (path) {
88
88
*
89
89
* [1]: https://nodejs.org/api/path.html#path_path_normalize_path
90
90
*
91
- * @param {String } thePath The path that should be normalized.
91
+ * @param {String } thePath - The path that should be normalized.
92
92
* @returns {String } the normalized path.
93
93
*/
94
94
TemplatePath . normalize = function ( thePath ) {
@@ -106,7 +106,7 @@ TemplatePath.normalize = function (thePath) {
106
106
*
107
107
* [1]: https://nodejs.org/api/path.html#path_path_join_paths
108
108
*
109
- * @param {String[] } paths An arbitrary amount of path segments.
109
+ * @param {... String } paths - An arbitrary amount of path segments.
110
110
* @returns {String } the normalized and joined path.
111
111
*/
112
112
TemplatePath . join = function ( ...paths ) {
@@ -118,7 +118,7 @@ TemplatePath.join = function (...paths) {
118
118
* Maintains a single trailing slash if the last URL path argument
119
119
* had at least one.
120
120
*
121
- * @param {String[] } urlPaths
121
+ * @param {... String } urlPaths
122
122
* @returns {String } a normalized URL path described by the given URL path segments.
123
123
*/
124
124
TemplatePath . normalizeUrlPath = function ( ...urlPaths ) {
@@ -130,7 +130,7 @@ TemplatePath.normalizeUrlPath = function (...urlPaths) {
130
130
* Joins the given path segments. Since the first path is absolute,
131
131
* the resulting path will be absolute as well.
132
132
*
133
- * @param {String[] } paths
133
+ * @param {... String } paths
134
134
* @returns {String } the absolute path described by the given path segments.
135
135
*/
136
136
TemplatePath . absolutePath = function ( ...paths ) {
@@ -182,7 +182,7 @@ TemplatePath.addLeadingDotSlashArray = function (paths) {
182
182
/**
183
183
* Adds a leading dot-slash segment to `path`.
184
184
*
185
- * @param {String } path
185
+ * @param {String } pathArg
186
186
* @returns {String }
187
187
*/
188
188
TemplatePath . addLeadingDotSlash = function ( pathArg ) {
@@ -214,8 +214,8 @@ TemplatePath.stripLeadingDotSlash = function (path) {
214
214
/**
215
215
* Determines whether a path starts with a given sub path.
216
216
*
217
- * @param {String } path A path
218
- * @param {String } subPath A path
217
+ * @param {String } path - A path
218
+ * @param {String } subPath - A path
219
219
* @returns {Boolean } whether `path` starts with `subPath`.
220
220
*/
221
221
TemplatePath . startsWithSubPath = function ( path , subPath ) {
@@ -229,8 +229,8 @@ TemplatePath.startsWithSubPath = function (path, subPath) {
229
229
* Removes the `subPath` at the start of `path` if present
230
230
* and returns the remainding path.
231
231
*
232
- * @param {String } path A path
233
- * @param {String } subPath A path
232
+ * @param {String } path - A path
233
+ * @param {String } subPath - A path
234
234
* @returns {String } the `path` without `subPath` at the start of it.
235
235
*/
236
236
TemplatePath . stripLeadingSubPath = function ( path , subPath ) {
@@ -245,15 +245,15 @@ TemplatePath.stripLeadingSubPath = function (path, subPath) {
245
245
} ;
246
246
247
247
/**
248
- * @param {String } path A path
248
+ * @param {String } path - A path
249
249
* @returns {Boolean } whether `path` points to an existing directory.
250
250
*/
251
251
TemplatePath . isDirectorySync = function ( path ) {
252
252
return fs . existsSync ( path ) && fs . statSync ( path ) . isDirectory ( ) ;
253
253
} ;
254
254
255
255
/**
256
- * @param {String } path A path
256
+ * @param {String } path - A path
257
257
* @returns {Boolean } whether `path` points to an existing directory.
258
258
*/
259
259
TemplatePath . isDirectory = async function ( path ) {
@@ -327,7 +327,7 @@ TemplatePath.getExtension = function (thePath) {
327
327
* Removes the extension from a path.
328
328
*
329
329
* @param {String } path
330
- * @param {String } extension
330
+ * @param {String } [ extension]
331
331
* @returns {String }
332
332
*/
333
333
TemplatePath . removeExtension = function ( path , extension = undefined ) {
@@ -349,6 +349,7 @@ TemplatePath.removeExtension = function (path, extension = undefined) {
349
349
* e.g. `./my/dir/` stays `./my/dir/` on *nix and becomes `.\\my\\dir\\` on Windows
350
350
*
351
351
* @param {String } filePath
352
+ * @param {String } [sep="/"]
352
353
* @returns {String } a file path with the correct local directory separator.
353
354
*/
354
355
TemplatePath . normalizeOperatingSystemFilePath = function ( filePath , sep = "/" ) {
@@ -361,6 +362,7 @@ TemplatePath.normalizeOperatingSystemFilePath = function (filePath, sep = "/") {
361
362
* e.g. `./my/dir/` stays `./my/dir/` on *nix and becomes `.\\my\\dir\\` on Windows
362
363
*
363
364
* @param {String } filePath
365
+ * @param {String } [sep="/"]
364
366
* @returns {String } a file path with the correct local directory separator.
365
367
*/
366
368
TemplatePath . standardizeFilePath = function ( filePath , sep = "/" ) {
0 commit comments