mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 22:20:55 +03:00
fix indentation
This commit is contained in:
@@ -6,13 +6,14 @@ const { randomBytes } = require('crypto');
|
|||||||
convict.addFormat({
|
convict.addFormat({
|
||||||
name: 'positive-int-array',
|
name: 'positive-int-array',
|
||||||
validate: (ints, schema) => {
|
validate: (ints, schema) => {
|
||||||
ints.forEach(int => {
|
for (const int of ints) {
|
||||||
if (isNaN(int) || int < 0)
|
if (isNaN(int) || int < 0)
|
||||||
throw new Error('must be a comma-separated list of positive integers')
|
throw new Error('must be a comma-separated list of positive integers')
|
||||||
})
|
}
|
||||||
|
},
|
||||||
|
coerce: (ints_str, schema) => {
|
||||||
|
return ints_str.trim().split(',').map(int_str => parseInt(int_str.trim(), 10))
|
||||||
},
|
},
|
||||||
coerce: (ints_str, schema) =>
|
|
||||||
ints_str.trim().split(',').map(int_str => parseInt(int_str.trim(), 10))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const conf = convict({
|
const conf = convict({
|
||||||
|
|||||||
Reference in New Issue
Block a user