build/Entity.js
function _valueToJson(property, value) {
    if (_neo4jDriver.v1.isInt(value)) {
        return value.toNumber();
    } else if (_neo4jDriver.v1.temporal.isDate(value) || _neo4jDriver.v1.temporal.isDateTime(value) || _neo4jDriver.v1.temporal.isTime(value) || _neo4jDriver.v1.temporal.isLocalDateTime(value) || _neo4jDriver.v1.temporal.isLocalTime(value) || _neo4jDriver.v1.temporal.isDuration(value)) {
        return value.toString();
    } else if (_neo4jDriver.v1.spatial.isPoint(value)) {
        switch (value.srid.toString()) {
            // SRID values: @https://neo4j.com/docs/developer-manual/current/cypher/functions/spatial/
            case '4326':
                // WGS 84 2D
                return { longitude: value.x, latitude: value.y };

            case '4979':
                // WGS 84 3D
                return { longitude: value.x, latitude: value.y, height: value.z };

            case '7203':
                // Cartesian 2D
                return { x: value.x, y: value.y };

            case '9157':
                // Cartesian 3D
                return { x: value.x, y: value.y, z: value.z };
        }
    }

    return value;
}
function _valueToJson(property, value) {
    if (_neo4jDriver.v1.isInt(value)) {
        return value.toNumber();
    } else if (_neo4jDriver.v1.temporal.isDate(value) || _neo4jDriver.v1.temporal.isDateTime(value) || _neo4jDriver.v1.temporal.isTime(value) || _neo4jDriver.v1.temporal.isLocalDateTime(value) || _neo4jDriver.v1.temporal.isLocalTime(value) || _neo4jDriver.v1.temporal.isDuration(value)) {
        return value.toString();
    } else if (_neo4jDriver.v1.spatial.isPoint(value)) {
        switch (value.srid.toString()) {
            // SRID values: @https://neo4j.com/docs/developer-manual/current/cypher/functions/spatial/
            case '4326':
                // WGS 84 2D
                return { longitude: value.x, latitude: value.y };

            case '4979':
                // WGS 84 3D
                return { longitude: value.x, latitude: value.y, height: value.z };

            case '7203':
                // Cartesian 2D
                return { x: value.x, y: value.y };

            case '9157':
                // Cartesian 3D
                return { x: value.x, y: value.y, z: value.z };
        }
    }

    return value;
}
function _valueToJson ( property , value ) { if ( _neo4jDriver . v1 . isInt ( value ) ) { return value . toNumber ( ) ; } else if ( _neo4jDriver . v1 . temporal . isDate ( value ) || _neo4jDriver . v1 . temporal . isDateTime ( value ) || _neo4jDriver . v1 . temporal . isTime ( value ) || _neo4jDriver . v1 . temporal . isLocalDateTime ( value ) || _neo4jDriver . v1 . temporal . isLocalTime ( value ) || _neo4jDriver . v1 . temporal . isDuration ( value ) ) { return value . toString ( ) ; } else if ( _neo4jDriver . v1 . spatial . isPoint ( value ) ) { switch ( value . srid . toString ( ) ) { // SRID values: @https://neo4j.com/docs/developer-manual/current/cypher/functions/spatial/ case '4326' : // WGS 84 2D return { longitude : value . x , latitude : value . y } ; case '4979' : // WGS 84 3D return { longitude : value . x , latitude : value . y , height : value . z } ; case '7203' : // Cartesian 2D return { x : value . x , y : value . y } ; case '9157' : // Cartesian 3D return { x : value . x , y : value . y , z : value . z } ; } } return value ; }
Convert a raw property into a JSON friendly format

@param  {Property}   property
@param  {Mixed}      value
@return {Mixed}
Convert a raw property into a JSON friendly format