/*
@param {object[]} aKeys
The type's keys
@returns {string}
The property path to the type's single key
@throws {Error}
If the type does not have a single key
162232
function getKeyPath(aKeys) {
							var vKey;

							if (aKeys && aKeys.length === 1) {
								vKey = aKeys[0];
							} else {
								throw new Error("Single key expected: " + sTypePath);
							}

							return typeof vKey === "string" ? vKey : vKey[Object.keys(vKey)[0]];
						}
1141687
function getKeys(definition){
		return definition.provides.map(function(component){
			return definition.package + '/' + component;
		}).concat(getPrimaryKey(definition));
	}
597661
function getObjectByKey(data, prop) {
    if (!prop || !~prop.indexOf('.')) return data[prop];

    var result = prop
      , structure = data;

    for (var paths = prop.split('.'), i = 0, length = paths.length; i < length; i++) {
      result = structure[+paths[i] || paths[i]];
      structure = result;
    }

    return result || data[prop];
  }
955967
function sunion(/* key-1, key-N, req*/) {
  var args = slice.call(arguments, 0)
    , req = typeof args[args.length-1] === 'object' ? args.pop() : null
    , set
    , src
    , i;
  set = new Set();
  for(i = 0;i < args.length;i++) {
    src = this.getKey(args[i], req);
    if(src === undefined) continue;
    set.sadd(src.data);
  }
  return set.data;
}
469491
function _convertPairToObject(pair) {
  var keyId = pair[0];
  var valueIds = pair[1];
  return {
    keyId: keyId,
    valueIds: valueIds
  };
}
1128240
function getKeys() {
  var result = []
  var index = -1

  forPropertyInObject(this.map, push)

  return result

  function push(value, key) {
    result[++index] = key
  }
}
384775
function baseGet(object, path) {
    path = isKey(path, object) ? [path] : castPath(path);

    var index = 0,
        length = path.length;

    while (object != null && index < length) {
      object = object[toKey(path[index++])];
    }
    return (index && index == length) ? object : undefined;
  }
1213283
function objectKeys(obj) {
  if (!obj) { return null; }

  if (Object.keys) {
    return Object.keys(obj);
  }

  var out = [];

  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      out.push(key);
    }
  }

  return out;
}
1252270
function mapKeyCodeToKey(sKeyCode) {

		// look up number in KeyCodes enum to get the string
		if (!isNaN(sKeyCode)) {
			sKeyCode = getKeyCodeStringFromNumber(sKeyCode);
		}
		if (!sKeyCode) {
			return undefined;
		}
		sKeyCode = sKeyCode.toLowerCase();
		// replace underscores with dash character such as 'ARROW_LEFT' --> 'ARROW-LEFT' and then camelize it --> 'ArrowLeft'
		sKeyCode = camelize(sKeyCode.replace(/_/g, "-"));

		// capitalize key
		var sKey = capitalize(sKeyCode);

		// remove "Digit" and "Numpad" from the resulting string as this info is present within the Location property and not the key property
		// e.g. "Digit9" --> "9"
		if (sKey.startsWith("Digit")) {
			return sKey.substring("Digit".length);
		} else if (sKey.startsWith("Numpad")) {
			sKey = sKey.substring("Numpad".length);
		}

		// special handling where KeyCodes[sKeyCode] does not match
		// e.g. KeyCodes.BREAK --> 'Pause' instead of 'Break'
		switch (sKey) {
			case "Break": return "Pause";
			case "Space": return " ";
			case "Print": return "PrintScreen";
			case "Windows": return "Meta";
			case "Sleep": return "Standby";
			case "TurnOff": return "PowerOff";
			case "Asterisk": return "*";
			case "Plus": return "+";
			case "Minus": return "-";
			case "Comma": return ",";
			case "Slash": return "/";
			case "OpenBracket": return ";";
			case "Dot": return ".";
			case "Pipe": return "|";
			case "Semicolon": return ";";
			case "Equals": return "=";
			case "SingleQUote": return "=";
			case "Backslash": return "\\";
			case "GreatAccent": return "`";
			default: return sKey;
		}
	}
