Repository URL to install this package:
|
Version:
1.2.8 ▾
|
/**
* Object or Array into a Set
* @since 5.0.0-beta.6
* @memberOf cast
*
* @name arrayToSet
* @alias arrToSet
*
* @param {Array} array cast to Set
* @return {Set} Set(x)
*
*/
const arrayToSet = <Type>(array: Type[] | Type): Set<Type> => {
const aSet = new Set()
for (let key = 0; key < array.length; key++) aSet.add(array[key])
return aSet
}
export { arrayToSet }
export default arrayToSet