Вход Регистрация
Файл: error-kitty/node_modules/express/lib/router/match.js
Строк: 20
<?php
/**
 * Expose `Layer`.
 */

module.exports Match;

function 
Match(layerpathparams) {
  
this.layer layer;
  
this.params = {};
  
this.path path || '';

  if (!
params) {
    return 
this;
  }

  var 
keys layer.keys;
  var 
0;
  var 
prop;
  var 
key;
  var 
val;

  for (var 
0params.lengthi++) {
    
key keys[i];
    
val decode_param(params[i]);
    
prop key
      
key.name
      
n++;

    
this.params[prop] = val;
  }

  return 
this;
};

/**
 * Decode param value.
 *
 * @param {string} val
 * @return {string}
 * @api private
 */

function decode_param(val){
  if (
typeof val !== 'string') {
    return 
val;
  }

  try {
    return 
decodeURIComponent(val);
  } catch (
e) {
    var 
err = new TypeError("Failed to decode param '" val "'");
    
err.status 400;
    throw 
err;
  }
}
?>
Онлайн: 4
Реклама