Skip to content

Commit

Permalink
Split by path better
Browse files Browse the repository at this point in the history
  • Loading branch information
SevInf committed May 14, 2024
1 parent aef4f14 commit b214d77
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import path from 'node:path'

import { createFileNameToKeyMapper, FileNameToKeyMapper } from './caseSensitivity'
import { CaseSensitivityOptions, FilesResolver, FsEntryType } from './types'

Expand Down Expand Up @@ -58,7 +56,7 @@ export class InMemoryFilesResolver implements FilesResolver {
}

private getInMemoryContent(absolutePath: string): InMemoryTree | string | undefined {
const keys = absolutePath.split(path.sep).map((fileName) => this._fileNameToKey(fileName))
const keys = absolutePath.split(/[\\/]/).map((fileName) => this._fileNameToKey(fileName))
let currentRecord: InMemoryTree | string | undefined = this._tree
for (const key of keys) {
if (typeof currentRecord !== 'object') {
Expand Down

0 comments on commit b214d77

Please sign in to comment.