Update common.js (#5895)
typo Co-authored-by: Ylian Saint-Hilaire <ysainthilaire@hotmail.com>
tschettervictor committed
Mar 3, 2024 at 18:50 UTC
3ffc92e9171902c090532236501eafac8c000db0
1 file changed
+2
-2
common.js
+2
-2
@@ -155,12 +155,12 @@ module.exports.objKeysToLower = function (obj, exceptions, parent) {
155
return obj;
156
};
157
158
-// Escape and unescape feild names so there are no invalid characters for MongoDB
158
+// Escape and unescape field names so there are no invalid characters for MongoDB
159
module.exports.escapeFieldName = function (name) { if ((name.indexOf('%') == -1) && (name.indexOf('.') == -1) && (name.indexOf('$') == -1)) return name; return name.split('%').join('%25').split('.').join('%2E').split('$').join('%24'); };
160
module.exports.unEscapeFieldName = function (name) { if (name.indexOf('%') == -1) return name; return name.split('%2E').join('.').split('%24').join('$').split('%25').join('%'); };
161
162
// Escape all links, SSH and RDP usernames
163
-// This is required for databases like NeDB that don't accept "." as part of a feild name.
163
+// This is required for databases like NeDB that don't accept "." as part of a field name.
164
module.exports.escapeLinksFieldNameEx = function (docx) { if ((docx.links == null) && (docx.ssh == null) && (docx.rdp == null)) { return docx; } return module.exports.escapeLinksFieldName(docx); };
165
module.exports.escapeLinksFieldName = function (docx) {
166
var doc = Object.assign({}, docx);