{"_id":"rotated-array-set","_rev":"3-ddd18e4fa907793e2caf13fe8dca2846","name":"rotated-array-set","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"rotated-array-set","version":"1.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","types":"./dist/index.d.ts","directories":{},"engines":{"node":">=12"},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","test":"jest --coverage","cz":"git-cz"},"repository":{"type":"git","url":"git+https://github.com/grantila/rotated-array-set.git"},"keywords":["set","rotated","array","arrays"],"devDependencies":{"@types/jest":"^26.0.20","@types/node":"^14.14.31","cz-conventional-changelog":"^3.1.0","jest":"^26.6.3","rimraf":"^3.0.1","ts-jest":"^26.5.2","typescript":"^4.2.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"bff8ab8d7354b01985d074fda11ece45bf6041d0","_id":"rotated-array-set@1.0.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MmMz9ERrZw7DVn8e6V7U/wkAWzEaULiPySEBXLWh4nA/F5gwSFx96bu+As4wyDpZ9bdhc+flB1CyTYmStwZo8A==","shasum":"e6d6e2c52465923ec6c1bb5a6af193c31d04f0eb","tarball":"https://registry.npmjs.org/rotated-array-set/-/rotated-array-set-1.0.0.tgz","fileCount":5,"unpackedSize":8569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZjisCRA9TVsSAnZWagAAr5oP/jmvuIYoXWa3QP9hr8cj\nDg3sACgAZgjJojQ7ebAzZnYxTYYerXuUCOoGVVkWCOoQdmLafcHSNRqIt6Vg\n1keukh1WlIsLzw8787H9BjUhExNgsGscQcVuDtV8E9oJVbKgvP1EHui4emjP\n/0MYSxVsoK8GLp0C4IzqAzISOy4HQ1BQX/2Ubw6No/+G+heMyuGKgi4+6VfW\nzOUaskettCrL3nCfvUiMUz76qpTn/2FRItI9IK09TKcsfMrBxAEbCGEPswZv\ncXbxfaWNM2sOMitIINkbxkmSuZbrEHyqvzWcQrWeMjM/39B1VOyn67F20wKu\nI/dak6zPRGeoyu7Bdz+X2DaHyXZJk1CBkSp+18u05UO4PtDsYjknguFZuPp7\nRv/rvqvpyb4QI71ZeAfn49MZWhoyqPexemHt2q/9Mr2/VPQFukwm5IJ8ZmTE\n/LskKcXpR0EukmGiWa4E0sEjspaD2HyBdzEDauBP7J7uznIbDl0Ffw45uMN1\nZbRiMIljqZ/0hf7kAXu9CHKqvRavAqJqrSdDZqHwM1EmpZgxtPQwoXre5ZUM\nEnoIpvH2erDQ6t1MBH77HkU1/ti0+/bDipRP3RdQdb+fV4Hq3GgrQdwGSkTg\nAYO6rhcUoGJJRjlzF6uSAjlQAITesLiLOhVMI9BtUz58NE5ooHSAUCcQMrIn\n83P8\r\n=tMRW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiJwGXazJmm9+olghWNY9dyk4mk5OMDZvlurGZIctShAIgNwvDte+caFNa5w2pHDxPTO8v5vWcHU5O+Q9sIBHTTJY="}]},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rotated-array-set_1.0.0_1617311915851_0.7837373313512173"},"_hasShrinkwrap":false},"2.0.0":{"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":"https://registry.npmjs.org/rotated-array-set/-/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=="}]},"_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},"3.0.0":{"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":"https://registry.npmjs.org/rotated-array-set/-/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"},"_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}},"time":{"created":"2021-04-01T21:18:35.851Z","1.0.0":"2021-04-01T21:18:35.988Z","modified":"2023-02-02T20:56:30.747Z","2.0.0":"2021-09-13T06:49:24.789Z","3.0.0":"2023-02-02T20:56:30.663Z"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"description":"Set of (possibly rotated) arrays","homepage":"https://github.com/grantila/rotated-array-set#readme","keywords":["set","rotated","array","arrays"],"repository":{"type":"git","url":"git+https://github.com/grantila/rotated-array-set.git"},"author":{"name":"Gustaf Räntilä"},"bugs":{"url":"https://github.com/grantila/rotated-array-set/issues"},"license":"MIT","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","readmeFilename":"README.md"}