<commit_before>[![build status](https://secure.travis-ci.org/bebraw/setjs.png)](http://travis-ci.org/bebraw/setjs)

# setjs - Set data structure for JavaScript

`setjs` implements a a Set API inspired by [Python](http://docs.python.org/2/library/stdtypes.html#set). There are some differences, though. The biggest difference is that the API is immutable by design. There is a basic `set` structure and functions that operate upon it. Consider the API below:

```js
var a = set(4, 3, 4, 3); // set accepts arbitrary amount of items and may be empty
var b = set(4, 5);

set.count(a); // 2
set.contains(a, 3); // true
set.equals(a, a); // true
set.equals(a, set()); // false

set.union(a, b); // {3, 4, 5}
set.intersection(a, b); // {4}
set.difference(a, b); // {5}
set.symmetricDifference(a, b); // {3, 5}
```

The functions above may be used to perform various manipulations on sets.

## License

MIT.<commit_msg>Add @dfellis to contributors<commit_after>[![build status](https://secure.travis-ci.org/bebraw/setjs.png)](http://travis-ci.org/bebraw/setjs)

# setjs - Set data structure for JavaScript

`setjs` implements a a Set API inspired by [Python](http://docs.python.org/2/library/stdtypes.html#set). There are some differences, though. The biggest difference is that the API is immutable by design. There is a basic `set` structure and functions that operate upon it. Consider the API below:

```js
var a = set(4, 3, 4, 3); // set accepts arbitrary amount of items and may be empty
var b = set(4, 5);

set.count(a); // 2
set.contains(a, 3); // true
set.equals(a, a); // true
set.equals(a, set()); // false

set.union(a, b); // {3, 4, 5}
set.intersection(a, b); // {4}
set.difference(a, b); // {5}
set.symmetricDifference(a, b); // {3, 5}
```

The functions above may be used to perform various manipulations on sets.

## Contributors

* [<NAME>](https://github.com/dfellis) - Made library truly immutable.

## License

MIT.
{'fraction_non_alphanumeric': 0.16026970954356848, 'fraction_numerical': 0.016597510373443983, 'mean_word_length': 3.883544303797468, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2418280', 'n_tokens_mistral': 676, 'n_tokens_neox': 644, 'n_words': 228}