11import attempt from 'lodash/attempt' ;
22import isError from 'lodash/isError' ;
33import take from 'lodash/take' ;
4+ import trim from 'lodash/trim' ;
45import unset from 'lodash/unset' ;
56import { basename , dirname } from 'path' ;
67import { v4 as uuid } from 'uuid' ;
@@ -15,7 +16,6 @@ import { isNotEmpty } from '@staticcms/core/lib/util/string.util';
1516import AssetProxy from '@staticcms/core/valueObjects/AssetProxy' ;
1617import AuthenticationPage from './AuthenticationPage' ;
1718
18- import type { WorkflowStatus } from '@staticcms/core/constants/publishModes' ;
1919import type {
2020 BackendClass ,
2121 BackendEntry ,
@@ -29,6 +29,7 @@ import type {
2929 UnpublishedEntry ,
3030 User ,
3131} from '@staticcms/core' ;
32+ import type { WorkflowStatus } from '@staticcms/core/constants/publishModes' ;
3233
3334type RepoFile = { path : string ; content : string | AssetProxy ; isDirectory ?: boolean } ;
3435type RepoTree = { [ key : string ] : RepoFile | RepoTree } ;
@@ -289,14 +290,14 @@ export default class TestBackend implements BackendClass {
289290 }
290291 const files = getFolderFiles (
291292 window . repoFiles ,
292- mediaFolder . split ( '/' ) [ 0 ] ,
293+ trim ( mediaFolder , '/' ) . split ( '/' ) [ 0 ] ,
293294 '' ,
294295 100 ,
295296 undefined ,
296297 undefined ,
297298 folderSupport ,
298299 ) . filter ( f => {
299- return dirname ( f . path ) === mediaFolder ;
300+ return dirname ( f . path ) === trim ( mediaFolder , '/' ) ;
300301 } ) ;
301302
302303 return files . map ( f => ( {
0 commit comments