/**
 * Returns an array of keys of an object.
 * @param object - The object to get keys from.
 * @returns An array of keys of the object.
 */
export const getKeys = object => Object.keys(object);

/**
 * Returns a nested object given an object and an array of keys.
 * @param nestedObj - The object to get the nested object from.
 * @param pathArr - The array of keys to get the nested object.
 * @returns The nested object.
 */
export const getNestedObject = (nestedObj, pathArr) => {
  return pathArr.reduce((obj, key) => obj && obj[key] !== "undefined" ? obj[key] : undefined, nestedObj);
};

/**
 * Checks if a key is a valid key of a theme.
 * @param theme - The theme to check the key against.
 * @param K - The key to check.
 * @returns True if the key is a valid key of the theme, false otherwise.
 */
export function isThemeKey(theme, K) {
  return getKeys(theme).includes(K);
}
//# sourceMappingURL=type-helpers.js.map