Skip to content

Create 2 options to decodeStrings without validateFileName #66

@FabriceGaudin

Description

@FabriceGaudin

Thank you for this lib, it works great !
In my use case, i'd like to ignore the "invalid characters in fileName" errors, to automatically convert backslashes to forward slashes.
I read that @thejoshwolfe recommands using decodeStrings: false here: #54 (comment)
But as he mentions it:

You'll have to do some extra work to do UTF-8 vs CP437 decoding

It's too bad to do this extra work whereas the lib can do it, and this work isn't directly linked to the validation step. I'd like to create 2 different options:

  • autoValidateFileName: default true, if false, the method validateFileName isn't called
  • decodeStrings: default true, if false, don't decode Buffer.

Or if my use case is not so specific, maybe we can add an option authorizeBackslash to avoid throwing an error in validateFileName.

What do you think about it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions