lib/value-mapper.js
function (val) {
    // Keep track of aliases used
    var aliasesUsed = [],
        aliasesNotFound = [],
        that = this;

    // Map the value through the middlewares
    var middlewares = this.middlewares;
    middlewares.forEach(function mapMiddlewareValue (fn) {
      // Process the value through middleware
      var valObj = fn.call(that, val);

      // Save the results
      val = valObj.value;
      aliasesUsed.push.apply(aliasesUsed, valObj.aliasesUsed);
      aliasesNotFound.push.apply(aliasesNotFound, valObj.aliasesNotFound);
    });

    // Return the value
    return {
      value: val,
      aliasesUsed: aliasesUsed,
      aliasesNotFound: aliasesNotFound
    };
  }
function (val) {
    // Keep track of aliases used
    var aliasesUsed = [],
        aliasesNotFound = [],
        that = this;

    // Map the value through the middlewares
    var middlewares = this.middlewares;
    middlewares.forEach(function mapMiddlewareValue (fn) {
      // Process the value through middleware
      var valObj = fn.call(that, val);

      // Save the results
      val = valObj.value;
      aliasesUsed.push.apply(aliasesUsed, valObj.aliasesUsed);
      aliasesNotFound.push.apply(aliasesNotFound, valObj.aliasesNotFound);
    });

    // Return the value
    return {
      value: val,
      aliasesUsed: aliasesUsed,
      aliasesNotFound: aliasesNotFound
    };
  }
function ( val ) { // Keep track of aliases used var aliasesUsed = [ ] , aliasesNotFound = [ ] , that = this ; // Map the value through the middlewares var middlewares = this . middlewares ; middlewares . forEach ( function mapMiddlewareValue ( fn ) { // Process the value through middleware var valObj = fn . call ( that , val ) ; // Save the results val = valObj . value ; aliasesUsed . push . apply ( aliasesUsed , valObj . aliasesUsed ) ; aliasesNotFound . push . apply ( aliasesNotFound , valObj . aliasesNotFound ) ; } ) ; // Return the value return { value : val , aliasesUsed : aliasesUsed , aliasesNotFound : aliasesNotFound } ; }
Resolve values of values via middleware
Resolve values of values via middleware