From 763e71b06ffb1eb93a84e1c0df7c8faca565b7ba Mon Sep 17 00:00:00 2001 From: David Halls Date: Thu, 5 Dec 2019 22:47:18 +0000 Subject: [PATCH] Re-run coverage --- .travis.yml | 2 +- README.md | 43 +- coverage/lcov-report/index.html | 2 +- coverage/lcov-report/qlobber/aedes/index.html | 2 +- .../qlobber/aedes/qlobber-sub.js.html | 2 +- coverage/lcov-report/qlobber/index.html | 2 +- coverage/lcov-report/qlobber/index.js.html | 2 +- coverage/lcov-report/qlobber/lib/index.html | 2 +- .../lcov-report/qlobber/lib/qlobber.js.html | 316 ++++- coverage/lcov.info | 1168 ++++++++--------- lib/qlobber.js | 43 +- package.json | 3 +- 12 files changed, 944 insertions(+), 643 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9584dcc..ac1b1ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,4 @@ before_install: - sudo apt update - sudo apt -y install libboost1.70-dev g++-9 script: - - if [ $TRAVIS_NODE_VERSION = 13 ]; then npm run coverage; else npm run test; fi + - if [ $TRAVIS_NODE_VERSION = 13 ]; then npm run coverage && npm run coveralls; else npm run test; fi diff --git a/README.md b/README.md index f6c89b5..a2f4ae6 100644 --- a/README.md +++ b/README.md @@ -143,26 +143,23 @@ qlobber is also benchmarked in [ascoltatori](https://github.com/mcollina/ascolta ## Native Qlobbers -The Javascript Qlobbers can't support asynchronous calls and worker threads +The Javascript Qlobbers don't support asynchronous calls and worker threads because Javascript values can't be shared between threads. In order to support asynchronous calls and worker threads, a native C++ -implementation is included. If you have the following then it will the native -version will be compiled when you install the module: - -Gnu C++ version 9 or above -Boost 1.70 or above +implementation is included. If you have Gnu C++ version 9+ and Boost 1.70+ +then the native version will be compiled when you install the module. If compilation succeeds then the following classes will be available alongside the Javascript classes: -`Qlobber.nativeString` -`Qlobber.nativeNumber` -`QlobberDedup.nativeString` -`QlobberDedup.nativeNumber` -`QlobberTrue.native` +- `Qlobber.nativeString` +- `Qlobber.nativeNumber` +- `QlobberDedup.nativeString` +- `QlobberDedup.nativeNumber` +- `QlobberTrue.native` -They can only hold values of a single type (strings or numbers). +They can only hold values of a single type (currently strings or numbers). You can also build the native implemention using one of these commands: @@ -176,17 +173,17 @@ grunt rebuild [--debug] The native classes support the same API as the Javascript classes but have the following additional methods: -`addP` -`removeP` -`matchP` -`match_iterP` -`testP` -`clearP` -`visitP` -`get_restorerP` - -They correspond to their corresponding namesakes but return Promises. Note that -`match_iterP` and `visitP` return async iterators. +- `addP` +- `removeP` +- `matchP` +- `match_iterP` +- `testP` +- `clearP` +- `visitP` +- `get_restorerP` + +They correspond to their namesakes but return Promises. Note that `match_iterP` +and `visitP` return async iterators. # API diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index 4775a52..11fcb47 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -106,7 +106,7 @@

diff --git a/coverage/lcov-report/qlobber/aedes/index.html b/coverage/lcov-report/qlobber/aedes/index.html index 4d66e1b..92bc90d 100644 --- a/coverage/lcov-report/qlobber/aedes/index.html +++ b/coverage/lcov-report/qlobber/aedes/index.html @@ -80,7 +80,7 @@

diff --git a/coverage/lcov-report/qlobber/aedes/qlobber-sub.js.html b/coverage/lcov-report/qlobber/aedes/qlobber-sub.js.html index a923626..d1597b4 100644 --- a/coverage/lcov-report/qlobber/aedes/qlobber-sub.js.html +++ b/coverage/lcov-report/qlobber/aedes/qlobber-sub.js.html @@ -454,7 +454,7 @@

diff --git a/coverage/lcov-report/qlobber/index.html b/coverage/lcov-report/qlobber/index.html index 9f28863..f6cfc0f 100644 --- a/coverage/lcov-report/qlobber/index.html +++ b/coverage/lcov-report/qlobber/index.html @@ -80,7 +80,7 @@

diff --git a/coverage/lcov-report/qlobber/index.js.html b/coverage/lcov-report/qlobber/index.js.html index b6af779..dd53089 100644 --- a/coverage/lcov-report/qlobber/index.js.html +++ b/coverage/lcov-report/qlobber/index.js.html @@ -61,7 +61,7 @@

diff --git a/coverage/lcov-report/qlobber/lib/index.html b/coverage/lcov-report/qlobber/lib/index.html index 3dba5e1..f223c0e 100644 --- a/coverage/lcov-report/qlobber/lib/index.html +++ b/coverage/lcov-report/qlobber/lib/index.html @@ -80,7 +80,7 @@

diff --git a/coverage/lcov-report/qlobber/lib/qlobber.js.html b/coverage/lcov-report/qlobber/lib/qlobber.js.html index 92b7df9..eeaeb17 100644 --- a/coverage/lcov-report/qlobber/lib/qlobber.js.html +++ b/coverage/lcov-report/qlobber/lib/qlobber.js.html @@ -1122,7 +1122,202 @@

1074 1075 1076 -1077  +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +        @@ -1240,6 +1435,10 @@

      +  +  +  +  104x   104x @@ -1670,6 +1869,11 @@

102x     +  +  +  +  +  1x   40x @@ -2203,6 +2407,8 @@

  Node.js globbing for amqp-like topics.   +__Note:__ Version 4.0.0 adds async and worker thread support but requires Node 12+. +  Example:   ```javascript @@ -2228,6 +2434,8 @@

A more advanced example using topics from the [RabbitMQ topic tutorial](http://www.rabbitmq.com/tutorials/tutorial-five-python.html):   ```javascript +var assert = require('assert'); +var Qlobber = require('qlobber').Qlobber; var matcher = new Qlobber(); matcher.add('*.orange.*', 'Q1'); matcher.add('*.*.rabbit', 'Q2'); @@ -2255,6 +2463,51 @@

['Q2']]); ```   +## Async Example +  +Same as the first example but using `await`: +  +```javascript +var assert = require('assert'); +var Qlobber = require('qlobber').Qlobber.nativeString; +var matcher = new Qlobber(); +  +(async () => { + await matcher.addP('foo.*', 'it matched!'); + assert.deepEqual(await matcher.matchP('foo.bar'), ['it matched!']); + assert(await matcher.testP('foo.bar', 'it matched!')); +})(); +``` +  +## Worker Thread Example +  +Same again but the matching is done on a separate thread: +  +``` +const Qlobber = require('qlobber').Qlobber.nativeString; +const { + Worker, isMainThread, parentPort, workerData +} = require('worker_threads'); +  +if (isMainThread) { + const matcher = new Qlobber(); + matcher.add('foo.*', 'it matched!'); + const worker = new Worker(__filename, { + workerData: matcher.state_address + }); + worker.on('message', msg => { + const assert = require('assert'); + assert.deepEqual(msg, [['it matched!'], true]); + }); +} else { + const matcher = new Qlobber(workerData); + parentPort.postMessage([ + matcher.match('foo.bar'), + matcher.test('foo.bar', 'it matched!') + ]); +} +``` +  ## Licence   [MIT](LICENCE) @@ -2266,19 +2519,19 @@

To run the tests:   ```shell -grunt test +npm test ```   ## Lint   ```shell -grunt lint +npm run lint ```   ## Code Coverage   ```shell -grunt coverage +npm run coverage ```   [Instanbul](http://gotwarlost.github.io/istanbul/) results are available [here](http://rawgit.davedoesdev.com/davedoesdev/qlobber/master/coverage/lcov-report/index.html). @@ -2293,6 +2546,50 @@

  qlobber is also benchmarked in [ascoltatori](https://github.com/mcollina/ascoltatori).   +## Native Qlobbers +  +The Javascript Qlobbers don't support asynchronous calls and worker threads +because Javascript values can't be shared between threads. +  +In order to support asynchronous calls and worker threads, a native C++ +implementation is included. If you have Gnu C++ version 9+ and Boost 1.70+ +then the native version will be compiled when you install the module. +  +If compilation succeeds then the following classes will be available alongside +the Javascript classes: +  +- `Qlobber.nativeString` +- `Qlobber.nativeNumber` +- `QlobberDedup.nativeString` +- `QlobberDedup.nativeNumber` +- `QlobberTrue.native` +  +They can only hold values of a single type (currently strings or numbers). +  +You can also build the native implemention using one of these commands: +  +```shell +grunt build [--debug] +grunt rebuild [--debug] +``` +  +### Asynchronous calls +  +The native classes support the same API as the Javascript classes but have the +following additional methods: +  +- `addP` +- `removeP` +- `matchP` +- `match_iterP` +- `testP` +- `clearP` +- `visitP` +- `get_restorerP` +  +They correspond to their namesakes but return Promises. Note that `match_iterP` +and `visitP` return async iterators. +  # API */   @@ -2313,6 +2610,10 @@

- `{String} wildcard_some` The character to use for matching zero or more words in a topic. Defaults to '#'. MQTT uses '#' too.   - `{Boolean|Map} cache_adds` Whether to cache topics when adding topic matchers. This will make adding multiple matchers for the same topic faster at the cost of extra memory usage. Defaults to `false`. If you supply a `Map` then it will be used to cache the topics (use this to enumerate all the topics in the qlobber). +  +- `{Integer} max_words` Maximum number of words to allow in a topic. Defaults to 100. +  +- `{Integer} max_wildcard_somes` Maximum number of `wildcard_some` words in a topic. Defaults to 3. */ function Qlobber (options) { @@ -2746,6 +3047,11 @@

return this._match2([], topic, ctx); };   +/** +Match a topic, returning the matches one at a time. +  +@return {Iterator} An iterator on the values that match the topic. There may be duplicate values, even if you use a [`QlobberDedup`](#qlobberdedupoptions). +*/ Qlobber.prototype.match_iter = function (topic, ctx) { return this._match_iter(0, this._split(topic, false), this._trie, ctx); @@ -3280,7 +3586,7 @@

diff --git a/coverage/lcov.info b/coverage/lcov.info index 0b811a7..f1bbdb7 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -102,64 +102,64 @@ BRH:15 end_of_record TN: SF:/home/david/qlobber/lib/qlobber.js -FN:117,Qlobber -FN:137,(anonymous_1) -FN:142,(anonymous_2) -FN:147,(anonymous_3) -FN:157,(anonymous_4) -FN:162,(anonymous_5) -FN:179,(anonymous_6) -FN:212,(anonymous_7) -FN:247,(anonymous_8) -FN:266,(anonymous_9) -FN:331,(anonymous_10) -FN:341,(anonymous_11) -FN:363,(anonymous_12) -FN:417,(anonymous_13) -FN:434,(anonymous_14) -FN:483,(anonymous_15) -FN:489,(anonymous_16) -FN:504,(anonymous_17) -FN:529,(anonymous_18) -FN:544,(anonymous_19) -FN:549,(anonymous_20) -FN:561,(anonymous_21) -FN:573,(anonymous_22) -FN:585,(anonymous_23) -FN:596,(anonymous_24) -FN:606,(anonymous_25) -FN:674,(anonymous_26) -FN:682,(anonymous_27) -FN:754,QlobberDedup -FN:761,(anonymous_29) -FN:766,(anonymous_30) -FN:771,(anonymous_31) -FN:773,(anonymous_32) -FN:779,(anonymous_33) -FN:797,(anonymous_34) -FN:808,(anonymous_35) -FN:826,QlobberTrue -FN:833,(anonymous_37) -FN:838,(anonymous_38) -FN:842,(anonymous_39) -FN:847,(anonymous_40) -FN:860,(anonymous_41) -FN:875,(anonymous_42) -FN:893,VisitorStream -FN:901,(anonymous_44) -FN:931,RestorerStream -FN:939,(anonymous_46) -FN:945,wrap_native -FN:949,(anonymous_48) -FN:964,(anonymous_49) -FN:979,(anonymous_50) -FN:994,(anonymous_51) -FN:1008,(anonymous_52) -FN:1022,(anonymous_53) -FN:1035,(anonymous_54) -FN:1038,(anonymous_55) -FN:1043,(anonymous_56) -FN:1046,(anonymous_57) +FN:214,Qlobber +FN:234,(anonymous_1) +FN:239,(anonymous_2) +FN:244,(anonymous_3) +FN:254,(anonymous_4) +FN:259,(anonymous_5) +FN:276,(anonymous_6) +FN:309,(anonymous_7) +FN:344,(anonymous_8) +FN:363,(anonymous_9) +FN:428,(anonymous_10) +FN:438,(anonymous_11) +FN:460,(anonymous_12) +FN:514,(anonymous_13) +FN:531,(anonymous_14) +FN:580,(anonymous_15) +FN:586,(anonymous_16) +FN:601,(anonymous_17) +FN:626,(anonymous_18) +FN:641,(anonymous_19) +FN:651,(anonymous_20) +FN:663,(anonymous_21) +FN:675,(anonymous_22) +FN:687,(anonymous_23) +FN:698,(anonymous_24) +FN:708,(anonymous_25) +FN:776,(anonymous_26) +FN:784,(anonymous_27) +FN:856,QlobberDedup +FN:863,(anonymous_29) +FN:868,(anonymous_30) +FN:873,(anonymous_31) +FN:875,(anonymous_32) +FN:881,(anonymous_33) +FN:899,(anonymous_34) +FN:910,(anonymous_35) +FN:928,QlobberTrue +FN:935,(anonymous_37) +FN:940,(anonymous_38) +FN:944,(anonymous_39) +FN:949,(anonymous_40) +FN:962,(anonymous_41) +FN:977,(anonymous_42) +FN:995,VisitorStream +FN:1003,(anonymous_44) +FN:1033,RestorerStream +FN:1041,(anonymous_46) +FN:1047,wrap_native +FN:1051,(anonymous_48) +FN:1066,(anonymous_49) +FN:1081,(anonymous_50) +FN:1096,(anonymous_51) +FN:1110,(anonymous_52) +FN:1124,(anonymous_53) +FN:1137,(anonymous_54) +FN:1140,(anonymous_55) +FN:1145,(anonymous_56) +FN:1148,(anonymous_57) FNF:58 FNH:58 FNDA:104,Qlobber @@ -220,539 +220,539 @@ FNDA:7,(anonymous_54) FNDA:1011,(anonymous_55) FNDA:3,(anonymous_56) FNDA:588,(anonymous_57) -DA:102,1 -DA:119,104 -DA:121,104 -DA:122,104 -DA:123,104 -DA:124,104 -DA:125,104 -DA:126,104 -DA:127,104 -DA:129,2 -DA:131,102 -DA:133,9 -DA:137,1 -DA:139,587 -DA:142,1 -DA:144,360013 -DA:147,1 -DA:149,16495 -DA:151,16495 -DA:153,136497 -DA:157,1 -DA:159,15495 -DA:162,1 -DA:164,47 -DA:166,5 -DA:169,42 -DA:171,42 -DA:173,40 -DA:176,42 -DA:179,1 -DA:183,4322645 -DA:185,720649 -DA:187,720649 -DA:189,720018 -DA:193,631 -DA:194,631 -DA:197,720649 -DA:200,3601996 -DA:201,3601996 -DA:203,3601996 -DA:205,1252 -DA:206,1252 -DA:209,3601996 -DA:212,1 -DA:216,713 -DA:218,91 -DA:220,91 -DA:222,79 -DA:223,79 -DA:226,12 -DA:229,622 -DA:230,622 -DA:232,622 -DA:234,7 -DA:237,615 -DA:239,615 -DA:241,507 -DA:244,615 -DA:247,1 -DA:251,18366 -DA:253,19014 -DA:255,11086 -DA:257,345191 -DA:259,11086 -DA:263,18366 -DA:266,1 -DA:270,698713 -DA:272,698713 -DA:275,18366 -DA:277,18366 -DA:280,698713 -DA:282,28709 -DA:284,28709 -DA:286,18070 -DA:288,141 -DA:289,141 -DA:290,141 -DA:292,17929 -DA:294,159 -DA:295,159 -DA:299,17770 -DA:305,670004 -DA:307,670004 -DA:309,669999 -DA:311,669999 -DA:313,334100 -DA:317,670004 -DA:319,669862 -DA:321,669862 -DA:323,849 -DA:328,698713 -DA:331,1 -DA:333,187 -DA:338,185 -DA:341,1 -DA:345,15391 -DA:347,19201 -DA:349,4550 -DA:351,7803 -DA:353,904 -DA:356,3646 -DA:360,14487 +DA:195,1 +DA:216,104 +DA:218,104 +DA:219,104 +DA:220,104 +DA:221,104 +DA:222,104 +DA:223,104 +DA:224,104 +DA:226,2 +DA:228,102 +DA:230,9 +DA:234,1 +DA:236,587 +DA:239,1 +DA:241,360013 +DA:244,1 +DA:246,16495 +DA:248,16495 +DA:250,136497 +DA:254,1 +DA:256,15495 +DA:259,1 +DA:261,47 +DA:263,5 +DA:266,42 +DA:268,42 +DA:270,40 +DA:273,42 +DA:276,1 +DA:280,4322645 +DA:282,720649 +DA:284,720649 +DA:286,720018 +DA:290,631 +DA:291,631 +DA:294,720649 +DA:297,3601996 +DA:298,3601996 +DA:300,3601996 +DA:302,1252 +DA:303,1252 +DA:306,3601996 +DA:309,1 +DA:313,713 +DA:315,91 +DA:317,91 +DA:319,79 +DA:320,79 +DA:323,12 +DA:326,622 +DA:327,622 +DA:329,622 +DA:331,7 +DA:334,615 +DA:336,615 +DA:338,507 +DA:341,615 +DA:344,1 +DA:348,18366 +DA:350,19014 +DA:352,11086 +DA:354,345191 +DA:356,11086 +DA:360,18366 DA:363,1 -DA:367,28696 -DA:369,28696 -DA:372,15391 -DA:376,1715 -DA:380,26981 -DA:382,16054 -DA:384,16054 -DA:386,1068 -DA:391,10927 -DA:393,10927 -DA:395,10922 -DA:397,10922 -DA:399,608 -DA:403,10319 -DA:405,10241 -DA:407,10241 -DA:409,619 -DA:414,24686 -DA:417,1 -DA:421,15944 -DA:423,16066 -DA:425,10436 -DA:427,344031 -DA:429,10436 -DA:434,1 -DA:438,693918 -DA:440,693918 -DA:443,15944 -DA:445,15944 -DA:448,693918 -DA:450,25924 -DA:452,25924 -DA:454,15497 -DA:459,667994 -DA:461,667994 -DA:463,667989 -DA:465,667989 -DA:467,333684 -DA:471,667994 -DA:473,667886 -DA:475,667886 -DA:477,221 -DA:483,1 -DA:484,722216 -DA:485,722216 -DA:486,10 -DA:488,722206 -DA:489,3602000 -DA:490,1 -DA:492,722205 -DA:504,1 -DA:506,720655 -DA:507,720655 -DA:509,3 -DA:513,720652 -DA:514,720649 -DA:516,57 -DA:519,720652 -DA:529,1 -DA:531,100 -DA:533,3 -DA:535,98 -DA:544,1 -DA:546,102 -DA:549,1 -DA:551,40 -DA:561,1 -DA:563,1237 -DA:573,1 -DA:575,5733 -DA:585,1 -DA:587,14 -DA:588,14 -DA:590,1 -DA:592,14 -DA:596,1 -DA:598,37 -DA:606,1 -DA:608,7 -DA:609,7 -DA:610,7 -DA:612,7 -DA:614,455 -DA:616,167 -DA:619,455 -DA:621,455 -DA:623,167 -DA:625,167 -DA:626,167 -DA:628,7 -DA:631,160 -DA:632,160 -DA:635,288 -DA:636,288 -DA:637,288 -DA:639,288 -DA:641,128 -DA:643,128 -DA:645,103 -DA:647,108 -DA:652,25 -DA:655,128 -DA:656,128 -DA:659,160 -DA:660,160 -DA:661,160 -DA:674,1 -DA:676,30 -DA:678,30 -DA:679,30 -DA:680,30 -DA:682,30 -DA:684,4208 -DA:687,1202 -DA:688,1202 -DA:689,1202 -DA:690,1202 -DA:692,56 -DA:694,49 -DA:696,56 -DA:698,1202 -DA:701,542 -DA:703,17 -DA:707,525 -DA:709,542 -DA:712,706 +DA:367,698713 +DA:369,698713 +DA:372,18366 +DA:374,18366 +DA:377,698713 +DA:379,28709 +DA:381,28709 +DA:383,18070 +DA:385,141 +DA:386,141 +DA:387,141 +DA:389,17929 +DA:391,159 +DA:392,159 +DA:396,17770 +DA:402,670004 +DA:404,670004 +DA:406,669999 +DA:408,669999 +DA:410,334100 +DA:414,670004 +DA:416,669862 +DA:418,669862 +DA:420,849 +DA:425,698713 +DA:428,1 +DA:430,187 +DA:435,185 +DA:438,1 +DA:442,15391 +DA:444,19201 +DA:446,4550 +DA:448,7803 +DA:450,904 +DA:453,3646 +DA:457,14487 +DA:460,1 +DA:464,28696 +DA:466,28696 +DA:469,15391 +DA:473,1715 +DA:477,26981 +DA:479,16054 +DA:481,16054 +DA:483,1068 +DA:488,10927 +DA:490,10927 +DA:492,10922 +DA:494,10922 +DA:496,608 +DA:500,10319 +DA:502,10241 +DA:504,10241 +DA:506,619 +DA:511,24686 +DA:514,1 +DA:518,15944 +DA:520,16066 +DA:522,10436 +DA:524,344031 +DA:526,10436 +DA:531,1 +DA:535,693918 +DA:537,693918 +DA:540,15944 +DA:542,15944 +DA:545,693918 +DA:547,25924 +DA:549,25924 +DA:551,15497 +DA:556,667994 +DA:558,667994 +DA:560,667989 +DA:562,667989 +DA:564,333684 +DA:568,667994 +DA:570,667886 +DA:572,667886 +DA:574,221 +DA:580,1 +DA:581,722216 +DA:582,722216 +DA:583,10 +DA:585,722206 +DA:586,3602000 +DA:587,1 +DA:589,722205 +DA:601,1 +DA:603,720655 +DA:604,720655 +DA:606,3 +DA:610,720652 +DA:611,720649 +DA:613,57 +DA:616,720652 +DA:626,1 +DA:628,100 +DA:630,3 +DA:632,98 +DA:641,1 +DA:643,102 +DA:651,1 +DA:653,40 +DA:663,1 +DA:665,1237 +DA:675,1 +DA:677,5733 +DA:687,1 +DA:689,14 +DA:690,14 +DA:692,1 +DA:694,14 +DA:698,1 +DA:700,37 +DA:708,1 +DA:710,7 +DA:711,7 +DA:712,7 DA:714,7 -DA:719,1232 -DA:720,1232 -DA:722,30 -DA:723,30 -DA:727,1202 -DA:728,1202 -DA:730,1199 -DA:734,25 -DA:736,1199 -DA:738,1202 -DA:739,1202 -DA:741,1232 -DA:756,35 -DA:759,1 -DA:761,1 -DA:763,466 -DA:766,1 -DA:768,360011 -DA:771,1 -DA:773,1280 -DA:775,121281 -DA:779,1 -DA:781,34 -DA:783,6 -DA:786,28 -DA:787,28 -DA:797,1 -DA:799,5732 -DA:808,1 -DA:810,85 -DA:828,9 -DA:831,1 -DA:833,1 -DA:835,83 -DA:838,1 -DA:842,1 -DA:844,3 -DA:847,1 -DA:849,2 -DA:860,1 -DA:862,130 -DA:875,1 -DA:877,16 -DA:880,1 -DA:895,1 -DA:896,1 +DA:716,455 +DA:718,167 +DA:721,455 +DA:723,455 +DA:725,167 +DA:727,167 +DA:728,167 +DA:730,7 +DA:733,160 +DA:734,160 +DA:737,288 +DA:738,288 +DA:739,288 +DA:741,288 +DA:743,128 +DA:745,128 +DA:747,103 +DA:749,108 +DA:754,25 +DA:757,128 +DA:758,128 +DA:761,160 +DA:762,160 +DA:763,160 +DA:776,1 +DA:778,30 +DA:780,30 +DA:781,30 +DA:782,30 +DA:784,30 +DA:786,4208 +DA:789,1202 +DA:790,1202 +DA:791,1202 +DA:792,1202 +DA:794,56 +DA:796,49 +DA:798,56 +DA:800,1202 +DA:803,542 +DA:805,17 +DA:809,525 +DA:811,542 +DA:814,706 +DA:816,7 +DA:821,1232 +DA:822,1232 +DA:824,30 +DA:825,30 +DA:829,1202 +DA:830,1202 +DA:832,1199 +DA:836,25 +DA:838,1199 +DA:840,1202 +DA:841,1202 +DA:843,1232 +DA:858,35 +DA:861,1 +DA:863,1 +DA:865,466 +DA:868,1 +DA:870,360011 +DA:873,1 +DA:875,1280 +DA:877,121281 +DA:881,1 +DA:883,34 +DA:885,6 +DA:888,28 +DA:889,28 DA:899,1 -DA:901,1 -DA:903,182 -DA:905,197 -DA:907,197 -DA:909,1 +DA:901,5732 DA:910,1 -DA:913,196 -DA:915,181 +DA:912,85 +DA:930,9 DA:933,1 -DA:934,1 -DA:937,1 -DA:939,1 -DA:941,196 -DA:942,196 -DA:950,102 -DA:951,102 -DA:952,102 -DA:953,102 -DA:954,102 -DA:955,102 -DA:956,102 -DA:957,102 -DA:958,102 -DA:959,102 -DA:960,102 -DA:961,102 -DA:966,27 -DA:968,27 -DA:970,3832 -DA:971,3832 -DA:973,27 -DA:975,3805 -DA:981,2 -DA:983,2 -DA:985,394 -DA:986,394 -DA:988,2 -DA:990,392 -DA:995,40 -DA:997,38 -DA:999,15536 -DA:1000,15536 -DA:1002,38 -DA:1004,15498 -DA:1009,24 -DA:1011,22 -DA:1013,15247 -DA:1014,15247 -DA:1016,22 -DA:1018,15225 -DA:1024,22 -DA:1025,22 -DA:1027,22 -DA:1029,3001 -DA:1032,22 -DA:1037,7 -DA:1038,7 -DA:1039,1011 -DA:1045,3 -DA:1046,3 -DA:1047,588 -DA:1052,6 -DA:1053,6 -DA:1055,6 -DA:1058,1 -DA:1060,1 -DA:1061,1 -DA:1062,1 -DA:1063,1 -DA:1064,1 -DA:1065,1 -DA:1071,1 -DA:1072,1 -DA:1073,1 -DA:1074,1 -DA:1075,1 -DA:1076,1 +DA:935,1 +DA:937,83 +DA:940,1 +DA:944,1 +DA:946,3 +DA:949,1 +DA:951,2 +DA:962,1 +DA:964,130 +DA:977,1 +DA:979,16 +DA:982,1 +DA:997,1 +DA:998,1 +DA:1001,1 +DA:1003,1 +DA:1005,182 +DA:1007,197 +DA:1009,197 +DA:1011,1 +DA:1012,1 +DA:1015,196 +DA:1017,181 +DA:1035,1 +DA:1036,1 +DA:1039,1 +DA:1041,1 +DA:1043,196 +DA:1044,196 +DA:1052,102 +DA:1053,102 +DA:1054,102 +DA:1055,102 +DA:1056,102 +DA:1057,102 +DA:1058,102 +DA:1059,102 +DA:1060,102 +DA:1061,102 +DA:1062,102 +DA:1063,102 +DA:1068,27 +DA:1070,27 +DA:1072,3832 +DA:1073,3832 +DA:1075,27 +DA:1077,3805 +DA:1083,2 +DA:1085,2 +DA:1087,394 +DA:1088,394 +DA:1090,2 +DA:1092,392 +DA:1097,40 +DA:1099,38 +DA:1101,15536 +DA:1102,15536 +DA:1104,38 +DA:1106,15498 +DA:1111,24 +DA:1113,22 +DA:1115,15247 +DA:1116,15247 +DA:1118,22 +DA:1120,15225 +DA:1126,22 +DA:1127,22 +DA:1129,22 +DA:1131,3001 +DA:1134,22 +DA:1139,7 +DA:1140,7 +DA:1141,1011 +DA:1147,3 +DA:1148,3 +DA:1149,588 +DA:1154,6 +DA:1155,6 +DA:1157,6 +DA:1160,1 +DA:1162,1 +DA:1163,1 +DA:1164,1 +DA:1165,1 +DA:1166,1 +DA:1167,1 +DA:1173,1 +DA:1174,1 +DA:1175,1 +DA:1176,1 +DA:1177,1 +DA:1178,1 LF:354 LH:354 -BRDA:119,0,0,104 -BRDA:119,0,1,67 -BRDA:121,1,0,104 -BRDA:121,1,1,80 -BRDA:122,2,0,104 -BRDA:122,2,1,80 -BRDA:123,3,0,104 -BRDA:123,3,1,80 -BRDA:124,4,0,104 -BRDA:124,4,1,81 -BRDA:125,5,0,104 -BRDA:125,5,1,81 -BRDA:127,6,0,2 -BRDA:127,6,1,102 -BRDA:131,7,0,9 -BRDA:131,7,1,93 -BRDA:164,8,0,5 -BRDA:164,8,1,42 -BRDA:171,9,0,40 -BRDA:171,9,1,2 -BRDA:183,10,0,720649 -BRDA:183,10,1,3601996 -BRDA:187,11,0,720018 -BRDA:187,11,1,631 -BRDA:203,12,0,1252 -BRDA:203,12,1,3600744 -BRDA:216,13,0,91 -BRDA:216,13,1,622 -BRDA:220,14,0,79 -BRDA:220,14,1,12 -BRDA:220,15,0,91 -BRDA:220,15,1,89 -BRDA:232,16,0,7 -BRDA:232,16,1,615 -BRDA:239,17,0,507 -BRDA:239,17,1,108 -BRDA:253,18,0,11086 -BRDA:253,18,1,7928 -BRDA:272,19,0,18366 -BRDA:272,19,1,680347 -BRDA:280,20,0,28709 -BRDA:280,20,1,670004 -BRDA:284,21,0,18070 -BRDA:284,21,1,10639 -BRDA:286,22,0,141 -BRDA:286,22,1,17929 -BRDA:292,23,0,159 -BRDA:292,23,1,17770 -BRDA:307,24,0,669999 -BRDA:307,24,1,5 -BRDA:307,25,0,670004 -BRDA:307,25,1,670002 -BRDA:311,26,0,334100 -BRDA:311,26,1,335899 -BRDA:317,27,0,669862 -BRDA:317,27,1,142 -BRDA:321,28,0,849 -BRDA:321,28,1,669013 -BRDA:338,29,0,185 -BRDA:338,29,1,141 -BRDA:347,30,0,4550 -BRDA:347,30,1,14651 -BRDA:351,31,0,904 -BRDA:351,31,1,6899 -BRDA:369,32,0,15391 -BRDA:369,32,1,13305 -BRDA:372,33,0,1715 -BRDA:372,33,1,13676 -BRDA:372,34,0,15391 -BRDA:372,34,1,14487 -BRDA:380,35,0,16054 -BRDA:380,35,1,10927 -BRDA:384,36,0,1068 -BRDA:384,36,1,14986 -BRDA:384,37,0,16054 -BRDA:384,37,1,15136 -BRDA:393,38,0,10922 -BRDA:393,38,1,5 -BRDA:393,39,0,10927 -BRDA:393,39,1,10925 -BRDA:397,40,0,608 -BRDA:397,40,1,10314 -BRDA:397,41,0,10922 -BRDA:397,41,1,2460 -BRDA:403,42,0,10241 -BRDA:403,42,1,78 -BRDA:407,43,0,619 -BRDA:407,43,1,9622 -BRDA:407,44,0,10241 -BRDA:407,44,1,2711 -BRDA:423,45,0,10436 -BRDA:423,45,1,5630 -BRDA:440,46,0,15944 -BRDA:440,46,1,677974 -BRDA:448,47,0,25924 -BRDA:448,47,1,667994 -BRDA:452,48,0,15497 -BRDA:452,48,1,10427 -BRDA:461,49,0,667989 -BRDA:461,49,1,5 -BRDA:461,50,0,667994 -BRDA:461,50,1,667992 -BRDA:465,51,0,333684 -BRDA:465,51,1,334305 -BRDA:471,52,0,667886 -BRDA:471,52,1,108 -BRDA:475,53,0,221 -BRDA:475,53,1,667665 -BRDA:485,54,0,10 -BRDA:485,54,1,722206 -BRDA:488,55,0,1 -BRDA:488,55,1,722205 -BRDA:488,56,0,722206 -BRDA:488,56,1,720650 -BRDA:506,57,0,720655 -BRDA:506,57,1,60 -BRDA:507,58,0,3 -BRDA:507,58,1,720652 -BRDA:514,59,0,57 -BRDA:514,59,1,720592 -BRDA:531,60,0,3 -BRDA:531,60,1,95 -BRDA:531,61,0,100 -BRDA:531,61,1,79 -BRDA:588,62,0,1 -BRDA:588,62,1,13 -BRDA:614,63,0,167 -BRDA:614,63,1,288 -BRDA:621,64,0,167 -BRDA:621,64,1,288 -BRDA:626,65,0,7 -BRDA:626,65,1,160 -BRDA:639,66,0,128 -BRDA:639,66,1,160 -BRDA:643,67,0,103 -BRDA:643,67,1,25 -BRDA:676,68,0,30 -BRDA:676,68,1,29 -BRDA:684,69,0,1202 -BRDA:684,69,1,542 -BRDA:684,69,2,706 -BRDA:684,69,3,1232 -BRDA:687,70,0,1202 -BRDA:687,70,1,676 -BRDA:690,71,0,56 -BRDA:690,71,1,1146 -BRDA:692,72,0,49 -BRDA:692,72,1,7 -BRDA:701,73,0,17 -BRDA:701,73,1,525 -BRDA:712,74,0,7 -BRDA:712,74,1,699 -BRDA:712,75,0,706 -BRDA:712,75,1,706 -BRDA:720,76,0,30 -BRDA:720,76,1,1202 -BRDA:728,77,0,1199 -BRDA:728,77,1,3 -BRDA:730,78,0,25 -BRDA:730,78,1,1174 -BRDA:730,79,0,1199 -BRDA:730,79,1,56 -BRDA:730,79,2,56 -BRDA:781,80,0,6 -BRDA:781,80,1,28 -BRDA:907,81,0,1 -BRDA:907,81,1,196 -BRDA:913,82,0,181 -BRDA:913,82,1,15 -BRDA:971,83,0,27 -BRDA:971,83,1,3805 -BRDA:986,84,0,2 -BRDA:986,84,1,392 -BRDA:1000,85,0,38 -BRDA:1000,85,1,15498 -BRDA:1014,86,0,22 -BRDA:1014,86,1,15225 +BRDA:216,0,0,104 +BRDA:216,0,1,67 +BRDA:218,1,0,104 +BRDA:218,1,1,80 +BRDA:219,2,0,104 +BRDA:219,2,1,80 +BRDA:220,3,0,104 +BRDA:220,3,1,80 +BRDA:221,4,0,104 +BRDA:221,4,1,81 +BRDA:222,5,0,104 +BRDA:222,5,1,81 +BRDA:224,6,0,2 +BRDA:224,6,1,102 +BRDA:228,7,0,9 +BRDA:228,7,1,93 +BRDA:261,8,0,5 +BRDA:261,8,1,42 +BRDA:268,9,0,40 +BRDA:268,9,1,2 +BRDA:280,10,0,720649 +BRDA:280,10,1,3601996 +BRDA:284,11,0,720018 +BRDA:284,11,1,631 +BRDA:300,12,0,1252 +BRDA:300,12,1,3600744 +BRDA:313,13,0,91 +BRDA:313,13,1,622 +BRDA:317,14,0,79 +BRDA:317,14,1,12 +BRDA:317,15,0,91 +BRDA:317,15,1,89 +BRDA:329,16,0,7 +BRDA:329,16,1,615 +BRDA:336,17,0,507 +BRDA:336,17,1,108 +BRDA:350,18,0,11086 +BRDA:350,18,1,7928 +BRDA:369,19,0,18366 +BRDA:369,19,1,680347 +BRDA:377,20,0,28709 +BRDA:377,20,1,670004 +BRDA:381,21,0,18070 +BRDA:381,21,1,10639 +BRDA:383,22,0,141 +BRDA:383,22,1,17929 +BRDA:389,23,0,159 +BRDA:389,23,1,17770 +BRDA:404,24,0,669999 +BRDA:404,24,1,5 +BRDA:404,25,0,670004 +BRDA:404,25,1,670002 +BRDA:408,26,0,334100 +BRDA:408,26,1,335899 +BRDA:414,27,0,669862 +BRDA:414,27,1,142 +BRDA:418,28,0,849 +BRDA:418,28,1,669013 +BRDA:435,29,0,185 +BRDA:435,29,1,141 +BRDA:444,30,0,4550 +BRDA:444,30,1,14651 +BRDA:448,31,0,904 +BRDA:448,31,1,6899 +BRDA:466,32,0,15391 +BRDA:466,32,1,13305 +BRDA:469,33,0,1715 +BRDA:469,33,1,13676 +BRDA:469,34,0,15391 +BRDA:469,34,1,14487 +BRDA:477,35,0,16054 +BRDA:477,35,1,10927 +BRDA:481,36,0,1068 +BRDA:481,36,1,14986 +BRDA:481,37,0,16054 +BRDA:481,37,1,15136 +BRDA:490,38,0,10922 +BRDA:490,38,1,5 +BRDA:490,39,0,10927 +BRDA:490,39,1,10925 +BRDA:494,40,0,608 +BRDA:494,40,1,10314 +BRDA:494,41,0,10922 +BRDA:494,41,1,2460 +BRDA:500,42,0,10241 +BRDA:500,42,1,78 +BRDA:504,43,0,619 +BRDA:504,43,1,9622 +BRDA:504,44,0,10241 +BRDA:504,44,1,2711 +BRDA:520,45,0,10436 +BRDA:520,45,1,5630 +BRDA:537,46,0,15944 +BRDA:537,46,1,677974 +BRDA:545,47,0,25924 +BRDA:545,47,1,667994 +BRDA:549,48,0,15497 +BRDA:549,48,1,10427 +BRDA:558,49,0,667989 +BRDA:558,49,1,5 +BRDA:558,50,0,667994 +BRDA:558,50,1,667992 +BRDA:562,51,0,333684 +BRDA:562,51,1,334305 +BRDA:568,52,0,667886 +BRDA:568,52,1,108 +BRDA:572,53,0,221 +BRDA:572,53,1,667665 +BRDA:582,54,0,10 +BRDA:582,54,1,722206 +BRDA:585,55,0,1 +BRDA:585,55,1,722205 +BRDA:585,56,0,722206 +BRDA:585,56,1,720650 +BRDA:603,57,0,720655 +BRDA:603,57,1,60 +BRDA:604,58,0,3 +BRDA:604,58,1,720652 +BRDA:611,59,0,57 +BRDA:611,59,1,720592 +BRDA:628,60,0,3 +BRDA:628,60,1,95 +BRDA:628,61,0,100 +BRDA:628,61,1,79 +BRDA:690,62,0,1 +BRDA:690,62,1,13 +BRDA:716,63,0,167 +BRDA:716,63,1,288 +BRDA:723,64,0,167 +BRDA:723,64,1,288 +BRDA:728,65,0,7 +BRDA:728,65,1,160 +BRDA:741,66,0,128 +BRDA:741,66,1,160 +BRDA:745,67,0,103 +BRDA:745,67,1,25 +BRDA:778,68,0,30 +BRDA:778,68,1,29 +BRDA:786,69,0,1202 +BRDA:786,69,1,542 +BRDA:786,69,2,706 +BRDA:786,69,3,1232 +BRDA:789,70,0,1202 +BRDA:789,70,1,676 +BRDA:792,71,0,56 +BRDA:792,71,1,1146 +BRDA:794,72,0,49 +BRDA:794,72,1,7 +BRDA:803,73,0,17 +BRDA:803,73,1,525 +BRDA:814,74,0,7 +BRDA:814,74,1,699 +BRDA:814,75,0,706 +BRDA:814,75,1,706 +BRDA:822,76,0,30 +BRDA:822,76,1,1202 +BRDA:830,77,0,1199 +BRDA:830,77,1,3 +BRDA:832,78,0,25 +BRDA:832,78,1,1174 +BRDA:832,79,0,1199 +BRDA:832,79,1,56 +BRDA:832,79,2,56 +BRDA:883,80,0,6 +BRDA:883,80,1,28 +BRDA:1009,81,0,1 +BRDA:1009,81,1,196 +BRDA:1015,82,0,181 +BRDA:1015,82,1,15 +BRDA:1073,83,0,27 +BRDA:1073,83,1,3805 +BRDA:1088,84,0,2 +BRDA:1088,84,1,392 +BRDA:1102,85,0,38 +BRDA:1102,85,1,15498 +BRDA:1116,86,0,22 +BRDA:1116,86,1,15225 BRF:177 BRH:177 end_of_record diff --git a/lib/qlobber.js b/lib/qlobber.js index 926d4f7..ea6f02d 100644 --- a/lib/qlobber.js +++ b/lib/qlobber.js @@ -144,26 +144,23 @@ qlobber is also benchmarked in [ascoltatori](https://github.com/mcollina/ascolta ## Native Qlobbers -The Javascript Qlobbers can't support asynchronous calls and worker threads +The Javascript Qlobbers don't support asynchronous calls and worker threads because Javascript values can't be shared between threads. In order to support asynchronous calls and worker threads, a native C++ -implementation is included. If you have the following then it will the native -version will be compiled when you install the module: - -* Gnu C++ version 9 or above -* Boost 1.70 or above +implementation is included. If you have Gnu C++ version 9+ and Boost 1.70+ +then the native version will be compiled when you install the module. If compilation succeeds then the following classes will be available alongside the Javascript classes: -* `Qlobber.nativeString` -* `Qlobber.nativeNumber` -* `QlobberDedup.nativeString` -* `QlobberDedup.nativeNumber` -* `QlobberTrue.native` +- `Qlobber.nativeString` +- `Qlobber.nativeNumber` +- `QlobberDedup.nativeString` +- `QlobberDedup.nativeNumber` +- `QlobberTrue.native` -They can only hold values of a single type (strings or numbers). +They can only hold values of a single type (currently strings or numbers). You can also build the native implemention using one of these commands: @@ -177,17 +174,17 @@ grunt rebuild [--debug] The native classes support the same API as the Javascript classes but have the following additional methods: -* `addP` -* `removeP` -* `matchP` -* `match_iterP` -* `testP` -* `clearP` -* `visitP` -* `get_restorerP` - -They correspond to their corresponding namesakes but return Promises. Note that -`match_iterP` and `visitP` return async iterators. +- `addP` +- `removeP` +- `matchP` +- `match_iterP` +- `testP` +- `clearP` +- `visitP` +- `get_restorerP` + +They correspond to their namesakes but return Promises. Note that `match_iterP` +and `visitP` return async iterators. # API */ diff --git a/package.json b/package.json index 3fe6511..bf48c1e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "scripts": { "install": "node-gyp rebuild || true", "test": "node-gyp rebuild --debug && node --expose-gc ./node_modules/.bin/grunt lint test", - "coverage": "node-gyp rebuild --debug && grunt lint coverage coveralls", + "coverage": "node-gyp rebuild --debug && grunt lint coverage", + "coveralls": "grunt coveralls", "lint": "grunt lint" }, "directories": {