Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

"Statting" a file under a non-existant directory causes MemoryFileSystem.statSync to throw an error #19

@nathanhinish

Description

@nathanhinish

MemoryFileSystem.priotoype.meta loops through 0...n-1 entries in the split file path. Suppose, /path/to/existing/files exists but /path/to/existing/files/plus does not. Then, sending /path/to/existing/files/plus/extra causes the meta method to return null. This causes an issue in the conditional inside statSync(). When isDir() is called, it tests the type of the incoming object. But if that object is null, typeof evaluates to "object", which I believe is unintended.

I believe the fix for this is to return undefined inside MemoryFileSystem.priotoype.meta instead of null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions