Satisfy eslint rule no-useless-escape

This commit is contained in:
witzig 2017-06-15 21:44:54 +02:00
parent 80aca59af7
commit 830ca4f17f
2 changed files with 9 additions and 9 deletions

View file

@ -36,7 +36,7 @@ module.exports = {
function toDbKey(key) {
return key.
replace(/[^a-z0-9\-_]/gi, '').
replace(/\-+/g, '_').
replace(/-+/g, '_').
replace(/[A-Z]/g, c => '_' + c.toLowerCase()).
replace(/^_+|_+$/g, '').
replace(/_+/g, '_').
@ -50,7 +50,7 @@ function fromDbKey(key) {
prefix = '_';
}
return prefix + key.replace(/[_\-]([a-z])/g, (m, c) => c.toUpperCase());
return prefix + key.replace(/[_-]([a-z])/g, (m, c) => c.toUpperCase());
}
function convertKeys(obj, options) {