Skip to content

Commit 56ce9f6

Browse files
committed
Fix mapper spec
1 parent aa2d5e3 commit 56ce9f6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/spec.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,16 @@ module.exports = function (options) {
8787
title: 'Ticado',
8888
type: 'string',
8989
mapper: {
90-
write: value => (value === true ? 'S' : 'N'),
91-
read: value => value === 'S'
90+
write: value => {
91+
if (value === true) return 'S'
92+
if (value === false) return 'N'
93+
return value
94+
},
95+
read: value => {
96+
if (value === 'S') return true
97+
if (value === 'N') return false
98+
return value
99+
}
92100
}
93101
}
94102
entityCadastro = entity('CADASTRO', schema).useTimestamps(

0 commit comments

Comments
 (0)