lib/config-generator.js
function(node) {
        var self = this;

        var i;

        if (node.type === 'Literal') {
            return node.value;
        } else if (node.type === 'ObjectExpression') {
            var obj = {};

            for (i = 0; i < node.properties.length; i++) {
                var property = node.properties[i];

                obj[property.key.name] = self._extractValue(property.value);
            }

            return obj;
        } else if (node.type === 'ArrayExpression') {
            var arr = [];

            for (i = 0; i < node.elements.length; i++) {
                arr.push(self._extractValue(node.elements[i]));
            }

            return arr;

        } else if (node.type === 'FunctionExpression') {
            return recast.print(node, {
                wrapColumn: Number.Infinity
            }).code;
        }
    }
function(node) {
        var self = this;

        var i;

        if (node.type === 'Literal') {
            return node.value;
        } else if (node.type === 'ObjectExpression') {
            var obj = {};

            for (i = 0; i < node.properties.length; i++) {
                var property = node.properties[i];

                obj[property.key.name] = self._extractValue(property.value);
            }

            return obj;
        } else if (node.type === 'ArrayExpression') {
            var arr = [];

            for (i = 0; i < node.elements.length; i++) {
                arr.push(self._extractValue(node.elements[i]));
            }

            return arr;

        } else if (node.type === 'FunctionExpression') {
            return recast.print(node, {
                wrapColumn: Number.Infinity
            }).code;
        }
    }
function ( node ) { var self = this ; var i ; if ( node . type === 'Literal' ) { return node . value ; } else if ( node . type === 'ObjectExpression' ) { var obj = { } ; for ( i = 0 ; i < node . properties . length ; i ++ ) { var property = node . properties [ i ] ; obj [ property . key . name ] = self . _extractValue ( property . value ) ; } return obj ; } else if ( node . type === 'ArrayExpression' ) { var arr = [ ] ; for ( i = 0 ; i < node . elements . length ; i ++ ) { arr . push ( self . _extractValue ( node . elements [ i ] ) ) ; } return arr ; } else if ( node . type === 'FunctionExpression' ) { return recast . print ( node , { wrapColumn : Number . Infinity } ) . code ; } }
Extracts the value from a jsstana node. The value may be
Literal, ObjectExpression, ArrayExpression or FunctionExpression.

@method _extractValue
@protected
@param {Object} node jsstana node which should be processed
@return {String} The extracted value from the node
Extracts the value from a jsstana node . The value may be Literal ObjectExpression ArrayExpression or FunctionExpression .