New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

set-ds

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

set-ds - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

dist/index.d.ts

79

package.json
{
"name": "set-ds",
"version": "0.1.1",
"description": "JavaScript implementation of a set data structure",
"main": "index.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/jasonsjones/set-data-structure.git"
},
"keywords": [
"set",
"abstract data type",
"data structure"
],
"author": "Jason Jones",
"license": "MIT",
"bugs": {
"url": "https://github.com/jasonsjones/set-data-structure/issues"
},
"homepage": "https://github.com/jasonsjones/set-data-structure",
"devDependencies": {
"gulp": "^3.9.0",
"gulp-jscs": "^1.6.0",
"gulp-jshint": "^1.12.0",
"gulp-load-plugins": "^0.8.0",
"gulp-mocha": "^2.2.0",
"gulp-util": "^3.0.7",
"jshint-stylish": "^1.0.2",
"mocha": "^2.3.0",
"should": "8.0.2"
}
"name": "set-ds",
"version": "1.0.0",
"description": "Set data structure",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"dist-clean": "rm -rf dist",
"pretest": "yarn lint",
"test": "jest --colors --verbose src/__tests__/*.spec.ts",
"lint": "eslint src/index.ts",
"prepublishOnly": "yarn lint && yarn test",
"prepare": "yarn build"
},
"repository": {
"type": "git",
"url": "https://github.com/jasonsjones/data-structures.git",
"directory": "packages/set"
},
"keywords": [
"set",
"abstract data type",
"data structure"
],
"author": "Jason Jones",
"license": "MIT",
"bugs": {
"url": "https://github.com/jasonsjones/data-structures/issues"
},
"homepage": "https://github.com/jasonsjones/data-structures",
"devDependencies": {
"@types/jest": "^24.0.18",
"@types/node": "^12.7.12",
"@typescript-eslint/eslint-plugin": "^2.3.3",
"@typescript-eslint/parser": "^2.3.3",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-prettier": "^3.1.1",
"jest": "^24.9.0",
"prettier": "^1.18.2",
"ts-jest": "^24.1.0",
"typescript": "^3.6.4"
},
"files": [
"dist/**/*"
]
}

@@ -1,2 +0,2 @@

# [![npm version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![dependency status][dm-image]][dm-url]
[![npm version][npm-image]][npm-url]

@@ -12,4 +12,4 @@ # Set Data Structure

A set data structure is an implementation of the mathematical concept of
a finite set. A set is a collection of unique values (no duplicates) that
have no particular order. A set is more concerned whether or not values
a finite set. A set is a collection of unique values (no duplicates) that
have no particular order. A set is more concerned whether or not values
are contained in the set than the order in which they are added.

@@ -20,15 +20,6 @@

*For specific examples and documentation, see the below sections*
_For specific examples and documentation, see the below sections_
#### Environment:
---
Although this implementation is designed to be used with
[Node.js](http://www.nodejs.org), it could be used in other contexts with minor
modifications. This implementation does not have any external dependencies
that would preclude it from being used in the browser--just include it with a
`<script>` tag and it should be good to go. _Disclaimer: I have not tested
this implementation in any other context/environment; only tested with node.js_
----
## Basic Usage

@@ -41,3 +32,4 @@

```
Basic usage example below. _Note: it does not cover all the available
Basic usage example below. _Note: it does not cover all the available
methods, rather just highlights the main functionality to get up and running

@@ -92,2 +84,3 @@ with this data structure. For a description of all the methods, see the

```
## API

@@ -97,30 +90,39 @@

* ### isEmpty()
- ### isEmpty()
Determines if the set is empty
* ### size()
- ### size()
Returns the size, or number of items in the set
* ### clear()
- ### clear()
Clears all the items from the set
* ### add(value)
Adds an item to the set. If the set already contains the item,
- ### add(value)
Adds an item to the set. If the set already contains the item,
it is not added.
* ### remove(value)
- ### remove(value)
Removes an item from the set.
* ### has(value)
- ### has(value)
Determines of the set contains, or has, the value
* ### values()
- ### values()
Returns an array containing all the items in the set
* ### union(otherSet)
Returns a Set that is the union of this set and the 'otherSet'. The
- ### union(otherSet)
Returns a Set that is the union of this set and the 'otherSet'. The
returned set will contain all the elements from both sets, and by
definition, will not contain any duplicates.
* ### intersection(otherSet)
- ### intersection(otherSet)
Returns a Set that ts the intersection of this set and the 'otherSet',

@@ -130,21 +132,20 @@ The returned set will have only those items that both sets have in

* ### difference(otherSet)
Returns a Set that ts the different of this and the 'otherSet', The
- ### difference(otherSet)
Returns a Set that ts the different of this and the 'otherSet', The
returned set will have those items that are contained in this set, but
NOT contained in the 'otherSet'.
* ### subset(otherSet)
Returns whether or not this set is a subset of the 'otherSet'. If all
- ### subset(otherSet)
Returns whether or not this set is a subset of the 'otherSet'. If all
items of this set are contained in the otherSet, this function returns
true; false otherwise.
----
---
## License
MIT &copy; Jason Jones
[npm-image]:https://badge.fury.io/js/set-ds.svg
[npm-url]:http://npmjs.org/package/set-ds
[travis-image]:https://travis-ci.org/jasonsjones/set-data-structure.svg
[travis-url]:https://travis-ci.org/jasonsjones/set-data-structure
[dm-image]:https://david-dm.org/jasonsjones/set-data-structure.svg
[dm-url]:https://david-dm.org/jasonsjones/set-data-structure
[npm-image]: https://badge.fury.io/js/set-ds.svg
[npm-url]: http://npmjs.org/package/set-ds
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