{"_id":"sortedlist","_rev":"47-7c7c436466c0ccede0e2070fd59273f5","name":"sortedlist","description":"sorted list","dist-tags":{"latest":"0.3.1"},"versions":{"0.0.1":{"name":"sortedlist","version":"0.0.1","main":"./SortedList.js","engines":{"node":"*"},"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"description":"sorted list in JavaScript","tags":["sort","list","algorithm"],"_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.0.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.5.9","_defaultsLoaded":true,"dist":{"shasum":"2c8d7f2308c4838c11d8ae6a7c873692fcc1bb04","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.0.1.tgz","integrity":"sha512-RDj4hkzMWkgFytlU4rZdibinxHBovuSq76bUWULm911UWLfLWWwdHomGO7TdJhauE/hcrnqcs4Z3IROFemhNDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1l/dTewAG0mz2Qq3j+pzE32rcEP0/AcxNwL8CeRxO+AIhAJYL0Rklg1UyC2KMjRQGtBJE07hNH5XPJ4sh97N6frpl"}]},"maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.1.0":{"name":"sortedlist","version":"0.1.0","description":"sorted list","tags":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.1.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"acbc17ab891c0a829605535a9b93abc6019c2734","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.1.0.tgz","integrity":"sha512-TMijNnOzrDTL6cKF56uNk3Hi+osBNkf9w6ElJKXTKJSDPh0kroKDE1aYQcbl9pqHlwK+tSKal0NaV1EpN+OYCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6my0ZYh+2P+wIUQyeK71TKxKTMHPvJODJVT6xnvhfvgIhANPQ92r6RapFbzWf0QNY7gXDecZkJlsPG7qwe1oFWaQ4"}]},"maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.1.1":{"name":"sortedlist","version":"0.1.1","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.1.1","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"6b43073847e634cef38f6d52011c61419fb6597f","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.1.1.tgz","integrity":"sha512-iKhHhBuAafwEqhDEFV7gyUQyXu+fh4hwpYVbGFccHyQSjKPKK7oowciDZimUUycBDU88QtcdYzUF3PYVtJVPXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUoe+RRst8LfbPwxAAaiGM/K2BrmJjPXFTiQICRhN0fAiA75gTpwwcngxC6K5oKEcKf4bH/OIbTK3qiC7P3BpozJg=="}]},"readme":"SortedList\n==========\nsorted list in JavaScript\n\n### Installation ###\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n### Usage ###\n\n    // sort number\n    var list = new SortedList();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = new SortedList(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n\n### MORE ###\nsort ranges with no overlap\n\n    var list = new SortedList([\n      [152, 222],  // 4\n      [33, 53],    // 2\n      [48, 96],    // duplicated, so filtered.\n      [928, 1743], // 5\n      [66, 67],    // 3\n      [11, 12]     // 1\n    ],\n    {\n      // filter function: called before insertion.\n      filter: function(val, pos) {\n        if (isNull)\n        return (this.arr[pos]   == null || (this.arr[pos]   != null && this.arr[pos][1]  <  val[0])) \n          && \n               (this.arr[pos+1] == null || (this.arr[pos+1] != null && val[1] < this.arr[pos+1][0]));\n      },\n\n      // comparison function called before insertion.\n      compare: function(a, b) {\n        if (a == null) return -1;\n        if (b == null) return  1;\n        var c = a[0] - b[0];\n        return (c > 0) ? 1 : (c == 0)  ? 0 : -1;\n      }\n    });\n\n    console.log(list.toArray());\n    /* [\n      [ 11, 12 ],\n      [ 33, 53 ],\n      [ 66, 67 ],\n      [ 152, 222 ],\n      [ 928, 1743 ]\n    ] */\n\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.0":{"name":"sortedlist","version":"0.2.0","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.0","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"0f61d95c8c5b0bc714fa5a60e6cef7ea6444e8cb","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.0.tgz","integrity":"sha512-tq9ASaH0kmJsDWeHfF+luyRXoQAmQT7VJWBDqdqsLSPtAIHAYC0Tyoimznm+I+u3hwgnk03fQrmVGPXwr8t5kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWdAJQ0JwANsEICgXAeF3nfp7KgdfUfwsSXFeIkOrSiQIhAPnJIGinMQ8imJp12f1wSLU2kc1x5GPlC4A+7L3gSah7"}]},"readme":"SortedList\n==========\nsorted list in JavaScript\n\n### Installation ###\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n### Usage ###\n\n    // sort number\n    var list = new SortedList();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = new SortedList(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n\n### MORE ###\nsort ranges with no overlap\n\n    var list = new SortedList([\n      [152, 222],  // 4\n      [33, 53],    // 2\n      [48, 96],    // duplicated, so filtered.\n      [928, 1743], // 5\n      [66, 67],    // 3\n      [11, 12]     // 1\n    ],\n    {\n      // filter function: called before insertion.\n      filter: function(val, pos) {\n        if (isNull)\n        return (this.arr[pos]   == null || (this.arr[pos]   != null && this.arr[pos][1]  <  val[0])) \n          && \n               (this.arr[pos+1] == null || (this.arr[pos+1] != null && val[1] < this.arr[pos+1][0]));\n      },\n\n      // comparison function called before insertion.\n      compare: function(a, b) {\n        if (a == null) return -1;\n        if (b == null) return  1;\n        var c = a[0] - b[0];\n        return (c > 0) ? 1 : (c == 0)  ? 0 : -1;\n      }\n    });\n\n    console.log(list.toArray());\n    /* [\n      [ 11, 12 ],\n      [ 33, 53 ],\n      [ 66, 67 ],\n      [ 152, 222 ],\n      [ 928, 1743 ]\n    ] */\n\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.1":{"name":"sortedlist","version":"0.2.1","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.1","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"d74a388e7720f4335cea0d1fe9dbeddadfe6d153","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.1.tgz","integrity":"sha512-zAvHYdyZII53Z41tGqxiZHpYJ91+dpZqyimKl0zkbVkoxmM7kTcSCDie7ijkVhYpP/w6bI0HrzNxJwIVaWHIOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzzQbcqJWA77dgc7yzZY9TvJJ4sV9Z9kUVParmrQg5gQIhAKVjfT1W//0XvV0EJS+fdVHR6tnLnZvAR/tKphmEwZJZ"}]},"readme":"SortedList\n==========\nsorted list in JavaScript\n\n### Installation ###\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n### Usage ###\n\n    // sort number\n    var list = new SortedList();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = new SortedList(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n\n### MORE ###\nsort ranges with no overlap\n\n    var list = new SortedList([\n      [152, 222],  // 4\n      [33, 53],    // 2\n      [48, 96],    // duplicated, so filtered.\n      [928, 1743], // 5\n      [66, 67],    // 3\n      [11, 12]     // 1\n    ],\n    {\n      // filter function: called before insertion.\n      filter: function(val, pos) {\n        if (isNull)\n        return (this.arr[pos]   == null || (this.arr[pos]   != null && this.arr[pos][1]  <  val[0])) \n          && \n               (this.arr[pos+1] == null || (this.arr[pos+1] != null && val[1] < this.arr[pos+1][0]));\n      },\n\n      // comparison function called before insertion.\n      compare: function(a, b) {\n        if (a == null) return -1;\n        if (b == null) return  1;\n        var c = a[0] - b[0];\n        return (c > 0) ? 1 : (c == 0)  ? 0 : -1;\n      }\n    });\n\n    console.log(list.toArray());\n    /* [\n      [ 11, 12 ],\n      [ 33, 53 ],\n      [ 66, 67 ],\n      [ 152, 222 ],\n      [ 928, 1743 ]\n    ] */\n\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.2":{"name":"sortedlist","version":"0.2.2","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.2","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"08d1e5d105f6f6e9ad32bab24abcb9bf3ce7837f","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.2.tgz","integrity":"sha512-A0SCaZFxq39j07bYXhMsIVrSTY7D0XYQeYowC35rOE5k8Vb8g8w6ZMNSRACBWS0BiBlg8LubQWX625eHTOR1Wg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3npCXN1KhOx/NKK/4h+lcqJOUAzKIGg55dz22xI1hGwIhAIjpD+FSLk108DnuSC5mMYETMeI4nQXeu3IQpt9syfrg"}]},"readme":"SortedList\n==========\nsorted list in JavaScript\n\n### Installation ###\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n### Usage ###\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n### MORE ###\nsort ranges with no overlap\n\n    var list = SortedList.create([\n      [152, 222],  // 4\n      [33, 53],    // 2\n      [48, 96],    // duplicated, so filtered.\n      [928, 1743], // 5\n      [66, 67],    // 3\n      [11, 12]     // 1\n    ],\n    {\n      // filter function: called before insertion.\n      filter: function(val, pos) {\n        return (this[pos]   == null || (this[pos]   != null && this[pos][1]  <  val[0])) \n          && \n               (this[pos+1] == null || (this[pos+1] != null && val[1] < this[pos+1][0]));\n      },\n\n      // comparison function called before insertion.\n      compare: function(a, b) {\n        if (a == null) return -1;\n        if (b == null) return  1;\n        var c = a[0] - b[0];\n        return (c > 0) ? 1 : (c == 0)  ? 0 : -1;\n      }\n    });\n\n    console.log(list.toArray());\n    /* [\n      [ 11, 12 ],\n      [ 33, 53 ],\n      [ 66, 67 ],\n      [ 152, 222 ],\n      [ 928, 1743 ]\n    ] */\n\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.3":{"name":"sortedlist","version":"0.2.3","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.3","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"b4d74363cb9e67f1aa4bc28424de1bf2b7193c64","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.3.tgz","integrity":"sha512-1hHVlrAl6BWidF54+x0XtAdrnR1JK2baAJpEf52u8ZBoiu1DQHZ+SesGgn3UQ7LmyGYSvMTNjhSWXarErKXKVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5Rm0+vI7tbnGbcrZ2GXhKQ0iYa4XO4x5dG4IJ6+p5+AIgPB89o43W8GXzLAusvIbP70AWTNxKmjbhR0Wf4A46jCM="}]},"readme":"SortedList\n==========\nsorted list in JavaScript\n\n### Installation ###\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n### Usage ###\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already sorted array\n    var list = SortedList.create(0,1,2,3,4, { resume: true });\n\n### MORE ###\nsort ranges with no overlap\n\n    var list = SortedList.create([\n      [152, 222],  // 4\n      [33, 53],    // 2\n      [48, 96],    // duplicated, so filtered.\n      [928, 1743], // 5\n      [66, 67],    // 3\n      [11, 12]     // 1\n    ],\n    {\n      // filter function: called before insertion.\n      filter: function(val, pos) {\n        return (this[pos]   == null || (this[pos]   != null && this[pos][1]  <  val[0])) \n          && \n               (this[pos+1] == null || (this[pos+1] != null && val[1] < this[pos+1][0]));\n      },\n\n      // comparison function called before insertion.\n      compare: function(a, b) {\n        if (a == null) return -1;\n        if (b == null) return  1;\n        var c = a[0] - b[0];\n        return (c > 0) ? 1 : (c == 0)  ? 0 : -1;\n      }\n    });\n\n    console.log(list.toArray());\n    /* [\n      [ 11, 12 ],\n      [ 33, 53 ],\n      [ 66, 67 ],\n      [ 152, 222 ],\n      [ 928, 1743 ]\n    ] */\n\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.4":{"name":"sortedlist","version":"0.2.4","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.4","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"4de96e551c3b9aa93f567e3973997915e04d1498","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.4.tgz","integrity":"sha512-iQVK1fMGcyHU9ALoI/3iX9V532rET/YCEQTbiWjCYPO+fclZMuFG9IZwQ6XhmTRNt+KGF6nMpjY6CJSFLtcVSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHR8oSFiMGA1E+e4CRCdG4kjQMrikT0PRi/4NtkIhMePAiEAg6nmEblxaoKZLXP4AeiTmrPeMhYAPEM1dPfg9grs8wc="}]},"readme":"SortedList\n==========\nsorted list in JavaScript\n\n### Installation ###\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n### Usage ###\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create(0,1,2,3,4, { resume: true });\n\n### MORE ###\n- unique\n\n    sorted.unique();\n\n- get first key\n\n    var index = sorted.key(value);\n\n\n- sort ranges with no overlap\n\n    var list = SortedList.create([\n      [152, 222],  // 4\n      [33, 53],    // 2\n      [48, 96],    // duplicated, so filtered.\n      [928, 1743], // 5\n      [66, 67],    // 3\n      [11, 12]     // 1\n    ],\n    {\n      // filter function: called before insertion.\n      filter: function(val, pos) {\n        return (this[pos]   == null || (this[pos]   != null && this[pos][1]  <  val[0])) \n          && \n               (this[pos+1] == null || (this[pos+1] != null && val[1] < this[pos+1][0]));\n      },\n\n      // comparison function called before insertion.\n      compare: function(a, b) {\n        if (a == null) return -1;\n        if (b == null) return  1;\n        var c = a[0] - b[0];\n        return (c > 0) ? 1 : (c == 0)  ? 0 : -1;\n      }\n    });\n\n    console.log(list.toArray());\n    /* [\n      [ 11, 12 ],\n      [ 33, 53 ],\n      [ 66, 67 ],\n      [ 152, 222 ],\n      [ 928, 1743 ]\n    ] */\n\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.5":{"name":"sortedlist","version":"0.2.5","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.5","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"f252a1df6176471c792d03a77c84148858166f70","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.5.tgz","integrity":"sha512-w/acCsQNBYkcfP1Ov/eTF+Euzv3p4mFOlNlhkA/eh5fPdK6e7GrMg6AVmwQTVt4bX++kw/FlNbjVQDlm58Os9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDpa9sGa2T4ozNhdJszYZVkZzL0LOhA3CyrJKx8//pzwIgOT6Pdku+UWFLO7LgBAK7jTe9dW5rC+e6xUO0mPzWRXo="}]},"readme":"SortedList\n==========\nsorted list in JavaScript (browsers (ES5 compatible), Node.js)\n\n## Installation ##\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n## Usage ##\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create([0,1,2,3,4], { resume: true });\n\n## API Documentation ##\n- SortedList.create(options, arr)\n- sortedList.insertOne(val)\n- sortedList.insert(val1, val2, ...)\n- sortedList.remove(pos)\n- sortedList.unique(createNew)\n- sortedList.bsearch(val)\n- sortedList.key(val)\n- sortedList.toArray()\n\n\n### SortedList.create(options, arr) ###\ncreate an instance of SortedList.\n\n**options** is option object as follows.\n<table>\n<tr><th>key</th>\n<td>type</td>\n<td>description</td>\n<td>example</td></tr>\n\n<tr><th>filter</th>\n<td>function</td>\n<td>\nregister a filtration function which returns boolean indicating valid value, running before insertion.\nBy default, function(v) { returns true }, that is, no filtration.\n</td>\n<td>function (v) { return !isNaN(Number(v) }</td>\n</tr>\n\n<tr><th>compare</th>\n<td>one of \"string\", \"number\"</td>\n<td>\ncomparison function comparing two strings or two numbers asc.<br>\nBy default, \"number\" comparison.\n</td>\n<td>\"number\"</td>\n</tr>\n\n<tr><th>compare</th>\n<td>function</td>\n<td>\na custom comparison function which returns one of [1, 0, -1].<br>\nThe same spec as Array#sort(fn).\nSee <a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort\">Mozilla official site</a>.\n</td>\n<td>function(a,b) { return a.start - b.start }</td>\n</tr>\n\n<tr><th>resume</th>\n<td>boolean</td>\n<td>\nif true, sets the array given in the second arguments with no filtration\n</td>\n<td>true</td>\n</tr>\n</table>\n\n**arr** is a initial value. All elements are shallowly copied.\n\nReturns an instance of SortedList.\n\n### sortedList.insertOne(val) ###\nInserts **val** to the list. \n\nReturns inserted position if succeeded, false if failed.\n\n\n### sortedList.insert(val1, val2, ...) ###\nInserts **val1** **val2**, ... to the list.\n\nReturns list of the result of executing insertOne(val).\n\n    console.log(SortedList.create().insert(3,1,2,4,5));\n    // [0,0,1,3,4]\n\n### sortedList.remove(pos) ###\nRemoves a value in the position **pos**.\n\nReturns this.\n\n### sortedList.unique(createNew) ###\nMake the list unique.\nIf **createNew** is true, returns a new array.\n\nOtherwise, duplicated elements are internally removed, and this method returns this.\n\n### sortedList.bsearch(val) ###\nExecutes binary search with the given **val**.\nReturns the position before insertion.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.bsearch(4)); // 2\n    console.log(list.bsearch(5)); // 2\n    console.log(list.bsearch(0)); // -1\n    console.log(list.bsearch(12)); // 4\n\n### sortedList.key(val) ###\nIf the given **val** exists, returns the position.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.key(4)); // 2\n    console.log(list.key(5)); // null\n    console.log(list.key(1)); // 0\n    console.log(list.key(10)); // 4\n\n### sortedList.toArray() ###\nCreates a new array with this list.\n\n## SortedList extends Array ###\nAs SortedList extends Array, we can use every method in Array.\n\n    var list = SortedList.create([1,2,4,6,10]);\n\n    console.log(list[2]) // 4\n\n    list.forEach(function(total, v) {\n      // ...\n    });\n\n    var newArr = list.map(function(total, v) {\n      // ...\n    });\n\nBe careful of these differences.\n\n    Array.isArray(SortedList.create()) // false\n    (SortedList.create()) instanceof Array // true\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.6":{"name":"sortedlist","version":"0.2.6","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.6","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"83e771a0c9e1fdef89fd8bc5a446b0b7fd5bfd84","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.6.tgz","integrity":"sha512-D4fm43d3aNuHVVdiXgdgx+87sLjetCfmaEaF7RvOX6KJQIikQyZZf4uxg/koxd0qUst5rD1BTE76uOrqmJmbNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHQlzhAv22i5E8EdtYUFf3YvgZAQhqNn7HFds6CTTDj4AiBYmEEX1FqUXvJbY2MuzClnBXRwqcWLp8AKGttrGtTjCA=="}]},"readme":"SortedList\n==========\nsorted list in JavaScript (browsers (ES5 compatible), Node.js)\n\n## Installation ##\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n## Usage ##\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create([0,1,2,3,4], { resume: true });\n\n## API Documentation ##\n- SortedList.create(options, arr)\n- sortedList.insertOne(val)\n- sortedList.insert(val1, val2, ...)\n- sortedList.remove(pos)\n- sortedList.unique(createNew)\n- sortedList.bsearch(val)\n- sortedList.key(val)\n- sortedList.keys(val)\n- sortedList.toArray()\n\n\n### SortedList.create(options, arr) ###\ncreate an instance of SortedList.\n\n**options** is option object as follows.\n<table>\n<tr><th>key</th>\n<td>type</td>\n<td>description</td>\n<td>example</td></tr>\n\n<tr><th>filter</th>\n<td>function</td>\n<td>\nregister a filtration function which returns boolean indicating valid value, running before insertion.\nBy default, function(v) { returns true }, that is, no filtration.\n</td>\n<td>function (v) { return !isNaN(Number(v) }</td>\n</tr>\n\n<tr><th>compare</th>\n<td>one of \"string\", \"number\"</td>\n<td>\ncomparison function comparing two strings or two numbers asc.<br>\nBy default, \"number\" comparison.\n</td>\n<td>\"number\"</td>\n</tr>\n\n<tr><th>compare</th>\n<td>function</td>\n<td>\na custom comparison function which returns one of [1, 0, -1].<br>\nThe same spec as Array#sort(fn).\nSee <a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort\">Mozilla official site</a>.\n</td>\n<td>function(a,b) { return a.start - b.start }</td>\n</tr>\n\n<tr><th>resume</th>\n<td>boolean</td>\n<td>\nif true, sets the array given in the second arguments with no filtration\n</td>\n<td>true</td>\n</tr>\n</table>\n\n**arr** is a initial value. All elements are shallowly copied.\n\nReturns an instance of SortedList.\n\n### sortedList.insertOne(val) ###\nInserts **val** to the list. \n\nReturns inserted position if succeeded, false if failed.\n\n\n### sortedList.insert(val1, val2, ...) ###\nInserts **val1** **val2**, ... to the list.\n\nReturns list of the result of executing insertOne(val).\n\n    console.log(SortedList.create().insert(3,1,2,4,5));\n    // [0,0,1,3,4]\n\n### sortedList.remove(pos) ###\nRemoves a value in the position **pos**.\n\nReturns this.\n\n### sortedList.unique(createNew) ###\nMake the list unique.\nIf **createNew** is true, returns a new array.\n\nOtherwise, duplicated elements are internally removed, and this method returns this.\n\n### sortedList.bsearch(val) ###\nExecutes binary search with the given **val**.\nReturns the position before insertion.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.bsearch(4)); // 2\n    console.log(list.bsearch(5)); // 2\n    console.log(list.bsearch(0)); // -1\n    console.log(list.bsearch(12)); // 4\n\n### sortedList.key(val) ###\nIf the given **val** exists, returns the first position.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.key(10)); // 6\n    console.log(list.key(4)); // 2\n    console.log(list.key(5)); // null\n    console.log(list.key(1)); // 0\n\n### sortedList.keys(val) ###\nIf the given **val** exists, returns an array of all the positions with **val**.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.keys(10)); // [4]\n    console.log(list.keys(4)); // [2, 3, 4]\n    console.log(list.keys(5)); // null\n    console.log(list.keys(1)); // [0]\n\n\n### sortedList.toArray() ###\nCreates a new array with this list.\n\n## SortedList extends Array ###\nAs SortedList extends Array, we can use every method in Array.\n\n    var list = SortedList.create([1,2,4,6,10]);\n\n    console.log(list[2]) // 4\n\n    list.forEach(function(total, v) {\n      // ...\n    });\n\n    var newArr = list.map(function(total, v) {\n      // ...\n    });\n\nBe careful of these differences.\n\n    Array.isArray(SortedList.create()) // false\n    (SortedList.create()) instanceof Array // true\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.7":{"name":"sortedlist","version":"0.2.7","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.7","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"9a21ababc2ff22ddc7625896d368f7593caf31af","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.7.tgz","integrity":"sha512-IIfokJmAA6+/S/+x4cZ6Wi3/lO5Ld4GwGb/bSIAtI+my6QrrRmLxZwtYBTwMtntcfNKZF/HE/EjM8bOclRfNQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGQst4AxSeT4btjvxl5jIMqDnOIov4foDf7UbmhyCe0wIhAPGydh69a5O+JkWOqwqudtkkLx8WToxmobiaWcunBSnK"}]},"readme":"SortedList\n==========\nsorted list in JavaScript (browsers (ES5 compatible), Node.js)\n\n## Installation ##\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n## Usage ##\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create([0,1,2,3,4], { resume: true });\n\n## API Documentation ##\n- SortedList.create(options, arr)\n- sortedList.insertOne(val)\n- sortedList.insert(val1, val2, ...)\n- sortedList.remove(pos)\n- sortedList.unique(createNew)\n- sortedList.bsearch(val)\n- sortedList.key(val)\n- sortedList.keys(val)\n- sortedList.toArray()\n\n\n### SortedList.create(options, arr) ###\ncreate an instance of SortedList.\n\n**options** is option object as follows.\n<table>\n<tr><th>key</th>\n<td>type</td>\n<td>description</td>\n<td>example</td></tr>\n\n<tr><th>unique</th>\n<td>boolean</td>\n<td>filter unique values in insertion.</td>\n<td>true</td>\n</tr>\n\n<tr><th>filter</th>\n<td>function</td>\n<td>\nregister a filtration function which returns boolean indicating valid value, running before insertion.\nBy default, function(v) { returns true }, that is, no filtration.\n</td>\n<td>function (v) { return !isNaN(Number(v) }</td>\n</tr>\n\n<tr><th>compare</th>\n<td>one of \"string\", \"number\"</td>\n<td>\ncomparison function comparing two strings or two numbers asc.<br>\nBy default, \"number\" comparison.\n</td>\n<td>\"number\"</td>\n</tr>\n\n<tr><th>compare</th>\n<td>function</td>\n<td>\na custom comparison function which returns one of [1, 0, -1].<br>\nThe same spec as Array#sort(fn).\nSee <a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort\">Mozilla official site</a>.\n</td>\n<td>function(a,b) { return a.start - b.start }</td>\n</tr>\n\n<tr><th>resume</th>\n<td>boolean</td>\n<td>\nif true, sets the array given in the second arguments with no filtration\n</td>\n<td>true</td>\n</tr>\n</table>\n\n**arr** is a initial value. All elements are shallowly copied.\n\nReturns an instance of SortedList.\n\n### sortedList.insertOne(val) ###\nInserts **val** to the list. \n\nReturns inserted position if succeeded, false if failed.\n\n\n### sortedList.insert(val1, val2, ...) ###\nInserts **val1** **val2**, ... to the list.\n\nReturns list of the result of executing insertOne(val).\n\n    console.log(SortedList.create().insert(3,1,2,4,5));\n    // [0,0,1,3,4]\n\n### sortedList.remove(pos) ###\nRemoves a value in the position **pos**.\n\nReturns this.\n\n### sortedList.unique(createNew) ###\nMake the list unique.\nIf **createNew** is true, returns a new array.\n\nOtherwise, duplicated elements are internally removed, and this method returns this.\n\n### sortedList.bsearch(val) ###\nExecutes binary search with the given **val**.\nReturns the position before insertion.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.bsearch(4)); // 2\n    console.log(list.bsearch(5)); // 2\n    console.log(list.bsearch(0)); // -1\n    console.log(list.bsearch(12)); // 4\n\n### sortedList.key(val) ###\nIf the given **val** exists, returns the first position.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.key(10)); // 6\n    console.log(list.key(4)); // 2\n    console.log(list.key(5)); // null\n    console.log(list.key(1)); // 0\n\n### sortedList.keys(val) ###\nIf the given **val** exists, returns an array of all the positions with **val**.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.keys(10)); // [4]\n    console.log(list.keys(4)); // [2, 3, 4]\n    console.log(list.keys(5)); // null\n    console.log(list.keys(1)); // [0]\n\n\n### sortedList.toArray() ###\nCreates a new array with this list.\n\n## SortedList extends Array ###\nAs SortedList extends Array, we can use every method in Array.\n\n    var list = SortedList.create([1,2,4,6,10]);\n\n    console.log(list[2]) // 4\n\n    list.forEach(function(total, v) {\n      // ...\n    });\n\n    var newArr = list.map(function(total, v) {\n      // ...\n    });\n\nBe careful of these differences.\n\n    Array.isArray(SortedList.create()) // false\n    (SortedList.create()) instanceof Array // true\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.2.8":{"name":"sortedlist","version":"0.2.8","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"_id":"sortedlist@0.2.8","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"123202cdf4867828cefebdadf0c12dfaa0acbf4c","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.2.8.tgz","integrity":"sha512-8lCmSVvRnk8jAxZObwvUTXDkB8EEHHKhso/SrD6o8laylAbhgjGNgvgJwV20TknlFjxNTWUyc8zBmtiSYt+OgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFB30OfCeq8FyrClq406QPNs7XQOg82S3vknnJqE5yCmAiBgzjZYSuOTfl1rKvBLXLWZT6FMjXDl0fEciRq9nDVEag=="}]},"readme":"SortedList\n==========\nsorted list in JavaScript (browsers (ES5 compatible), Node.js)\n\n## Installation ##\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n## Usage ##\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create([0,1,2,3,4], { resume: true });\n\n## API Documentation ##\n- SortedList.create(options, arr)\n- sortedList.insertOne(val)\n- sortedList.insert(val1, val2, ...)\n- sortedList.remove(pos)\n- sortedList.unique(createNew)\n- sortedList.bsearch(val)\n- sortedList.key(val)\n- sortedList.keys(val)\n- sortedList.toArray()\n\n\n### SortedList.create(options, arr) ###\ncreate an instance of SortedList.\n\n**options** is option object as follows.\n<table>\n<tr><th>key</th>\n<td>type</td>\n<td>description</td>\n<td>example</td></tr>\n\n<tr><th>unique</th>\n<td>boolean</td>\n<td>filter unique values in insertion.</td>\n<td>true</td>\n</tr>\n\n<tr><th>filter</th>\n<td>function</td>\n<td>\nregister a filtration function which returns boolean indicating valid value, running before insertion.\nBy default, function(v) { returns true }, that is, no filtration.\n</td>\n<td>function (v) { return !isNaN(Number(v) }</td>\n</tr>\n\n<tr><th>compare</th>\n<td>one of \"string\", \"number\"</td>\n<td>\ncomparison function comparing two strings or two numbers asc.<br>\nBy default, \"number\" comparison.\n</td>\n<td>\"number\"</td>\n</tr>\n\n<tr><th>compare</th>\n<td>function</td>\n<td>\na custom comparison function which returns one of [1, 0, -1].<br>\nThe same spec as Array#sort(fn).\nSee <a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort\">Mozilla official site</a>.\n</td>\n<td>function(a,b) { return a.start - b.start }</td>\n</tr>\n\n<tr><th>resume</th>\n<td>boolean</td>\n<td>\nif true, sets the array given in the second arguments with no filtration\n</td>\n<td>true</td>\n</tr>\n</table>\n\n**arr** is a initial value. All elements are shallowly copied.\n\nReturns an instance of SortedList.\n\n### sortedList.insertOne(val) ###\nInserts **val** to the list. \n\nReturns inserted position if succeeded, false if failed.\n\n\n### sortedList.insert(val1, val2, ...) ###\nInserts **val1** **val2**, ... to the list.\n\nReturns list of the result of executing insertOne(val).\n\n    console.log(SortedList.create().insert(3,1,2,4,5));\n    // [0,0,1,3,4]\n\n### sortedList.remove(pos) ###\nRemoves a value in the position **pos**.\n\nReturns this.\n\n### sortedList.unique(createNew) ###\nMake the list unique.\nIf **createNew** is true, returns a new array.\n\nOtherwise, duplicated elements are internally removed, and this method returns this.\n\n### sortedList.bsearch(val) ###\nExecutes binary search with the given **val**.\nReturns the position before insertion.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.bsearch(4)); // 2\n    console.log(list.bsearch(5)); // 2\n    console.log(list.bsearch(0)); // -1\n    console.log(list.bsearch(12)); // 4\n\n### sortedList.key(val) ###\nIf the given **val** exists, returns the first position.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.key(10)); // 6\n    console.log(list.key(4)); // 2\n    console.log(list.key(5)); // null\n    console.log(list.key(1)); // 0\n\n### sortedList.keys(val) ###\nIf the given **val** exists, returns an array of all the positions with **val**.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.keys(10)); // [4]\n    console.log(list.keys(4)); // [2, 3, 4]\n    console.log(list.keys(5)); // null\n    console.log(list.keys(1)); // [0]\n\n\n### sortedList.toArray() ###\nCreates a new array with this list.\n\n## SortedList extends Array ###\nAs SortedList extends Array, we can use every method in Array.\n\n    var list = SortedList.create([1,2,4,6,10]);\n\n    console.log(list[2]) // 4\n\n    list.forEach(function(total, v) {\n      // ...\n    });\n\n    var newArr = list.map(function(total, v) {\n      // ...\n    });\n\nBe careful of these differences.\n\n    Array.isArray(SortedList.create()) // false\n    (SortedList.create()) instanceof Array // true\n","maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.3.0":{"name":"sortedlist","version":"0.3.0","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","readme":"SortedList\n==========\nsorted list in JavaScript (browsers (ES5 compatible), Node.js)\n\n## Installation ##\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n## Usage ##\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create([0,1,2,3,4], { resume: true });\n\n## API Documentation ##\n- SortedList.create(options, arr)\n- sortedList.insertOne(val)\n- sortedList.insert(val1, val2, ...)\n- sortedList.remove(pos)\n- sortedList.unique(createNew)\n- sortedList.bsearch(val)\n- sortedList.key(val)\n- sortedList.keys(val)\n- sortedList.toArray()\n\n\n### SortedList.create(options, arr) ###\ncreate an instance of SortedList.\n\n**options** is option object as follows.\n<table>\n<tr><th>key</th>\n<td>type</td>\n<td>description</td>\n<td>example</td></tr>\n\n<tr><th>unique</th>\n<td>boolean</td>\n<td>filter unique values in insertion.</td>\n<td>true</td>\n</tr>\n\n<tr><th>filter</th>\n<td>function</td>\n<td>\nregister a filtration function which returns boolean indicating valid value, running before insertion.\nBy default, function(v) { returns true }, that is, no filtration.\n</td>\n<td>function (v) { return !isNaN(Number(v) }</td>\n</tr>\n\n<tr><th>compare</th>\n<td>one of \"string\", \"number\"</td>\n<td>\ncomparison function comparing two strings or two numbers asc.<br>\nBy default, \"number\" comparison.\n</td>\n<td>\"number\"</td>\n</tr>\n\n<tr><th>compare</th>\n<td>function</td>\n<td>\na custom comparison function which returns one of [1, 0, -1].<br>\nThe same spec as Array#sort(fn).\nSee <a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort\">Mozilla official site</a>.\n</td>\n<td>function(a,b) { return a.start - b.start }</td>\n</tr>\n\n<tr><th>resume</th>\n<td>boolean</td>\n<td>\nif true, sets the array given in the second arguments with no filtration\n</td>\n<td>true</td>\n</tr>\n</table>\n\n**arr** is a initial value. All elements are shallowly copied.\n\nReturns an instance of SortedList.\n\n### sortedList.insertOne(val) ###\nInserts **val** to the list. \n\nReturns inserted position if succeeded, false if failed.\n\n\n### sortedList.insert(val1, val2, ...) ###\nInserts **val1** **val2**, ... to the list.\n\nReturns list of the result of executing insertOne(val).\n\n    console.log(SortedList.create().insert(3,1,2,4,5));\n    // [0,0,1,3,4]\n\n### sortedList.remove(pos) ###\nRemoves a value in the position **pos**.\n\nReturns this.\n\n### sortedList.unique(createNew) ###\nMake the list unique.\nIf **createNew** is true, returns a new array.\n\nOtherwise, duplicated elements are internally removed, and this method returns this.\n\n### sortedList.bsearch(val) ###\nExecutes binary search with the given **val**.\nReturns the position before insertion.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.bsearch(4)); // 2\n    console.log(list.bsearch(5)); // 2\n    console.log(list.bsearch(0)); // -1\n    console.log(list.bsearch(12)); // 4\n\n### sortedList.key(val) ###\nIf the given **val** exists, returns the first position.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.key(10)); // 6\n    console.log(list.key(4)); // 2\n    console.log(list.key(5)); // null\n    console.log(list.key(1)); // 0\n\n### sortedList.keys(val) ###\nIf the given **val** exists, returns an array of all the positions with **val**.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.keys(10)); // [4]\n    console.log(list.keys(4)); // [2, 3, 4]\n    console.log(list.keys(5)); // null\n    console.log(list.keys(1)); // [0]\n\n\n### sortedList.toArray() ###\nCreates a new array with this list.\n\n## SortedList extends Array ###\nAs SortedList extends Array, we can use every method in Array.\n\n    var list = SortedList.create([1,2,4,6,10]);\n\n    console.log(list[2]) // 4\n\n    list.forEach(function(total, v) {\n      // ...\n    });\n\n    var newArr = list.map(function(total, v) {\n      // ...\n    });\n\nBe careful of these differences.\n\n    Array.isArray(SortedList.create()) // false\n    (SortedList.create()) instanceof Array // true\n","readmeFilename":"README.md","_id":"sortedlist@0.3.0","dist":{"shasum":"3df63016742ba5fb68a76e4689f900bb6389f6ea","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.3.0.tgz","integrity":"sha512-pBJsdgvYEAZLPyRk5SBQZooIBwzwkv2GJYs/P+ZQxJsRAaMeo8pdm2Jw8vf9GcPcx8kmQbldaQXoSrEQV16Y5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhkxmioZX3tKROJZuThYKWKZZpDTzIYeP+AMPsJq6moAIhAIFlqO8vikTmMY5tfB38hH34BqZJMd5Fu7QCjSoaQvKF"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"directories":{}},"0.3.1":{"name":"sortedlist","version":"0.3.1","description":"sorted list","keywords":["sort","list","bsearch","algorithm"],"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"},"main":"./SortedList.js","readme":"SortedList\n==========\nsorted list in JavaScript (browsers (ES5 compatible), Node.js)\n\n## Installation ##\n    git clone git://github.com/shinout/SortedList.git\n\n    OR\n\n    npm install sortedlist\n\n## Usage ##\n\n    // sort number\n    var list = SortedList.create();\n    list.insert(13, 2, 9, 8, 0);\n    console.log(list.toArray()); // [0,2,8,9,13]\n\n    // sort string\n    var arr = [\"foo\", \"bar\", \"hoge\"];\n    var strList = SortedList.create(arr, {\n      compare: \"string\"\n    });\n    console.log(strList.toArray()); // [\"bar\", \"foo\", \"hoge\"]\n\n    // SortedList is not Array\n    console.assert(!Array.isArray(list));\n\n    // SortedList is instanceof Array\n    console.assert(list instanceof Array);\n\n    // SortedList extends Array\n    console.assert(list[2], 8);\n    console.assert(list.length, 5);\n    console.assert(list.pop(), 13);\n\n    // register an already filtered array\n    var list = SortedList.create([0,1,2,3,4], { resume: true });\n\n## API Documentation ##\n- SortedList.create(options, arr)\n- sortedList.insertOne(val)\n- sortedList.insert(val1, val2, ...)\n- sortedList.remove(pos)\n- sortedList.unique(createNew)\n- sortedList.bsearch(val)\n- sortedList.key(val)\n- sortedList.keys(val)\n- sortedList.toArray()\n\n\n### SortedList.create(options, arr) ###\ncreate an instance of SortedList.\n\n**options** is option object as follows.\n<table>\n<tr><th>key</th>\n<td>type</td>\n<td>description</td>\n<td>example</td></tr>\n\n<tr><th>unique</th>\n<td>boolean</td>\n<td>filter unique values in insertion.</td>\n<td>true</td>\n</tr>\n\n<tr><th>filter</th>\n<td>function</td>\n<td>\nregister a filtration function which returns boolean indicating valid value, running before insertion.\nBy default, function(v) { returns true }, that is, no filtration.\n</td>\n<td>function (v) { return !isNaN(Number(v) }</td>\n</tr>\n\n<tr><th>compare</th>\n<td>one of \"string\", \"number\"</td>\n<td>\ncomparison function comparing two strings or two numbers asc.<br>\nBy default, \"number\" comparison.\n</td>\n<td>\"number\"</td>\n</tr>\n\n<tr><th>compare</th>\n<td>function</td>\n<td>\na custom comparison function which returns one of [1, 0, -1].<br>\nThe same spec as Array#sort(fn).\nSee <a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort\">Mozilla official site</a>.\n</td>\n<td>function(a,b) { return a.start - b.start }</td>\n</tr>\n\n<tr><th>resume</th>\n<td>boolean</td>\n<td>\nif true, sets the array given in the second arguments with no filtration\n</td>\n<td>true</td>\n</tr>\n</table>\n\n**arr** is a initial value. All elements are shallowly copied.\n\nReturns an instance of SortedList.\n\n### sortedList.insertOne(val) ###\nInserts **val** to the list. \n\nReturns inserted position if succeeded, false if failed.\n\n\n### sortedList.insert(val1, val2, ...) ###\nInserts **val1** **val2**, ... to the list.\n\nReturns list of the result of executing insertOne(val).\n\n    console.log(SortedList.create().insert(3,1,2,4,5));\n    // [0,0,1,3,4]\n\n### sortedList.remove(pos) ###\nRemoves a value in the position **pos**.\n\nReturns this.\n\n### sortedList.unique(createNew) ###\nMake the list unique.\nIf **createNew** is true, returns a new array.\n\nOtherwise, duplicated elements are internally removed, and this method returns this.\n\n### sortedList.bsearch(val) ###\nExecutes binary search with the given **val**.\nReturns the position before insertion.\n\n    var list = SortedList.create([1,2,4,6,10]);\n    console.log(list.bsearch(4)); // 2\n    console.log(list.bsearch(5)); // 2\n    console.log(list.bsearch(0)); // -1\n    console.log(list.bsearch(12)); // 4\n\n### sortedList.key(val) ###\nIf the given **val** exists, returns the first position.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.key(10)); // 6\n    console.log(list.key(4)); // 2\n    console.log(list.key(5)); // null\n    console.log(list.key(1)); // 0\n\n### sortedList.keys(val) ###\nIf the given **val** exists, returns an array of all the positions with **val**.\n\nOtherwise, returns null.\n\n    var list = SortedList.create([1,2,4,4,4,6,10]);\n    console.log(list.keys(10)); // [4]\n    console.log(list.keys(4)); // [2, 3, 4]\n    console.log(list.keys(5)); // null\n    console.log(list.keys(1)); // [0]\n\n\n### sortedList.toArray() ###\nCreates a new array with this list.\n\n## SortedList extends Array ###\nAs SortedList extends Array, we can use every method in Array.\n\n    var list = SortedList.create([1,2,4,6,10]);\n\n    console.log(list[2]) // 4\n\n    list.forEach(function(total, v) {\n      // ...\n    });\n\n    var newArr = list.map(function(total, v) {\n      // ...\n    });\n\nBe careful of these differences.\n\n    Array.isArray(SortedList.create()) // false\n    (SortedList.create()) instanceof Array // true\n","readmeFilename":"README.md","_id":"sortedlist@0.3.1","dist":{"shasum":"1536ed80bcfe3688b60dee58156a01bb2bfbf5d2","tarball":"https://registry.npmjs.org/sortedlist/-/sortedlist-0.3.1.tgz","integrity":"sha512-qIuu3MQ16DHV1jjbpzBLuZs7OdUEVbYZZYFsjghtJnpj/BSPjkrkoF20uLbVQeHGaW569J4AudGKL92OtZfEZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXox61B0X+AW1etmFqUgVt4NO7xOEVKb89Ld3sLtIXlAiEA1VKqdel95sl/6EXNIZ2pIWIORkjfWNxwQ7AGarJHDJo="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"shinout","email":"shinout310@gmail.com"},"maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}]}},"maintainers":[{"name":"shinout","email":"shinout310@gmail.com"}],"time":{"modified":"2022-06-26T22:18:14.135Z","created":"2011-10-28T08:10:43.860Z","0.0.1":"2011-10-28T08:10:47.328Z","0.1.0":"2011-11-18T12:53:29.779Z","0.1.1":"2012-02-23T01:22:02.418Z","0.2.0":"2012-02-23T01:53:49.261Z","0.2.1":"2012-02-23T01:56:12.143Z","0.2.2":"2012-02-23T02:01:18.126Z","0.2.3":"2012-02-23T07:48:20.014Z","0.2.4":"2012-02-23T17:14:54.808Z","0.2.5":"2012-02-24T01:31:51.634Z","0.2.6":"2012-02-25T05:28:55.182Z","0.2.7":"2012-02-25T05:44:50.360Z","0.2.8":"2012-04-16T12:20:17.286Z","0.3.0":"2013-06-12T20:43:29.807Z","0.3.1":"2013-06-13T19:09:21.282Z"},"author":{"name":"SHIN Suzuki","email":"shinout310@gmail.com"}}