lib/fakery.js
function(attr, lazyContext) {
    var resolved;

    if (helpers.isArray(attr)) {
        resolved = helpers.map(attr, function(item) {
            return resolve(item, lazyContext);
        });
    } else if (helpers.isFunction(attr)) {
        if (attr._lazy === true) {
            if (lazyContext != null) resolved = attr(lazyContext);
        } else {
            resolved = attr();
        }
    } else if (helpers.isObject(attr)) {
        resolved = {};
        helpers.each(attr, function(value, key) {
            resolved[key] = resolve(value, lazyContext);
        });
    } else {
        resolved = attr;
    }

    return resolved;
}
function(attr, lazyContext) {
    var resolved;

    if (helpers.isArray(attr)) {
        resolved = helpers.map(attr, function(item) {
            return resolve(item, lazyContext);
        });
    } else if (helpers.isFunction(attr)) {
        if (attr._lazy === true) {
            if (lazyContext != null) resolved = attr(lazyContext);
        } else {
            resolved = attr();
        }
    } else if (helpers.isObject(attr)) {
        resolved = {};
        helpers.each(attr, function(value, key) {
            resolved[key] = resolve(value, lazyContext);
        });
    } else {
        resolved = attr;
    }

    return resolved;
}
function ( attr , lazyContext ) { var resolved ; if ( helpers . isArray ( attr ) ) { resolved = helpers . map ( attr , function ( item ) { return resolve ( item , lazyContext ) ; } ) ; } else if ( helpers . isFunction ( attr ) ) { if ( attr . _lazy === true ) { if ( lazyContext != null ) resolved = attr ( lazyContext ) ; } else { resolved = attr ( ) ; } } else if ( helpers . isObject ( attr ) ) { resolved = { } ; helpers . each ( attr , function ( value , key ) { resolved [ key ] = resolve ( value , lazyContext ) ; } ) ; } else { resolved = attr ; } return resolved ; }
Resolves an attribute to a value, depending on its type.

`lazyContext` is passed to this method during the second pass where
lazy attributes are supposed to get resolved.

This is a private method.

Params
- attr: the factory attribute to resolve
- lazyContext: the context for lazy attributes, which is a hash of all
resolved attributes during the first run
Resolves an attribute to a value depending on its type .