src/entitykeys.js
function(mapping, keys) {
  assert(keys instanceof Array, 'keys must be an array');
  assert(keys.length > 0, 'CompositeKey needs at least one key');

  // Set keys
  this.keys = keys;

  // Set key types
  this.types = [];
  for (var i = 0; i < keys.length; i++) {
    assert(mapping[keys[i]], 'key \'' + keys[i] + '\' is not defined in mapping');
    this.types[i] = mapping[keys[i]];
  }

  // Set covers
  this.covers = keys;
}
function(mapping, keys) {
  assert(keys instanceof Array, 'keys must be an array');
  assert(keys.length > 0, 'CompositeKey needs at least one key');

  // Set keys
  this.keys = keys;

  // Set key types
  this.types = [];
  for (var i = 0; i < keys.length; i++) {
    assert(mapping[keys[i]], 'key \'' + keys[i] + '\' is not defined in mapping');
    this.types[i] = mapping[keys[i]];
  }

  // Set covers
  this.covers = keys;
}
function ( mapping , keys ) { assert ( keys instanceof Array , 'keys must be an array' ) ; assert ( keys . length > 0 , 'CompositeKey needs at least one key' ) ; // Set keys this . keys = keys ; // Set key types this . types = [ ] ; for ( var i = 0 ; i < keys . length ; i ++ ) { assert ( mapping [ keys [ i ] ] , 'key \'' + keys [ i ] + '\' is not defined in mapping' ) ; this . types [ i ] = mapping [ keys [ i ] ] ; } // Set covers this . covers = keys ; }
Construct a CompositeKey
Construct a CompositeKey