mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-10 15:48:27 -05:00
8 lines
291 B
JavaScript
8 lines
291 B
JavaScript
// Normalizes, decomposes, and lowercases a utf-8 string
|
|
exports.canonicalize = displayname => displayname.normalize('NFKD').toLowerCase();
|
|
|
|
exports.canonicalizeRequest =
|
|
(req, res, next) => {
|
|
req.body.username = exports.canonicalize(req.body.displayname);
|
|
next();
|
|
}; |