{"_id":"postgres-range","_rev":"3737498","name":"postgres-range","description":"Range data type parser and serializer for PostgreSQL","dist-tags":{"latest":"1.1.4"},"maintainers":[{"name":"martianboy","email":""}],"time":{"modified":"2025-02-13T06:17:20.000Z","created":"2021-03-11T15:04:10.924Z","1.1.4":"2024-01-29T19:12:17.934Z","1.1.3":"2022-08-29T16:56:34.307Z","1.1.2":"2022-06-14T14:10:53.468Z","1.1.1":"2022-01-01T21:30:13.729Z","1.1.0":"2021-12-31T20:32:17.216Z","1.0.3":"2021-06-08T10:19:53.035Z","1.0.2":"2021-03-24T16:57:15.233Z","1.0.1":"2021-03-18T19:22:42.246Z","1.0.0":"2021-03-11T15:04:10.924Z"},"users":{},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"versions":{"1.1.4":{"name":"postgres-range","version":"1.1.4","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"@types/tape":"^4.13.2","standard":"^17.0.0","tap-spec":"^5.0.0","tape":"^5.5.3","typescript":"^4.7.3"},"_id":"postgres-range@1.1.4","gitHead":"dea3b04d8d30e774b68fc73cd965321a0ef3c868","types":"./index.d.ts","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"shasum":"a59c5f9520909bcec5e63e8cf913a92e4c952863","size":3426,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.1.4.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.1.4_1706555537728_0.31772438717895457"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-29T19:12:17.934Z","publish_time":1706555537934,"_source_registry_name":"default","_cnpm_publish_time":1706555537934},"1.1.3":{"name":"postgres-range","version":"1.1.3","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"@types/tape":"^4.13.2","standard":"^17.0.0","tap-spec":"^5.0.0","tape":"^5.5.3","typescript":"^4.7.3"},"types":"./index.d.ts","gitHead":"01855c4d3e50d0ec53c2e8719d019bcc2ce92ff1","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.1.3","_nodeVersion":"17.6.0","_npmVersion":"8.5.1","dist":{"shasum":"9ccd7b01ca2789eb3c2e0888b3184225fa859f76","size":3362,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.1.3.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.1.3_1661792194107_0.3509616534017017"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-08-29T17:02:41.580Z","publish_time":1661792194307,"_cnpm_publish_time":1661792194307},"1.1.2":{"name":"postgres-range","version":"1.1.2","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"@types/tape":"^4.13.2","standard":"^17.0.0","tap-spec":"^5.0.0","tape":"^5.5.3","typescript":"^4.7.3"},"types":"./index.d.ts","gitHead":"39c036687482ecc0c147277b9fcc4379f1d47f7f","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.1.2","_nodeVersion":"17.6.0","_npmVersion":"8.5.1","dist":{"shasum":"3778440e10146a94ee5cdec9f26566c2be37abb9","size":3305,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.1.2.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.1.2_1655215853273_0.7261211175922357"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-14T15:18:44.498Z","publish_time":1655215853468,"_cnpm_publish_time":1655215853468},"1.1.1":{"name":"postgres-range","version":"1.1.1","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"standard":"^16.0.3","tap-spec":"^5.0.0","tape":"^5.2.2","typescript":"^4.3.2"},"types":"./index.d.ts","gitHead":"56fbd2ec5865461be7766adc65c546f56c5628ef","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.1.1","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"shasum":"680f9661b09a9401c6fae8aba9bde51916530cde","size":3283,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.1.1.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.1.1_1641072613577_0.741304779570948"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-01T21:30:19.144Z","publish_time":1641072613729,"_cnpm_publish_time":1641072613729},"1.1.0":{"name":"postgres-range","version":"1.1.0","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"standard":"^16.0.3","tap-spec":"^5.0.0","tape":"^5.2.2","typescript":"^4.3.2"},"types":"./index.d.ts","gitHead":"9d54477b2a4d34426ecced05dbcf3dbec3e2b717","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.1.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"shasum":"ea14523d624fa31cad2284390b8858dd64469ce3","size":3276,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.1.0.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.1.0_1640982737032_0.12049018815744716"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-31T20:32:23.003Z","publish_time":1640982737216,"_cnpm_publish_time":1640982737216},"1.0.3":{"name":"postgres-range","version":"1.0.3","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"standard":"^16.0.3","tap-spec":"^5.0.0","tape":"^5.2.2","typescript":"^4.3.2"},"gitHead":"895a57703420104634a1f220359b5e57e1b1a482","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.0.3","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"shasum":"a1674c64dc1b597b30ae31941a0785e3385f4f14","size":2699,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.0.3.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.0.3_1623147592850_0.20775901396762952"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T08:30:54.088Z","publish_time":1623147593035,"_cnpm_publish_time":1623147593035},"1.0.2":{"name":"postgres-range","version":"1.0.2","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"standard":"^16.0.3","tap-spec":"^5.0.0","tape":"^5.2.2","typescript":"^4.2.3"},"gitHead":"2879d538217d7a4392afbb248e719398f6bc4835","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.0.2","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"6c675945a5474afd2cbd4177743c71bbba500fa0","size":2718,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.0.2.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.0.2_1616605035122_0.2516857525944858"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T08:30:53.118Z","publish_time":1616605035233,"_cnpm_publish_time":1616605035233},"1.0.1":{"name":"postgres-range","version":"1.0.1","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"standard":"^16.0.3","tap-spec":"^5.0.0","tape":"^5.2.2","typescript":"^4.2.3"},"gitHead":"5f26ee2e744f40918df2c761c55b35d3c7192a27","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.0.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"2c5d5a0bf98752b4fada07c98d351253154541ea","size":2748,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.0.1.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.0.1_1616095362077_0.9624418773272183"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T08:30:52.229Z","publish_time":1616095362246,"_cnpm_publish_time":1616095362246},"1.0.0":{"name":"postgres-range","version":"1.0.0","description":"Range data type parser and serializer for PostgreSQL","main":"index.js","repository":{"type":"git","url":"git+https://github.com/martianboy/postgres-range.git"},"author":{"name":"Abbas Mashayekh","email":"martianboy2005@gmail.com"},"license":"MIT","scripts":{"test":"standard && tape test.js | tap-spec"},"devDependencies":{"standard":"^16.0.3","tap-spec":"^5.0.0","tape":"^5.2.2","typescript":"^4.2.3"},"gitHead":"89ea12df833710e626a8a4d2884555909894a04d","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"homepage":"https://github.com/martianboy/postgres-range#readme","_id":"postgres-range@1.0.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"16c9aedaf339095085ba9ef0465280e278fa96a2","size":2721,"noattachment":false,"key":"/postgres-range/-/postgres-range-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postgres-range/download/postgres-range-1.0.0.tgz"},"_npmUser":{"name":"martianboy","email":"martianboy2005@gmail.com"},"directories":{},"maintainers":[{"name":"martianboy","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-range_1.0.0_1615475050715_0.31636135383411323"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T08:30:51.324Z","publish_time":1615475050924,"_cnpm_publish_time":1615475050924}},"readme":"# postgres-range [![tests](https://github.com/martianboy/postgres-range/workflows/tests/badge.svg)](https://github.com/martianboy/postgres-range/actions?query=workflow%3Atests)\n\n> Parse postgres range columns\n\n\n## Install\n\n```\nnpm install --save postgres-range\n```\n\n\n## Usage\n\n```js\nconst range = require('postgres-range')\n\nconst rng = range.parse('[0,5)', (value) => parseInt(value, 10))\nrng.isBounded()\n// => true\nrng.isLowerBoundClosed()\n// => true\nrng.isUpperBoundClosed()\n// => false\nrng.hasLowerBound()\n// => true\nrng.hasUpperBound()\n// => true\n\nrng.containsPoint(4)\n// => true\nrng.containsRange(range.parse('[1,2]', x => parseInt(x)))\n// => true\n\nrange.parse('empty').isEmpty()\n// => true\n\nrange.serialize(new range.Range(0, 5))\n// => '(0,5)'\nrange.serialize(new range.Range(0, 5, range.RANGE_LB_INC | RANGE_UB_INC))\n// => '[0,5]'\n```\n\n## API\n\n#### `parse(input, [transform])` -> `Range`\n\n##### input\n\n*Required*  \nType: `string`\n\nA Postgres range string.\n\n##### transform\n\nType: `function`  \nDefault: `identity`\n\nA function that transforms non-null bounds of the range.\n\n\n#### `serialize(range, [format])` -> `string`\n\n##### range\n\n*Required*  \nType: `Range`\n\nA `Range` object.\n\n##### format\n\nType: `function`  \nDefault: `identity`\n\nA function that formats non-null bounds of the range.\n\n\n## License\n\nMIT © [Abbas Mashayekh](http://github.com/martianboy)\n","_attachments":{},"homepage":"https://github.com/martianboy/postgres-range#readme","bugs":{"url":"https://github.com/martianboy/postgres-range/issues"},"license":"MIT"}