-
-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposed .escape() functions exposes but don't cover the MySQL original typing #3030
Comments
Thanks for the report, @ScrapsPrograms 🙋🏻♂️
Please, feel free to contribute 🤝 |
TLDR; I wish to move typing responsibility of directly exported I see there's a few more functions in the This should be type safe, given the implementation is literally as follows, where exports.escape = SqlString.escape;
exports.escapeId = SqlString.escapeId;
exports.format = SqlString.format;
exports.raw = SqlString.raw; |
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.The text was updated successfully, but these errors were encountered: