Merge pull request #1 from Barryrowe/file-path-end-slash-patch
Append trailingSlash if not present on path param
This commit is contained in:
commit
9d200e7020
@ -50,7 +50,11 @@ export class File {
|
|||||||
if ((/^\//.test(dir))) {
|
if ((/^\//.test(dir))) {
|
||||||
rejectFn('directory cannot start with \/');
|
rejectFn('directory cannot start with \/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(/\/$/.test(noSlash))) {
|
||||||
|
path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var directory = path + dir;
|
var directory = path + dir;
|
||||||
|
|
||||||
@ -351,6 +355,10 @@ export class File {
|
|||||||
rejectFn('file cannot start with \/');
|
rejectFn('file cannot start with \/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(/\/$/.test(noSlash))) {
|
||||||
|
path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var directory = path + file;
|
var directory = path + file;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user