{"name":"rotated-array-set","version":"3.0.0","description":"Set of (possibly rotated) arrays","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/rotated-array-set/issues"},"homepage":"https://github.com/grantila/rotated-array-set#readme","main":"./dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","type":"module","sideEffects":false,"engines":{"node":"^14.13.1 || >=16.0.0"},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","test":"NODE_OPTIONS=--experimental-vm-modules jest --coverage","cz":"git-cz"},"repository":{"type":"git","url":"git+https://github.com/grantila/rotated-array-set.git"},"keywords":["set","rotated","array","arrays"],"devDependencies":{"@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/jest":"^29.4.0","@types/node":"^18.11.18","cz-conventional-changelog":"^3.3.0","jest":"^29.4.1","rimraf":"^4.1.2","typescript":"^4.9.5"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"jest":{"testEnvironment":"node","coverageReporters":["lcov","text","html"]},"packageManager":"yarn@3.2.4","gitHead":"90d3ac88bc7648d2cf63d257d9772ab496c4071e","_id":"rotated-array-set@3.0.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-G7689wvCM0szMFXUAhi3GfNGcSPlndg077cdRWoq7UegOAwfU2MJ0jD7s7jB+2ppKA75Kr/O0HwAP9+rRdBctg==","shasum":"47210ae6aaa9a8abacf2ec959884d31353559dfd","tarball":"http://registry-npm.ywwl.com/rotated-array-set/download/rotated-array-set-3.0.0.tgz","fileCount":5,"unpackedSize":8637,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBWmIPs4jwgD+90XXe0NLDkM/iqDWNBe11gZg5vCFoHgIhAOXiibFvowpJW3lUJhtEQpILxrs8IZ+o2B7yVlbtnJ31"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3CN+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6Dg/+OL3r2q1HcSQ2Q6MviDQI40/IfztspZsixi8LOCN+DHr+S1hD\r\nGPcq5rCNh+UYEonmh8jh3fGBli3MPxhgnyC0bPh4MI5/CWsRabfeSvKkW8r4\r\n6HlH3E9MwJ9FTdCy9zzyM1UUSuLZP/LR7900Pm5zOb8otIYygejppJ1slYAn\r\nJuU2MNJtlX4jAzQV5PUHReT06dPBqeYtwDE0nCDeu2uJ61AGqJuAZYxzKFsR\r\n51B1CKtop8Vm51qpgCmkaiEyc+vlEE0T/KHAgF131Xo9Csu+TCq3q/5mbT/v\r\nPb26Kf99/Hd7gTm0OWfgglxB3EL1a90bJKBtFXM+VnrzObon5y2INlGnAF36\r\nXjSxGXsMabawO4c18T3kC2ma3UzZmrRQpFRZz/dARHoX7PooAvn01yLPlW8D\r\nyS1lfNj/fys+1Kc7Xkl9pDiJagHz4XSo8w+7CAz4y3y1lsU/G4lp+kT6w00e\r\nI1+CW7NuPqqYE3Xhy7m6K+xbKxZNNBsLE4jnZaVXdv+iNBiXmtm1SVj06P+H\r\nMNH8gbBJMTrXgPync7ebHY0bTm2HOxmTlKGeFLctV1UjLwE9bW6uprJmWtfg\r\nIoNIRvIE9oGG7YTe5jjBCqJicR3P/QkXT0za38YFu9KOz55ByFVfJGmSbSHy\r\nhczwE7uhbGi8nMRcfOBVYh3x4cd2ARXvZaw=\r\n=ENWG\r\n-----END PGP SIGNATURE-----\r\n","size":3456,"noattachment":false,"key":"/rotated-array-set/-/rotated-array-set-3.0.0.tgz"},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"directories":{},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rotated-array-set_3.0.0_1675371390438_0.509112671806699"},"_hasShrinkwrap":false,"readme":"[![npm version][npm-image]][npm-url]\n[![downloads][downloads-image]][npm-url]\n[![build status][build-image]][build-url]\n[![coverage status][coverage-image]][coverage-url]\n[![Node.JS version][node-version]][node-url]\n\n\n# rotated-array-set\n\n`RotatedArraySet` is a class looking a bit like the built-in [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) but is a set of arrays of `T`, and treats rotated arrays as \"same\".\n\n\n# API\n\nConstruct a `RotatedArraySet`, optionally provide a *stringify* method, converting `T` to `string` (this is not necessary for primitive types).\n\n\n## Versions\n\n * Since v2 this is a [pure ESM][pure-esm] package, and requires Node.js >=12.20. It cannot be used from CommonJS.\n * Since v3 requires Node.js >= 14.13.1.\n\n\n## Example\n\n```ts\nimport { RotatedArraySet } from 'rotated-array-set'\n\nconst tree = new RotatedArraySet< string >( );\n\ntree.insert( [ 'a', 'b', 'c' ] );\ntree.insert( [ 'x', 'y' ] );\ntree.insert( [ 'c', 'a', 'b' ] ); // won't insert, already has this but rotated\ntree.insert( [ 'y', 'x' ] ); // won't insert, same reason\n\ntree.has( [ 'b', 'c', 'a' ] ); // true\ntree.has( [ 'c', 'b', 'a' ] ); // false - this isn't *rotated*\n\ntree.values( ); // [ [ 'a', 'b', 'c' ], [ 'x', 'y' ] ]\n```\n\nProvide a custom stringifier:\n\n```ts\nimport { RotatedArraySet } from 'rotated-array-set'\n\nconst tree = new RotatedArraySet< User >( user => `${user.first} ${user.last}` );\n\ntree.insert( [ user1, user2, user3 ] );\ntree.insert( [ user3, user1, user2 ] ); // won't insert, already has this but rotated\n\ntree.has( [ user2, user3, user1 ] ); // true\ntree.has( [ user3, user2, user1 ] ); // false - not *rotated*\n\ntree.values( ); // [ [ user1, user2, user3 ] ]\n```\n\n\n[npm-image]: https://img.shields.io/npm/v/rotated-array-set.svg\n[npm-url]: https://npmjs.org/package/rotated-array-set\n[downloads-image]: https://img.shields.io/npm/dm/rotated-array-set.svg\n[build-image]: https://img.shields.io/github/actions/workflow/status/grantila/rotated-array-set/master.yml?branch=master\n[build-url]: https://github.com/grantila/rotated-array-set/actions?query=workflow%3AMaster\n[coverage-image]: https://coveralls.io/repos/github/grantila/rotated-array-set/badge.svg?branch=master\n[coverage-url]: https://coveralls.io/github/grantila/rotated-array-set?branch=master\n[node-version]: https://img.shields.io/node/v/rotated-array-set\n[node-url]: https://nodejs.org/en/\n[pure-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n","publish_time":1675371390663,"_cnpm_publish_time":1675371390663,"dist-tags":{"latest":"3.0.0"}}