{"_id":"structured-source","_rev":"2892740","name":"structured-source","description":"Provides StructuredSource and functionality for converting range and loc vice versa.","dist-tags":{"latest":"3.0.2"},"maintainers":[{"name":"constellation","email":"utatane.tea@gmail.com"}],"time":{"modified":"2022-11-28T08:50:44.000Z","created":"2014-12-27T17:24:44.109Z","3.0.2":"2014-12-27T21:47:48.125Z","3.0.1":"2014-12-27T19:39:08.670Z","1.0.0":"2014-12-27T17:24:44.109Z"},"users":{"grandsong":true},"author":{"name":"Yusuke SUZUKI"},"repository":{"type":"git","url":"https://github.com/Constellation/structured-source.git"},"versions":{"3.0.2":{"name":"structured-source","version":"3.0.2","description":"Provides StructuredSource and functionality for converting range and loc vice versa.","author":{"name":"Yusuke SUZUKI"},"homepage":"https://github.com/Constellation/structured-source","repository":{"type":"git","url":"https://github.com/Constellation/structured-source.git"},"main":"lib/index.js","maintainers":[{"name":"constellation","email":"utatane.tea@gmail.com"}],"files":["lib"],"scripts":{"test":"gulp test"},"dependencies":{"boundary":"^1.0.1"},"devDependencies":{"gulp":"^3.8.10","gulp-6to5":"^1.0.2","gulp-bump":"^0.1.11","gulp-espower":"^0.10.0","gulp-filter":"^2.0.0","gulp-git":"^0.5.5","gulp-mocha":"^2.0.0","gulp-sourcemaps":"^1.2.8","gulp-tag-version":"^1.2.1","power-assert":"^0.10.0"},"keywords":["location","range","abstract","syntax","tree"],"bugs":{"url":"https://github.com/Constellation/structured-source/issues"},"licenses":[{"type":"BSD","url":"http://github.com/Constellation/structured-source/raw/master/LICENSE.BSD"}],"gitHead":"9b9660159eb076d58f3a1a546cf110e85b058ad1","_id":"structured-source@3.0.2","_shasum":"dd802425e0f53dc4a6e7aca3752901a1ccda7af5","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"constellation","email":"utatane.tea@gmail.com"},"dist":{"shasum":"dd802425e0f53dc4a6e7aca3752901a1ccda7af5","size":7039,"noattachment":false,"key":"/structured-source/-/structured-source-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/structured-source/download/structured-source-3.0.2.tgz"},"directories":{},"publish_time":1419716868125,"_hasShrinkwrap":false,"_cnpm_publish_time":1419716868125,"_cnpmcore_publish_time":"2021-12-16T16:12:37.085Z"},"3.0.1":{"name":"structured-source","version":"3.0.1","description":"Provides StructuredSource and functionality for converting range and loc vice versa.","author":{"name":"Yusuke SUZUKI"},"homepage":"https://github.com/Constellation/structured-source","repository":{"type":"git","url":"https://github.com/Constellation/structured-source.git"},"main":"lib/index.js","maintainers":[{"name":"constellation","email":"utatane.tea@gmail.com"}],"files":["lib"],"scripts":{"test":"gulp test"},"dependencies":{},"devDependencies":{"gulp":"^3.8.10","gulp-6to5":"^1.0.2","gulp-espower":"^0.10.0","gulp-mocha":"^2.0.0","power-assert":"^0.10.0"},"keywords":["location","range","abstract","syntax","tree"],"bugs":{"url":"https://github.com/Constellation/structured-source/issues"},"licenses":[{"type":"BSD","url":"http://github.com/Constellation/structured-source/raw/master/LICENSE.BSD"}],"gitHead":"c50d862e5b5ec4cff2d6491d36958fc64e0ffa95","_id":"structured-source@3.0.1","_shasum":"b593f3b9b9ce92809e2983e804d69cceb82899c7","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"constellation","email":"utatane.tea@gmail.com"},"dist":{"shasum":"b593f3b9b9ce92809e2983e804d69cceb82899c7","size":2731,"noattachment":false,"key":"/structured-source/-/structured-source-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/structured-source/download/structured-source-3.0.1.tgz"},"directories":{},"publish_time":1419709148670,"_hasShrinkwrap":false,"_cnpm_publish_time":1419709148670,"_cnpmcore_publish_time":"2021-12-16T16:12:37.386Z"},"1.0.0":{"name":"structured-source","version":"1.0.0","description":"Provides StructuredSource and functionality for converting range and loc vice versa.","author":{"name":"Yusuke SUZUKI"},"homepage":"https://github.com/Constellation/structured-source","repository":{"type":"git","url":"https://github.com/Constellation/structured-source.git"},"main":"lib/index.js","maintainers":[{"name":"constellation","email":"utatane.tea@gmail.com"}],"files":["lib"],"scripts":{"test":"gulp test"},"dependencies":{},"devDependencies":{"gulp":"^3.8.10","gulp-6to5":"^1.0.2","gulp-espower":"^0.10.0","gulp-mocha":"^2.0.0","power-assert":"^0.10.0"},"keywords":["location","range","abstract","syntax","tree"],"bugs":{"url":"https://github.com/Constellation/structured-source/issues"},"licenses":[{"type":"BSD","url":"http://github.com/Constellation/structured-source/raw/master/LICENSE.BSD"}],"gitHead":"3d3a7d7d837aee9fa4aa2627dcb228f6dc9f64d0","_id":"structured-source@1.0.0","_shasum":"10a7db2cf5d7d3c8a3a4dd1a47d7fa7c77049683","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"constellation","email":"utatane.tea@gmail.com"},"dist":{"shasum":"10a7db2cf5d7d3c8a3a4dd1a47d7fa7c77049683","size":2470,"noattachment":false,"key":"/structured-source/-/structured-source-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/structured-source/download/structured-source-1.0.0.tgz"},"directories":{},"publish_time":1419701084109,"_hasShrinkwrap":false,"_cnpm_publish_time":1419701084109,"_cnpmcore_publish_time":"2021-12-16T16:12:37.616Z"}},"readme":"StructuredSource\n==============\n\n\n## About\n\nProvides StructuredSource and functionality for converting range and loc vice versa.\n\n## Installation\n\n```sh\nnpm install structured-source\n```\n\n\n## Usage\n\n```js\nconst  StructuredSource = require('structured-source');\n\nlet src = new StructuredSource('aaa\\u2028aaaa\\u2029aaaaa\\n');\n\n// positionToIndex({ line: number, column: number) -> number\nassert(src.positionToIndex({ line: 1, column: 2 }) === 2);\n\n// indexToPosition(number) -> { line: number, column: number }\nassert.deepEqual(src.indexToPosition(2), { line: 1, column: 2 });\n\n// rangeToLocation([ number, number ]) -> { start: { line: number, column: number}, end: { line: number, column: number } }\nassert.deepEqual(src.rangeToLocation([0, 2]), {\n    start: { line: 1, column: 0 },\n    end: { line: 1, column: 2 }\n});\n\n// locationToRange({ start: { line: number, column: number}, end: { line: number, column: number } }) -> [ number, number ]\nassert.deepEqual(src.locationToRange({\n    start: { line: 1, column: 0 },\n    end: { line: 1, column: 2 }\n}), [0, 2]);\n```\n\n### License\n\nCopyright (C) 2012-2014 [Yusuke Suzuki](http://github.com/Constellation)\n (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n  * Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n  * Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","_attachments":{},"homepage":"https://github.com/Constellation/structured-source","bugs":{"url":"https://github.com/Constellation/structured-source/issues"}}