{"name":"rotated-array-set","version":"2.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":"^12.20.0 || ^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.15.6","@babel/preset-typescript":"^7.15.0","@types/jest":"^27.0.1","@types/node":"^16.9.1","cz-conventional-changelog":"^3.1.0","jest":"^27.1.1","rimraf":"^3.0.1","typescript":"^4.4.3"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"jest":{"testEnvironment":"node","coverageReporters":["lcov","text","html"]},"gitHead":"81931d4bea76d76f37606c968a8dc11abeff71ca","_id":"rotated-array-set@2.0.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-1tPB51yz69z5UMmobBcM4G7QvOzI8yS4YvZV790RYiANgL94ZmMDAwPv6QyF7ouwpEssFF8bVE+qzvIOBUiTDQ==","shasum":"36495a61ea12e2447376c69be6d412b4de1ed00a","tarball":"http://registry-npm.ywwl.com/rotated-array-set/download/rotated-array-set-2.0.0.tgz","fileCount":5,"unpackedSize":8813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhPvR0CRA9TVsSAnZWagAAtxEP/3ibfV6C/+prVBdlY2Mi\nX1ASB/ao2o/GNM/hM84MxGIPV0moGCqkwN7Tm+CqASJsPI0Ht6RPx+nV8QaO\nDZPJd9sNxwar4AwGIcXucxLrJAjjHjGH4DPzhdyorcmTiu/HGbvDywEyQa8U\npwgxZnQNjbih3sxZUPPUzRoEWRw303Z9BLy/8EQ4V5JwiOHxtTz6SaZbuxt5\n3MxDNOEsCtj9WqgQzht0FWi77mzotSWsR6HGoARKK2vFrZtQebjPJtVU+07u\nSlydRCDEjE6uYMvUlPynU8heXbQPbFqg8gdgczYbvhIc5qG45nFDHhrpBvEV\n94p5c56OcRE5+OTonvM0paK6iuclkNo6K4BQcbJS3kILHjY+8Mgs4aTH2/7j\noVtbwk65L4aaiy8gG2RLR6u1QFoiGuEpkT/Iu8HLoEpedkglKjjC3lWXgVix\nQ5z8QnjzMLQ2LnO+Z5TO+S929L92H3w6DgvV9xJEoze/bOmV6OiySTl5/Pbv\nG2v2Xo5OayPFZGMeXdG+9se0/R2X3Z/K2Uw3c8P+LiFOwUGwGfn2uT0+smyh\n/dS7CRhlFQCNBmvfs9EPgrfnKQNEouKjx8w8PTT7Q1ZbSRKG21N3/DW4qI+i\nP3T+F4kIu03XXPaMQVxGL3EG+F2kCZA2ImOTwFnaXqXRip/mIQH3H+rP0jop\n+tnQ\r\n=VNTu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7jl8AOP62/FMXhaqS+8gSGAVOSlAb/YURzMPTJPzh7AiA1F//CJJBWNKSsaQ0k+kEdNw/7P6TJrbQQCQ0bzCeG6g=="}],"size":3538,"noattachment":false,"key":"/rotated-array-set/-/rotated-array-set-2.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_2.0.0_1631515764671_0.7189227506771809"},"_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":1631515764789,"_cnpm_publish_time":1631515764789,"dist-tags":{"latest":"3.0.0"}}