317318
function getValue(item, keyOrPath) {
  const keys = keyOrPath.split('.');
  const used = [];
  while (keys.length > 0) {
    const key = keys.shift();
    used.push(key);
    if (!isValid(item[key])) {
      throw new Error(`path ${used.join('.')} is not an object`);
    }
    item = item[key];
  }
  return item[keys[0]];
}
861547
public static function findKey($aKey, $array) {
        // Check if an array is provided.
        if (is_array($array)) {
            // Loops through the array.
            foreach ($array as $key => $item) {
                // Checks if it did find the matching key. If it doesn't, it continues looping until it does,
                // or until the end of the array.
                if ($key == $aKey) {
                    return $item;
                } else {
                    $result = self::findKey($aKey, $item);
                    if ($result != false) {
                        return $result;
                    }
                }
            }
        }
        return false;
    }
553345
function asPath({ ancestors }) {
  const path = [];

  for (const { key } of ancestors) {
    if (key != null) {
      if (typeof key === 'number') {
        path.push(`[${key}]`);
      } else {
        path.push(`['${stringify(key).slice(1, -1)}']`);
      }
    }
  }

  return path.join('');
}
1369289
function getEntityPath (tableName, partitionKey, rowKey) {
  var path = '/' + tableName;

  if (typeof (partitionKey) === 'string' && typeof (rowKey) === 'string') {
    // Escape single quotes according to OData Protocol Specification: "single quotes within string literals are represented as two consecutive single quotes".
    partitionKey = partitionKey.replace(/'/g, '\'\'');
    rowKey = rowKey.replace(/'/g, '\'\'');
    path = path + '(PartitionKey=\'' + encodeURIComponent(partitionKey.toString('utf8')) + '\',RowKey=\'' + encodeURIComponent(rowKey.toString('utf8')) + '\')';
  } else {
    throw new Error(SR.INCORRECT_ENTITY_KEYS);
  }

  return path;
}
800758
function objectKeys(target, pred) {
  pred = pred || has;
  var results = [];


  for (var key in target) {
    if (pred(target, key)) {
      results.push(String(key));
    }
  }

  return results;
}
1194303
function getItemPropertyKey(itemID, propName) {
	if (itemID === undefined || propName === undefined) {
		throw new Error("itemID and propName are required for keys.getItemPropertyKey")
	}
	return 'I' + itemID + '@' + propName
}
276112
function getProp(obj, key) {
    var path = [].concat(key);
    var val = obj;
    for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {
        var pathKey = path_1[_i];
        if (val[pathKey] === undefined) {
            return undefined;
        }
        val = val[pathKey];
    }
    return val;
}
950119
function makeKey(aKey) {

        if (aKey &&
          utils.isAnArray(aKey)) {

          var keyLenght = aKey.length
            , tmpKey = []
            , index = 0
            , nValue
            , limitedKey
            , k64Cnt = keyLenght / 8
            , subkeyCnt = ROUND_SUBKEYS + 2 * ROUNDS
            , k32e = []
            , k32o = []
            , sBoxKey = []
            , i
            , j
            , offset = 0
            , q
            , A
            , B
            , subKeys = []
            , lB0
            , lB1
            , lB2
            , lB3
            , sBox = []
            , k0
            , k1
            , k2
            , k3;
          if (keyLenght < 8 ||
              keyLenght > 8 && keyLenght < 16 ||
              keyLenght > 16 && keyLenght < 24 ||
              keyLenght > 24 && keyLenght < 32) {

            for (index = 0; index < aKey.length + (8 - aKey.length); index += 1) {

              nValue = aKey[index];
              if (nValue !== undefined) {

                tmpKey.push(nValue);
              } else {

                tmpKey.push(0x00);
              }
            }
            aKey = tmpKey;
          } else if (keyLenght > 32) {

            limitedKey = [];
            for (index = 0; index < 32; index += 1) {

              limitedKey.push(aKey[index]);
            }
            aKey = limitedKey;
          }
          aKey = new Uint8Array(aKey);
          keyLenght = aKey.length;
          for (i = 0, j = k64Cnt - 1; i < 4 && offset < keyLenght; i += 1, j -= 1) {

            /*eslint-disable no-plusplus*/
            k32e[i] = aKey[offset++] & 0xFF | (aKey[offset++] & 0xFF) << 8 | (aKey[offset++] & 0xFF) << 16 | (aKey[offset++] & 0xFF) << 24;
            k32o[i] = aKey[offset++] & 0xFF | (aKey[offset++] & 0xFF) << 8 | (aKey[offset++] & 0xFF) << 16 | (aKey[offset++] & 0xFF) << 24;
            /*eslint-enable no-plusplus*/
            sBoxKey[j] = rsMDSEncode(k32e[i], k32o[i]);
          }
          for (i = q = 0; i < subkeyCnt / 2; i += 1, q += SK_STEP) {

            A = f32(k64Cnt, q, k32e);
            B = f32(k64Cnt, q + SK_BUMP, k32o);
            B = B << 8 | B >>> 24;
            A += B;
            subKeys[2 * i] = A;
            A += B;
            subKeys[2 * i + 1] = A << SK_ROTL | A >>> 32 - SK_ROTL;
          }
          k0 = sBoxKey[0];
          k1 = sBoxKey[1];
          k2 = sBoxKey[2];
          k3 = sBoxKey[3];
          for (i = 0; i < 256; i += 1) {

            lB0 = lB1 = lB2 = lB3 = i;
            switch (k64Cnt & 3) {

              case 1:
                sBox[2 * i] = MDS[0][P[P_01][lB0] & 0xFF ^ b0(k0)];
                sBox[2 * i + 1] = MDS[1][P[P_11][lB1] & 0xFF ^ b1(k0)];
                sBox[0x200 + 2 * i] = MDS[2][P[P_21][lB2] & 0xFF ^ b2(k0)];
                sBox[0x200 + 2 * i + 1] = MDS[3][P[P_31][lB3] & 0xFF ^ b3(k0)];
                break;

              case 0:
                lB0 = P[P_04][lB0] & 0xFF ^ b0(k3);
                lB1 = P[P_14][lB1] & 0xFF ^ b1(k3);
                lB2 = P[P_24][lB2] & 0xFF ^ b2(k3);
                lB3 = P[P_34][lB3] & 0xFF ^ b3(k3);
                /* falls through */

              case 3:
                lB0 = P[P_03][lB0] & 0xFF ^ b0(k2);
                lB1 = P[P_13][lB1] & 0xFF ^ b1(k2);
                lB2 = P[P_23][lB2] & 0xFF ^ b2(k2);
                lB3 = P[P_33][lB3] & 0xFF ^ b3(k2);
                /* falls through */

              case 2:
                sBox[2 * i] = MDS[0][P[P_01][P[P_02][lB0] & 0xFF ^ b0(k1)] & 0xFF ^ b0(k0)];
                sBox[2 * i + 1] = MDS[1][P[P_11][P[P_12][lB1] & 0xFF ^ b1(k1)] & 0xFF ^ b1(k0)];
                sBox[0x200 + 2 * i] = MDS[2][P[P_21][P[P_22][lB2] & 0xFF ^ b2(k1)] & 0xFF ^ b2(k0)];
                sBox[0x200 + 2 * i + 1] = MDS[3][P[P_31][P[P_32][lB3] & 0xFF ^ b3(k1)] & 0xFF ^ b3(k0)];
                break;

              default:
            }
          }

          return [sBox, subKeys];
        }

        throw 'key passed is undefined or not an array';
      }