Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
exotic / src / types / collection / fromArrayToSet.ts
Size: Mime:
/**
 * 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