build/Services/WriteUtils.js
function splitProperties(mode, model, properties) {
    var merge_on = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];

    var inline = {};
    var set = {};
    var on_create = {};
    var on_match = {};

    // Calculate Set Properties
    model.properties().forEach(function (property) {
        var name = property.name();

        // Skip if not set
        if (!properties.hasOwnProperty(name)) {
            return;
        }

        var value = (0, _Entity.valueToCypher)(property, properties[name]);

        // If mode is create, go ahead and set everything
        if (mode == 'create') {
            inline[name] = value;
        } else if (merge_on.indexOf(name) > -1) {
            inline[name] = value;
        }

        // Only set protected properties on creation
        else if (property.protected() || property.primary()) {
                on_create[name] = value;
            }

            // Read-only property?
            else if (!property.readonly()) {
                    set[name] = value;
                }
    });

    return {
        inline: inline,
        on_create: on_create,
        on_match: on_match,
        set: set
    };
}
function splitProperties(mode, model, properties) {
    var merge_on = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];

    var inline = {};
    var set = {};
    var on_create = {};
    var on_match = {};

    // Calculate Set Properties
    model.properties().forEach(function (property) {
        var name = property.name();

        // Skip if not set
        if (!properties.hasOwnProperty(name)) {
            return;
        }

        var value = (0, _Entity.valueToCypher)(property, properties[name]);

        // If mode is create, go ahead and set everything
        if (mode == 'create') {
            inline[name] = value;
        } else if (merge_on.indexOf(name) > -1) {
            inline[name] = value;
        }

        // Only set protected properties on creation
        else if (property.protected() || property.primary()) {
                on_create[name] = value;
            }

            // Read-only property?
            else if (!property.readonly()) {
                    set[name] = value;
                }
    });

    return {
        inline: inline,
        on_create: on_create,
        on_match: on_match,
        set: set
    };
}
function splitProperties ( mode , model , properties ) { var merge_on = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : [ ] ; var inline = { } ; var set = { } ; var on_create = { } ; var on_match = { } ; // Calculate Set Properties model . properties ( ) . forEach ( function ( property ) { var name = property . name ( ) ; // Skip if not set if ( ! properties . hasOwnProperty ( name ) ) { return ; } var value = ( 0 , _Entity . valueToCypher ) ( property , properties [ name ] ) ; // If mode is create, go ahead and set everything if ( mode == 'create' ) { inline [ name ] = value ; } else if ( merge_on . indexOf ( name ) > - 1 ) { inline [ name ] = value ; } // Only set protected properties on creation else if ( property . protected ( ) || property . primary ( ) ) { on_create [ name ] = value ; } // Read-only property? else if ( ! property . readonly ( ) ) { set [ name ] = value ; } } ) ; return { inline : inline , on_create : on_create , on_match : on_match , set : set } ; }
Split properties into

@param  {String}  mode        'create' or 'merge'
@param  {Model}   model        Model to merge on
@param  {Object}  properties   Map of properties
@param  {Array}   merge_on     Array of properties explicitly stated to merge on
@return {Object}               { inline, set, on_create, on_match }
Split properties into