{"name":"@blakeembrey/deque","version":"1.0.2","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","linked","list","double","endpoint","queue","stack","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":"^0.14.3","jest":"^23.5.0","lint-staged":"^7.2.2","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":"2504e0250a4805835f7dcfc5b118d46bc8839726","_id":"@blakeembrey/deque@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"integrity":"sha512-g6Ke3shZYez+TmhMbDCjVg5HIc3G0eIWNIHtGzGjfN4aJVa92N0C2M2Tfqx9NDnJdH1N6w2KDNy/pVlC9EBrXw==","shasum":"ac6253092ddfcf638e86de0d1b4ed50e77a037a3","tarball":"http://registry-npm.ywwl.com/@blakeembrey/deque/download/@blakeembrey/deque-1.0.2.tgz","fileCount":9,"unpackedSize":56107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbl1zaCRA9TVsSAnZWagAAAm0QAKNuxrr/+eSZgKdSpm7M\nLZEopXF9CsYM3eHQFw/5uJbHUMCm8+G1r3yJeW2gLYn/iUbogx4d2d04Lk1t\nTzzVllm/l673tCRnf9GH7Fl9Rq77FLxTYeAUVUCt8/qJ2HnNGq4gyO0sNlFL\nEEQIRXS92Ly6BjdmnhlLot4QAXqbOzIs5MJIogjgSXQ4q3U1j/GXxponFtzU\nuco+vHgUsif0eEGoH6G9m6zo7AI2448sQcop9WV8Q3HDTqOmx5WCD1qM9RVl\nQtFwkLh2bL6EdMmU6AeUgSsx/Co1De+9S/Gf5u2/AAU0sbqqgkxuGxXOH+nP\nUOGBgqT5s45/A3+evc5sBegNN3JlNLgZO6cG+xlPVf8+zMPyRZ1jVrZ94XSi\nsMr9s+23jYbplTrn5rknu+KmoFSuK3+N9qYRwFEWGAV6ZcqtXK2wwa1784yx\nxt7EmYTnznEHFVH5pRJq8HIgHlYuyP4g36qeqbeGDqO6vro0na6VS2rNnP0P\nPFCL43l30h+8+9jQqazdAngCpqSRbjk1hclNeldfg3QFQ/yTHjJKIfXa9pL8\nHxuT+Vevwu9iLw6xafF3PjxyaZzdERGmCGs0kmsMHiZ0Y/Vw9wovSEtOYB1U\n2zvNM0Kh2exu99Rb8OMtMNUhz72aIn49htgzFpezamTW9BgVv2OY04Wg5upG\nE1h+\r\n=KNDG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICEgpp8bCk+UkPSo7iqjYaJY2Bqhm+XiKoEisou7qWsPAiAfNPsOa6dHiNUdpM1nkJsU5Ut2xYvgvSWhBdbxWIa3VQ=="}],"size":8733,"noattachment":false,"key":"/@blakeembrey/deque/-/@blakeembrey/deque-1.0.2.tgz"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deque_1.0.2_1536646361252_0.4683237909027982"},"_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":1536646361429,"_cnpm_publish_time":1536646361429,"dist-tags":{"latest":"1.0.5"}}