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