New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@httpie/set

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@httpie/set

An Array-aligned Set class and the one JavaScript should have shipped

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
1
Created
Source


Set

An Array-aligned Set class and the one JavaScript should have shipped


Installation · Docs · Usage



Latest Version Monthly downloads

Follow @eldorplus and @httpiejs for updates!

Introduction

The @httpie/set package provides an improved Set implementation.

  • aligned with the Array class instead of Map
  • provides helpful methods like .map(callback), .filter(callback), .find(callback), .isEmpty(), and many more.
  • compares values for deep equality and not reference
  • it’s the Set class JavaScript should have shipped

Installation

npm i @httpie/set

Resources

Quick Usage Overview

Using @httpie/set is pretty straightforward. The package exports a Set class providing all methods to interact with the set.

const Set = require('@httpie/set')

const users = new Set()

users.isEmpty() // true

users
  .add({ id: 1, name: 'Marcus' })
  .add({ id: 2, name: 'Norman' })
  .add({ id: 3, name: 'Christian' })

users.isNotEmpty() // true

const usernames = users.map(user => {
  return user.name
})
// [ 'Marcus', 'Norman', 'Christian' ]

const marcus = users.find(user => {
  return user.name === 'Marcus'
})
// { id: 1, name: 'Marcus' }

Contributing

Do you miss a function? We very much appreciate your contribution! Please send in a pull request 😊

  • Create a fork
  • Create your feature branch: git checkout -b my-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request 🚀

License

MIT © Httpie

httpiejs.com  ·  GitHub @httpie  ·  Twitter @httpiejs

Keywords

httpie

FAQs

Package last updated on 22 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts