Skip to content

Exposed .escape() functions exposes but don't cover the MySQL original typing #3030

Closed
@ScrapsPrograms

Description

@ScrapsPrograms

During some experimentation, I found that the type definition of the .escape(value: any) function isn't correct. Currently, for all locations, it's described as .escape(value: any): string.

The function exposed by the package, however, has a different interface: .escape(value: any, stringifyObjects: boolean, timeZone: string | "local"). From what I've found so far, this applies only to the loose exposed function, not to any of the class defined methods, which seem to wrap this function by abstraction.

For reference, the classes with a .escape(value: any) method are in Pool and Connection.

I'm willing to put a PR for this, if you agree the typing information should be updated, or if an abstraction should be applied to the loose exposed function similar to the class defined .escape methods.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions