https://github.com/yjl9903/setmap
Use Hash to check whether two sets are equal.
https://github.com/yjl9903/setmap
data-structures hash
Last synced: 3 months 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 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-02T16:16:27.000Z (over 2 years ago)
- Last Synced: 2025-02-09T23:51:13.596Z (11 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
[](https://www.npmjs.com/package/@yjl9903/setmap) 
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]); // false
set.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]); // true
set.has([a, b]); // false
set.has([a, c]); // false
set.has([b, c]); // false
```
## License
[MIT](https://github.com/yjl9903/SetMap/blob/master/LICENSE)