Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjl9903/setmap
Use Hash to check whether two sets are equal.
https://github.com/yjl9903/setmap
data-structures hash
Last synced: 28 days ago
JSON representation
Use Hash to check whether two sets are equal.
- Host: GitHub
- URL: https://github.com/yjl9903/setmap
- Owner: yjl9903
- License: mit
- Created: 2020-03-04T10:01:36.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-02T16:16:27.000Z (over 1 year ago)
- Last Synced: 2024-10-30T05:04:15.786Z (3 months ago)
- Topics: data-structures, hash
- Language: TypeScript
- Homepage:
- Size: 329 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SetMap
[![version](https://img.shields.io/npm/v/@yjl9903/setmap?color=rgb%2850%2C203%2C86%29&label=SetMap)](https://www.npmjs.com/package/@yjl9903/setmap) ![Node.js CI](https://github.com/yjl9903/SetMap/workflows/Node.js%20CI/badge.svg)
Use Hash to check whether two sets are equal.
## Install
```bash
npm i @yjl9903/setmap
# or
pnpm i @yjl9903/setmap
```## Usage
```typescript
const a = { a: 1 };
const b = { b: 2 };
const c = { c: 3 };const set = new SetSet([a]);
set.has([a]); // true
set.has([b]); // falseset.add([a, b, c]); // true
set.has([a, c, b]); // true
set.has([b, a, c]); // true
set.has([b, c, a]); // true
set.has([c, a, b]); // true
set.has([c, b, a]); // trueset.has([a, b]); // false
set.has([a, c]); // false
set.has([b, c]); // false
```## License
[MIT](https://github.com/yjl9903/SetMap/blob/master/LICENSE)