mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
402 B
16 lines
402 B
'use strict'
|
|
|
|
/* global appdata, appconfig */
|
|
|
|
const _ = require('lodash')
|
|
|
|
module.exports = {
|
|
sanitizeCommitUser (user) {
|
|
let wlist = new RegExp('[^a-zA-Z0-9-_.\',& ' + appdata.regex.cjk + appdata.regex.arabic + ']', 'g')
|
|
return {
|
|
name: _.chain(user.name).replace(wlist, '').trim().value(),
|
|
email: appconfig.git.showUserEmail ? user.email : appconfig.git.serverEmail
|
|
}
|
|
}
|
|
}
|