/**
 * Array utilities
 * 
 * @author Pierre HUBERT
 */

/**
 * Find the key matching a given value in an object
 * 
 * @param object Object to search in
 * @param value The value to search for
 * @returns Matching key, or null if not found
 */
export function findKey(object: Object, value: any): string {
	for (const key in object) {
		if (!object.hasOwnProperty(key))
			continue;
		
		if(object[key] == value)
			return key;
	}

	return null;
}