Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

obliterator

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obliterator - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

foreach.js

6

index.js

@@ -13,5 +13,9 @@ /**

filter: require('./filter.js'),
forEach: require('./foreach.js'),
map: require('./map.js'),
match: require('./match.js'),
permutations: require('./permutations.js'),
powerSet: require('./power-set.js')
powerSet: require('./power-set.js'),
range: require('./range.js'),
split: require('./split.js')
};

2

package.json
{
"name": "obliterator",
"version": "1.2.0",
"version": "1.2.1",
"description": "Higher order iterator library for JavaScript.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -27,5 +27,8 @@ [![Build Status](https://travis-ci.org/Yomguithereal/obliterator.svg)](https://travis-ci.org/Yomguithereal/obliterator)

* [filter](#filter)
* [forEach](#foreach)
* [map](#map)
* [match](#match)
* [permutations](#permutations)
* [powerSet](#powerSet)
* [split](#split)

@@ -130,2 +133,18 @@ ## Iterator

## forEach
Helper function that can be used to iterate easily over the given iterator.
```js
import forEach from 'obliterator/foreach';
// Or
import {forEach} from 'obliterator';
const set = new Set(['apple', 'banana']);
forEach(set.values(), (value, i) => {
console.log(i, value);
});
```
## map

@@ -152,2 +171,19 @@

## match
Function returning an iterator over the matches of a given regex applied to the target string.
```js
import match from 'obliterator/match';
// Or
import {match} from 'obliterator';
const iterator = match(/t/, 'test');
iterator.next().value.index
>>> 0
iterator.next().value.index
>>> 3
```
## permutations

@@ -196,2 +232,19 @@

## split
Returns an iterator over the splits of the target string, according to the given RegExp pattern.
```js
import split from 'obliterator/split';
// Or
import {split} from 'obliterator';
const iterator = split(/;/g, 'hello;world;super');
iterator.next().value;
>>> 'hello'
iterator.next().value;
>>> 'world'
```
# Contribution

@@ -198,0 +251,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc