You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Add tests to make sure no invalid function names get exported
This commit is contained in:
@@ -21,6 +21,9 @@ var changeFunctionName = (function () {
|
||||
// that provided a functionality to add new commands to the client
|
||||
|
||||
commands.list.forEach(function (command) {
|
||||
|
||||
// Some rare Redis commands use special characters in their command name
|
||||
// Convert those to a underscore to prevent using invalid function names
|
||||
var commandName = command.replace(/(?:^([0-9])|[^a-zA-Z0-9_$])/g, '_$1');
|
||||
|
||||
// Do not override existing functions
|
||||
|
Reference in New Issue
Block a user