Skip to content

Commit e3173b1

Browse files
committed
Clearer variable name
1 parent 5eb1314 commit e3173b1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/convict/src/main.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const types = {
6565
// alias
6666
types.integer = types.int
6767

68-
const converters = new Map()
68+
const custom_converters = new Map()
6969

7070
const parsers_registry = {'*': JSON.parse}
7171

@@ -398,12 +398,11 @@ function getFormat(schema, path) {
398398
}
399399

400400
function coerce(k, v, schema, instance) {
401-
// magic coerceing
402401
const format = getFormat(schema, k)
403402

404403
if (typeof v === 'string') {
405-
if (converters.has(format)) {
406-
return converters.get(format)(v, instance, k)
404+
if (custom_converters.has(format)) {
405+
return custom_converters.get(format)(v, instance, k)
407406
}
408407
switch (format) {
409408
case 'port':
@@ -727,7 +726,7 @@ convict.addFormat = function(name, validate, coerce) {
727726
}
728727
types[name] = validate
729728
if (coerce) {
730-
converters.set(name, coerce)
729+
custom_converters.set(name, coerce)
731730
}
732731
}
733732

0 commit comments

Comments
 (0)