{"name":"@blakeembrey/deque","version":"1.0.4","description":"Deques are a generalization of stacks and queues","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"prettier":"prettier --single-quote --no-semi --write","lint":"tslint \"src/**/*.ts\" --project tsconfig.json","format":"npm run prettier -- \"src/**/*.ts\"","build":"rimraf dist && tsc","specs":"jest --coverage","test":"npm run -s lint && npm run -s build && npm run -s specs","prepublish":"npm run build"},"repository":{"type":"git","url":"git://github.com/blakeembrey/deque.git"},"keywords":["deque","fifo","lifo","queue","stack","double","linked","list","iterator","iteration"],"author":{"name":"Blake Embrey","email":"hello@blakeembrey.com","url":"http://blakeembrey.me"},"license":"Apache-2.0","bugs":{"url":"https://github.com/blakeembrey/deque/issues"},"homepage":"https://github.com/blakeembrey/deque","jest":{"roots":["<rootDir>/src/"],"transform":{"\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,json,css,md}":["npm run prettier","git add"]},"publishConfig":{"access":"public"},"devDependencies":{"@types/benchmark":"^1.0.31","@types/jest":"^23.3.1","@types/node":"^10.9.4","benchmark":"^2.1.4","denque":"^1.3.0","double-ended-queue":"^2.1.0-0","husky":"^1.2.0","jest":"^23.5.0","lint-staged":"^8.1.0","prettier":"^1.14.2","rimraf":"^2.5.4","ts-jest":"^23.1.4","ts-node":"^7.0.1","tslint":"^5.0.0","tslint-config-prettier":"^1.15.0","tslint-config-standard":"^8.0.0","typescript":"^3.0.3"},"dependencies":{},"gitHead":"b692c13e1a89faf7c5d5a8a3b6bd8d768cdc900a","_id":"@blakeembrey/deque@1.0.4","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"integrity":"sha512-gzAiePolEXlMlQxbHWcdmz+b+PEixO5so0mU8jMlCemp8sxUWko9AzWc4EK3MV6BCUYd9cjq+Gd477cZiq5Kfw==","shasum":"4fc65476814e6b807140f258852055e5f69e5ccb","tarball":"http://registry-npm.ywwl.com/@blakeembrey/deque/download/@blakeembrey/deque-1.0.4.tgz","fileCount":9,"unpackedSize":58075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/fQnCRA9TVsSAnZWagAAshcP+wRJ5vTu9GAwTABgofpt\nd1kNKnc+aYOBOe3Ph31hGMk/UHbV3SQPHgD3kvenbolih4so3Pi72g459Q+s\n3tUnzByAr/Pcpgbk19sNEbhkLkXH/SA/EPD1Ie5ZZSBfGNLKJuSdhjERfvwz\n/3rxrfZcS3zJ3fUO0wS/PvcFiNItuavkIdi4gM6umR/3TZYKTq8AZ8J3xdK5\nqs9/hAMitp3Jp9matZTe6E1QwMTRR8sincIehgLqHJoosaq6T8TpdfW0c/re\n36CQriDLHBTiAAb2wkopxxoSRPbiHIaVQv5f3qF4t4qeGzE/EHO2TE56BU2Z\n4eVaSwLIcVS4DZCoFjOgCGVeozLPu7e4G0JEXxDw9i2ng04gB+KTG1/077gq\nr2mUm6tqAw9j4fpY/JZuIwIbgpxLMGsQSA8sDu1pI4VWMO8bNAoRg3rbaJS7\nrKJfRF+HbHAFKgfWjtV+NCGh6cN/HPld1OgAwTv60fNDf4Uh2rkgwZ/1iClP\nBnYjXFSSTxL6LFYn9V7fxWcvR++Sz3yNxlAFqKxLa1OY1tQNhyOgx6hUgwiy\nikWlEVyXHnbxSkkrK2jAkEXtfq5h7hoLSu8kMkQpoTOk3K39z58B4JNVnlt9\nM7+uE+auLmzFtXuXZM2QBFDs9PCT7CLmwLpSuYg0Qn8VIlF4inTxSoAeQLm2\nto3r\r\n=QDRi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFz2U85IkEJxHRTxC7rc898/gEp+T1a+LPU/2Y8xySPWAiEArIN6EGsgbWblP1GJqwwzambVF6AnGWh0baOaF6fd2YY="}],"size":8962,"noattachment":false,"key":"/@blakeembrey/deque/-/@blakeembrey/deque-1.0.4.tgz"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deque_1.0.4_1543369767217_0.1036920221588018"},"_hasShrinkwrap":false,"readme":"# Deque\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n\n> Deques are a generalization of stacks and queues (the name is pronounced \"deck\" and is short for \"double-ended queue\").\n> -- [Python `collections`](https://docs.python.org/3/library/collections.html#collections.deque).\n\n## Installation\n\n```\nnpm install @blakeembrey/deque --save\n```\n\n## Usage\n\n- `size` Returns the number of elements in the deque.\n- `push(x)` Add `x` to right side of the deque.\n- `pushLeft(x)` Add `x` to the left side of the deque.\n- `clear()` Remove all elements from the deque leaving it with length 0.\n- `extend(iterable)` Extend the right side of the deque by appending elements from iterable.\n- `extendLeft(iterable)` Extend the left side of the deque by appending elements from iterable.\n- `peek(i)` Return the element at index `i` in the deque.\n- `indexOf(x, start?)` Return the position of `x` in the deque.\n- `has(x)` Return a boolean indicating whether `x` is in the deque.\n- `insert(i, x)` Insert `x` into the deque at position `i`.\n- `pop()` Remove and return an element from the right side of the deque. If no elements are present, throws `RangeError`.\n- `popLeft()` Return and return an element from the left side of the deque. If no elements are present, throws `RangeError`.\n- `delete(i)` Delete the value at position `i`.\n- `reverse()` Reverse the elements of the deque in-place.\n- `rotate(n=1)` Rotate the deque `n` steps to the right.\n- `entries()` Return an iterable of deque.\n- `@@iterator()` Return an iterable of deque.\n\n```js\nimport { Deque } from '@blakeembrey/deque'\n\nconst d = new Deque('ghi')\n\nfor (const value of d) {\n  console.log(value.toUpperCase()) //=> G H I\n}\n\nd.push('j')\nd.pushLeft('f')\nd //=> Deque(['f', 'g', 'h', 'i', 'j'])\n\nd.pop() //=> 'j'\nd.popLeft() //=> 'f'\n\nArray.from(d) //=> ['g', 'h', 'i']\n\nd.peek(0) //=> 'g'\nd.peek(-1) //=> 'i'\n\nd.extend('jkl')\nd //=> Deque(['g', 'h', 'i', 'j', 'k', 'l'])\n\nd.rotate(1)\nd //=> Deque(['l', 'g', 'h', 'i', 'j', 'k'])\n\nd.rotate(-1)\nd //=> Deque(['g', 'h', 'i', 'j', 'k', 'l'])\n\nconst d2 = new Deque(d)\n\nd2 //=> Deque(['g', 'h', 'i', 'j', 'k', 'l'])\n```\n\n## TypeScript\n\nThis project uses [TypeScript](https://github.com/Microsoft/TypeScript) and publishes definitions on NPM.\n\n## Reference\n\nCircular array implementation originally based on [`denque`](https://github.com/Salakar/denque) with additional optimizations.\n\n## License\n\nApache 2.0\n\n[npm-image]: https://img.shields.io/npm/v/@blakeembrey/deque.svg?style=flat\n[npm-url]: https://npmjs.org/package/@blakeembrey/deque\n[downloads-image]: https://img.shields.io/npm/dm/@blakeembrey/deque.svg?style=flat\n[downloads-url]: https://npmjs.org/package/@blakeembrey/deque\n[travis-image]: https://img.shields.io/travis/blakeembrey/deque.svg?style=flat\n[travis-url]: https://travis-ci.org/blakeembrey/deque\n[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/deque.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/blakeembrey/deque?branch=master\n","publish_time":1543369767325,"_cnpm_publish_time":1543369767325,"dist-tags":{"latest":"1.0.5"}}