{"name":"@blakeembrey/deque","version":"1.0.3","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":"a96da5c75630035f6e7c736ebc775eafd4a00e19","_id":"@blakeembrey/deque@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"integrity":"sha512-w6e4y0QqbPMZJrvZZQ4vP/4yxdsnG3Kr5J3isq6neMrqwo32vGk/LyGMGN9y79XP0wR8UuGROILhTsg5NnhCAw==","shasum":"f83871859441ba4ad9997fca5a3050dcfd9e2363","tarball":"http://registry-npm.ywwl.com/@blakeembrey/deque/download/@blakeembrey/deque-1.0.3.tgz","fileCount":9,"unpackedSize":58015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbl+dlCRA9TVsSAnZWagAAmN4P+wabCi8QvMqwz3t15xWN\ncDDXXcNrYQhUTFLyiykGdGfGjmZGFPGTHlovkq6eNj2zAXUDRr8VJS80XHRY\n8hOC64FxCF9yNxjSVo4v+zND1j+nvwbTkIU1Z8Oom2em/g1OCCHU+D7HxXyZ\nzd9L2gh1+aRUJxQG9kAyh2fskBjya2u3byniBeU/zyxIBImWDf6iMet8agW0\n21o3UkRkUwp4gpyvwb25fhF1heezDmEtw7lQEU6rn0mz9Xs0RsiQrLvfMtmX\nTXzWzDS/pVl+xXr4hNWK/cR/9M7/8ahz0VbXO5LDLMmtqq7XiLKANBGec8ir\nRMRun3uyqrPk33mBj1r3qsFwv9065dCcN2sdwbAG84gNHNAhQwzwCu4uyqjd\nVO3KBX6eyHQO2UGAKPi7VX++jZDALZjsShNd2ZDCQmw1wk4QePmydwBAvj+6\nYtTcFRpIBzINYFqXVpYzMVOcuHpEK4w4lXOkfaZkLgGzr/gBbdYHy0LUMLfL\npZgSSGP+76YD4G/ZiiIRk+4SvuHi/yn1xnuo/yGColuEz2F5Jbv6b9Nvmxtr\nasbE+tE0ri6hTQIchdfjfSp5NO2Ewo20N10+BpFiAQnjtMzHeonDUNGpT0PR\nTFmEoN9NWGyANm089K9O0i38CIQzeMgbke9mjFkeEqcVIc3/97SxUh40BFfT\nnEaR\r\n=3JYF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGWpfsXsHN7Ublj7dZIgMlbzWF/kxXn0gdkAVi+6NU7hAiEAz3eiVDGGh2zO79+P7VM+5x1R++kumD8AgmFGV/eamCw="}],"size":8954,"noattachment":false,"key":"/@blakeembrey/deque/-/@blakeembrey/deque-1.0.3.tgz"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deque_1.0.3_1536681827230_0.17093648657849858"},"_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":1536681827343,"_cnpm_publish_time":1536681827343,"dist-tags":{"latest":"1.0.5"}}