Skip to content

Conversation

mdwheele
Copy link

@mdwheele mdwheele commented Oct 18, 2024

Hello!

💁 This PR adds a method to retrieve a subset of IP addresses within a block based on offset.

The primary reasoning for me putting this together was that in order to do this, I was having to either chain calls to .next(1) over and over or use .forEach to build a list of the IPs I needed based on offset.

Alternative Approaches

  • Instead of implementing .slice, we could instead provide an accessor that returns an array of all IP addresses within a block. With this, the client can apply whatever transform they want.

Remaining work

  • Add tests for "un-happy paths" (what happens when I slice out of range?)
  • Update documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant