File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,18 @@ export function nativeToCypher (x) {
13
13
if ( Number . isInteger ( x ) ) {
14
14
return valueResponse ( 'CypherInt' , x )
15
15
}
16
- break
16
+ return valueResponse ( 'CypherFloat' , x )
17
17
case 'string' :
18
18
return valueResponse ( 'CypherString' , x )
19
19
case 'boolean' :
20
20
return valueResponse ( 'CypherBool' , x )
21
21
case 'object' :
22
- console . log ( x )
23
22
if ( neo4j . isInt ( x ) ) {
24
23
// TODO: Broken!!!
25
24
console . log ( x )
26
25
return valueResponse ( 'CypherInt' , x . toInt ( ) )
27
26
}
28
27
if ( Array . isArray ( x ) ) {
29
- const values = x . map ( nativeToCypher )
30
28
return valueResponse ( 'CypherList' , values )
31
29
}
32
30
if ( x instanceof neo4j . types . Node ) {
@@ -61,9 +59,13 @@ export function cypherToNative (c) {
61
59
case 'CypherInt' :
62
60
return value
63
61
case 'CypherFloat' :
64
- return value + 0.0
62
+ return value
65
63
case 'CypherNull' :
66
64
return value
65
+ case 'CypherBool' :
66
+ return value
67
+ case 'CypherList' :
68
+ return value . map ( cypherToNative )
67
69
}
68
70
console . log ( `Type ${ name } is not handle by cypherToNative` , c )
69
71
const err = 'Unable to convert ' + c + ' to native type'
You can’t perform that action at this time.
0 commit comments