dist/spyfu-vuex-helpers.js
function parseMappings(obj) {
        var mapping = {};

        // throw a helpful error when mapTwoWayState is mixed up with mapState
        if (Array.isArray(obj)) {
            error('Invalid arguments for mapTwoWayState. State mapping must be an object in { \'path.to.state\': \'mutationName\' } format.');
        }

        Object.keys(obj).forEach(function (key) {
            var value = obj[key];
            var vmKey = key.slice(key.lastIndexOf('.') + 1);

            if (typeof value === 'string') {
                mapping[vmKey] = { key: key, mutation: value };
            } else {
                mapping[vmKey] = { key: value.key, mutation: value.mutation };
            }
        });

        return mapping;
    }
function parseMappings(obj) {
        var mapping = {};

        // throw a helpful error when mapTwoWayState is mixed up with mapState
        if (Array.isArray(obj)) {
            error('Invalid arguments for mapTwoWayState. State mapping must be an object in { \'path.to.state\': \'mutationName\' } format.');
        }

        Object.keys(obj).forEach(function (key) {
            var value = obj[key];
            var vmKey = key.slice(key.lastIndexOf('.') + 1);

            if (typeof value === 'string') {
                mapping[vmKey] = { key: key, mutation: value };
            } else {
                mapping[vmKey] = { key: value.key, mutation: value.mutation };
            }
        });

        return mapping;
    }
function parseMappings ( obj ) { var mapping = { } ; // throw a helpful error when mapTwoWayState is mixed up with mapState if ( Array . isArray ( obj ) ) { error ( 'Invalid arguments for mapTwoWayState. State mapping must be an object in { \'path.to.state\': \'mutationName\' } format.' ) ; } Object . keys ( obj ) . forEach ( function ( key ) { var value = obj [ key ] ; var vmKey = key . slice ( key . lastIndexOf ( '.' ) + 1 ) ; if ( typeof value === 'string' ) { mapping [ vmKey ] = { key : key , mutation : value } ; } else { mapping [ vmKey ] = { key : value . key , mutation : value . mutation } ; } } ) ; return mapping ; }
determine our key and mutation values
determine our key and mutation values