This commit is contained in:
syuilo
2017-10-07 03:36:46 +09:00
parent f89c3af982
commit 6a5c6280ff
19 changed files with 150 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ module.exports = (params, user, app, isSecure) => new Promise(async (res, rej) =
const [data, dataError] = $(params.data).optional.object()
.pipe(obj => {
const hasInvalidData = Object.entries(obj).some(([k, v]) =>
$(k).string().match(/^[a-z_]+$/).isNg() && $(v).string().isNg());
$(k).string().match(/^[a-z_]+$/).nok() && $(v).string().nok());
return !hasInvalidData;
}).$;
if (dataError) return rej('invalid data param');