{"_id":"parse-statements","_rev":"4250404","name":"parse-statements","description":"Fast and easy parser of statements in source code in any language ✂️","dist-tags":{"latest":"1.0.12"},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"time":{"modified":"2026-03-29T21:57:32.000Z","created":"2023-05-09T13:06:22.924Z","1.0.12":"2025-05-06T19:33:20.095Z","1.0.11":"2025-01-06T03:53:41.088Z","1.0.10":"2024-12-21T02:05:01.106Z","1.0.9":"2024-01-08T23:36:26.489Z","1.0.8":"2024-01-03T21:45:12.156Z","1.0.7":"2023-11-04T12:18:26.034Z","1.0.6":"2023-11-02T09:33:47.190Z","1.0.5":"2023-10-18T03:43:25.243Z","1.0.4":"2023-10-17T03:29:45.176Z","1.0.3":"2023-09-30T00:57:49.388Z","1.0.2":"2023-09-27T14:19:49.351Z","1.0.1":"2023-09-27T12:25:39.042Z","1.0.0":"2023-09-27T01:51:46.219Z","0.0.10":"2023-09-04T07:28:53.366Z","0.0.9":"2023-08-19T02:04:55.248Z","0.0.8":"2023-08-14T01:41:56.948Z","0.0.7":"2023-08-05T13:29:56.667Z","0.0.6":"2023-07-29T13:58:09.723Z","0.0.5":"2023-07-29T01:49:53.553Z","0.0.4":"2023-07-27T22:01:51.099Z","0.0.3":"2023-07-26T14:48:45.331Z","0.0.2":"2023-07-25T03:29:08.170Z","0.0.1":"2023-05-09T13:06:22.924Z"},"users":{},"author":{"name":"uid11"},"repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"versions":{"1.0.12":{"name":"parse-statements","version":"1.0.12","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3.5","typescript":">=5.8"},"exports":{".":{"import":"./index.js","require":"./index.cjs","types":"./index.d.ts"}},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@10","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prettier":"prettier --cache --cache-strategy=content --write .","prebuild":"rm -f *.cjs *.js *.d.ts","build":"tsc","postbuild":"node ./convertEsmToCjs.js","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"type":"module","types":"./index.d.ts","_id":"parse-statements@1.0.12","gitHead":"474611de14f82b9bc83aaacbfb453eb580215bac","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"shasum":"9552e79ca49a1839313c7cdba4ea5409839a4909","size":10755,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.12.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.12.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/parse-statements_1.0.12_1746559999892_0.6555028725629091"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-06T19:33:20.095Z","publish_time":1746560000095,"_source_registry_name":"default","_cnpm_publish_time":1746560000095},"1.0.11":{"name":"parse-statements","version":"1.0.11","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3.4","typescript":">=5.7"},"exports":{".":{"import":"./index.js","require":"./index.cjs","types":"./index.d.ts"}},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@10","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prettier":"prettier --cache --cache-strategy=content --write .","prebuild":"rm -f *.cjs *.js *.d.ts","build":"tsc","postbuild":"node ./convertEsmToCjs.js","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"type":"module","types":"./index.d.ts","_id":"parse-statements@1.0.11","gitHead":"3121502dab85f6e561a3a37d7ab91875c7e5371d","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"shasum":"8787c5d383ae5746568571614be72b0689584344","size":10659,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.11.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.11.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/parse-statements_1.0.11_1736135620914_0.5681075698435667"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-06T03:53:41.088Z","publish_time":1736135621088,"_source_registry_name":"default","_cnpm_publish_time":1736135621088},"1.0.10":{"name":"parse-statements","version":"1.0.10","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3.4","typescript":">=5.7"},"exports":{".":{"import":"./index.js","require":"./index.cjs","types":"./index.d.ts"}},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@10","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prettier":"prettier --cache --cache-strategy=content --write .","prebuild":"rm -f *.cjs *.js *.d.ts","build":"tsc","postbuild":"node ./convertEsmToCjs.js","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"type":"module","types":"index.d.ts","_id":"parse-statements@1.0.10","gitHead":"7764c15f81a0ed4258f4c0449bc09aa08bb2216e","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"shasum":"756f530b1901fd6e5bba4ce1983a19a372023136","size":10641,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.10.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.10.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/parse-statements_1.0.10_1734746700925_0.7942531463748725"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-21T02:05:01.106Z","publish_time":1734746701106,"_source_registry_name":"default","_cnpm_publish_time":1734746701106},"1.0.9":{"name":"parse-statements","version":"1.0.9","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3.1","typescript":">=5.3"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@10","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","_id":"parse-statements@1.0.9","gitHead":"6a232535cd0fe467b344c5572a916f8b21e9f6d2","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"shasum":"44b4af4ab376e4d6d532d573f4ca47bc7c9c7ab2","size":10459,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.9.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.9_1704756986325_0.3671925364976525"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-08T23:36:26.489Z","publish_time":1704756986489,"_source_registry_name":"default","_cnpm_publish_time":1704756986489},"1.0.8":{"name":"parse-statements","version":"1.0.8","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3.1","typescript":">=5.3"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@10","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","_id":"parse-statements@1.0.8","gitHead":"ba97c6844750fe41aca5e7f660e8630af205adaf","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"shasum":"bdb519ae0df0c3dd74d82b59bbcf38ae82a03f2e","size":7395,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.8.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.8_1704318312000_0.12430282302471785"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-03T21:45:12.156Z","publish_time":1704318312156,"_source_registry_name":"default","_cnpm_publish_time":1704318312156},"1.0.7":{"name":"parse-statements","version":"1.0.7","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"aaa41e35f7bf6e3e00be9587a67cddfdaf5dd2eb","_id":"parse-statements@1.0.7","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"8bfe399903a0f99efd0738567bbf08a3c16c2808","size":7292,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.7.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.7_1699100305798_0.12858284123738506"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T12:18:26.034Z","publish_time":1699100306034,"_source_registry_name":"default","_cnpm_publish_time":1699100306034},"1.0.6":{"name":"parse-statements","version":"1.0.6","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"87ad8cc1744dbe3171f9bddd70c9cdf0ba0f18fb","_id":"parse-statements@1.0.6","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"2cce1af0f0e1d73567361c14196347de305fa0a8","size":7288,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.6.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.6_1698917626975_0.4200769833621929"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-02T09:33:47.190Z","publish_time":1698917627190,"_source_registry_name":"default","_cnpm_publish_time":1698917627190},"1.0.5":{"name":"parse-statements","version":"1.0.5","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"7af0dcfd1f8b2cd03d37abe652d17a6c9f773efc","_id":"parse-statements@1.0.5","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"d5847677d58e7c488f8ec610e748c1ca30223a81","size":7304,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.5.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.5_1697600605041_0.7146422458608512"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-18T03:43:25.243Z","publish_time":1697600605243,"_source_registry_name":"default","_cnpm_publish_time":1697600605243},"1.0.4":{"name":"parse-statements","version":"1.0.4","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"67dd3dfba1af8d3e35cb47e5d22d85d19bee18d7","_id":"parse-statements@1.0.4","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"265fa0f14d740d90ac2c1be5154161ecb84743fa","size":7280,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.4.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.4_1697513384814_0.9018426639282238"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-17T03:29:45.176Z","publish_time":1697513385176,"_source_registry_name":"default","_cnpm_publish_time":1697513385176},"1.0.3":{"name":"parse-statements","version":"1.0.3","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"7655a51ac695ad0cbb71982d8e93455cdb34a404","_id":"parse-statements@1.0.3","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"1c2c9900fc4c31a2e19958d09df25044458016da","size":6771,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.3.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.3_1696035469180_0.26999971567588554"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-30T00:57:49.388Z","publish_time":1696035469388,"_source_registry_name":"default","_cnpm_publish_time":1696035469388},"1.0.2":{"name":"parse-statements","version":"1.0.2","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"af5f81ba8bea852740262ba3996ab9093b496830","_id":"parse-statements@1.0.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"261b7a363f225b0b53030d9c6a97707e181a4adb","size":6709,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.2.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.2_1695824389118_0.12907023481127333"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-27T14:19:49.351Z","publish_time":1695824389351,"_source_registry_name":"default","_cnpm_publish_time":1695824389351},"1.0.1":{"name":"parse-statements","version":"1.0.1","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"18768222523b1c9986ea47cabad040930ddba58e","_id":"parse-statements@1.0.1","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"3b8d787ae5bd063df3997409d3c523e786ce6b8d","size":6706,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.1.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.1_1695817537881_0.6208723788435426"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-27T12:25:39.042Z","publish_time":1695817539042,"_source_registry_name":"default","_cnpm_publish_time":1695817539042},"1.0.0":{"name":"parse-statements","version":"1.0.0","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/joomcode/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/joomcode/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"3271ed98d54ec132adf28b130d412266b9a8a08a","_id":"parse-statements@1.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"04f4f0f3a247ed76b484ec713438ed319dedc92c","size":6704,"noattachment":false,"key":"/parse-statements/-/parse-statements-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-1.0.0.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_1.0.0_1695779506058_0.9816299933511863"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-27T01:51:46.219Z","publish_time":1695779506219,"_source_registry_name":"default","_cnpm_publish_time":1695779506219},"0.0.10":{"name":"parse-statements","version":"0.0.10","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.2"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"a4888d5ca591a291b36f6a574db015c464c4d1db","_id":"parse-statements@0.0.10","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"56e0e114d005a7f731f70a6e511bfa52232ad957","size":6702,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.10.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.10.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.10_1693812533177_0.46059577561869314"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-04T07:28:53.366Z","publish_time":1693812533366,"_source_registry_name":"default","_cnpm_publish_time":1693812533366},"0.0.9":{"name":"parse-statements","version":"0.0.9","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"74963a3b90d1d5a63bbd7ba663c9fbf217e48a23","_id":"parse-statements@0.0.9","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"5d74fc4531c16c41fdfea6566427bd79dcd46f7d","size":6300,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.9.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.9_1692410694994_0.6488233781756483"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-19T02:04:55.248Z","publish_time":1692410695248,"_source_registry_name":"default","_cnpm_publish_time":1692410695248},"0.0.8":{"name":"parse-statements","version":"0.0.8","description":"Fast and easy parser of statements in source code in any language ✂️","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm -f *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"d90c65ce669058181b48433588dcb3af4999155a","_id":"parse-statements@0.0.8","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"8b23c2f871252937f28399ca18ad7cedb4155cd8","size":6302,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.8.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.8_1691977316804_0.8914003536500246"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-14T01:41:56.948Z","publish_time":1691977316948,"_source_registry_name":"default","_cnpm_publish_time":1691977316948},"0.0.7":{"name":"parse-statements","version":"0.0.7","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"99c53f7e07bceaf31d469a26c4af7d7580464abb","_id":"parse-statements@0.0.7","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"c6c3dad32e4242dbb1f5c8ae7c8cf1933f4ff9d4","size":6235,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.7.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.7_1691242196465_0.06343861317974553"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-05T13:29:56.667Z","publish_time":1691242196667,"_source_registry_name":"default","_cnpm_publish_time":1691242196667},"0.0.6":{"name":"parse-statements","version":"0.0.6","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"3ea730985337720317730bf48123a76199f51bb4","_id":"parse-statements@0.0.6","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"600998e829838295b54a004c62fa88407d7aa3a8","size":6225,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.6.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.6_1690639089543_0.8199875299672501"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-29T13:58:09.723Z","publish_time":1690639089723,"_source_registry_name":"default","_cnpm_publish_time":1690639089723},"0.0.5":{"name":"parse-statements","version":"0.0.5","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"324e78470a585c2bcfc1a4da581b060e9d4ae3ae","_id":"parse-statements@0.0.5","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"5b7a1010235457acf7f2ed395b68cf70b42f1c05","size":6225,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.5.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.5_1690595393430_0.825671307040946"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-29T01:49:53.553Z","publish_time":1690595393553,"_source_registry_name":"default","_cnpm_publish_time":1690595393553},"0.0.4":{"name":"parse-statements","version":"0.0.4","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"2409ecf390f33fa556765339c45f48c020891604","_id":"parse-statements@0.0.4","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"c2b05b2edeeb0af4a6ad93f5fdd820260dad4368","size":6225,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.4.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.4_1690495310924_0.8115547128158729"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-27T22:01:51.099Z","publish_time":1690495311099,"_source_registry_name":"default","_cnpm_publish_time":1690495311099},"0.0.3":{"name":"parse-statements","version":"0.0.3","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"0d9d96f6b25e262674cc194f5d28ebd30da20a22","_id":"parse-statements@0.0.3","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"c9c48016028032d16a51b15025792313fa5965cf","size":6190,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.3.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.3_1690382925162_0.04554914390972553"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-26T14:48:45.331Z","publish_time":1690382925331,"_source_registry_name":"default","_cnpm_publish_time":1690382925331},"0.0.2":{"name":"parse-statements","version":"0.0.2","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=3","typescript":">=5.1"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@9","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run prettier && npm run build && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","gitHead":"633cc9244b2b12db55ef326ec2960932a9988f7b","_id":"parse-statements@0.0.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"d120dff64081624857f0d0288c12e42d8fc4c5bd","size":6121,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.2.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.2_1690255748028_0.8180969824428777"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-25T03:29:08.170Z","publish_time":1690255748170,"_source_registry_name":"default","_cnpm_publish_time":1690255748170},"0.0.1":{"name":"parse-statements","version":"0.0.1","description":"Fast and easy parser of statements in source code in any language","author":{"name":"uid11"},"bugs":{"url":"https://github.com/uid11/parse-statements/issues"},"devDependencies":{"prettier":">=2.8","typescript":">=5.0"},"exports":{".":"./index.js"},"homepage":"https://github.com/uid11/parse-statements#readme","keywords":["parse","parser","source","statement"],"license":"MIT","packageManager":"npm@8","repository":{"type":"git","url":"git+https://github.com/uid11/parse-statements.git"},"scripts":{"prebuild":"rm --force *.js *.d.ts","build":"tsc","prettier":"prettier --cache --cache-strategy=content --write . !package-lock.json","test":"export _START=$(date +%s%3N) && npm run build && npm run prettier && node ./index.spec.js","prepublishOnly":"npm test"},"sideEffects":false,"types":"index.d.ts","_id":"parse-statements@0.0.1","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"shasum":"3bf617f35dbc552ad13f0ab81e1b81ac9d07eb19","size":2031,"noattachment":false,"key":"/parse-statements/-/parse-statements-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/parse-statements/download/parse-statements-0.0.1.tgz"},"_npmUser":{"name":"uid-11222","email":"UID.11222@gmail.com"},"directories":{},"maintainers":[{"name":"uid-11222","email":"UID.11222@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-statements_0.0.1_1683637582750_0.6435195698092224"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-09T13:06:22.924Z","publish_time":1683637582924,"_source_registry_name":"default","_cnpm_publish_time":1683637582924}},"readme":"# parse-statements ✂️\n\n[![NPM version][npm-image]][npm-url]\n[![dependencies: none][dependencies-none-image]][dependencies-none-url]\n[![minzipped size][size-image]][size-url]\n[![code style: prettier][prettier-image]][prettier-url]\n[![Conventional Commits][conventional-commits-image]][conventional-commits-url]\n[![License MIT][license-image]][license-url]\n\nFast and easy parser of statements in source code in any language.\n\n`parse-statements` ✂️ allows you to parse statements consisting of a sequence of tokens\nwith arbitrary text between them. Statements cannot overlap.\n\nIn addition to statements, language comments can be described, which can also be located\ninside statements (between its neighboring tokens).\n\nStrings are used to describe (find) tokens, from which regexps with `gmu` flags\n(by default, but can be overridden in the parser options) are generated.\nTherefore, the backslash in these lines must be escaped, that is, it must be doubled.\n\nFor each parsed statement, the optional `onParse` callback is called with the context,\nsource code (string), and an array of tokens of statement\n(and an array of comments between this token and the next one, if any).\n\nIf the sequence of tokens of statement has not completed, instead of the `onParse` callback,\nan `onError` callback with the same signature is called, receiving an incomplete sequence\nof parsed tokens of statement.\n\nSimilar optional callbacks can be set for comments.\n\nCallbacks for statements (only for statements, not for comments) can return a number\ninstead of an `undefined` — then this number will be used as an index at the source code,\nstarting from which the parser will find the next statement.\n\nIn fact, this index will be interpreted as the end of the statement. By default,\nthe end of the statement coincides with the end of its last token,\nbut sometimes we may need to go beyond the boundaries of the found tokens\n(or, conversely, reduce the length of the statement, that is, reduce its end index).\n\nWith such manual parsing, if we increase the index of the end of the statement,\nwe must remember to manually parse the comments that may appear\nin this part of the statement — because the parser itself will not do this.\nIt will continue to work from the new end of the statement as usual.\n\n## Basic example\n\nBelow is a simplified example ([see on TypeScript Playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbwMZQKYEMaoArqgZ1QDEBXAOyRmAjIF84AzKCEOAcjD0IFp8ZNUIVGRj42AbgBQk0JFhwYATzCpEAeTIBhFkJEBRKMygAaOBu0hdMXAVSmNNwvSYt2nW735YrYqZKQ0fAoAFswA7gZGcAC8cAAUQvj46ADmqABccHxQwGQpAJSZAG4QwAAmMQB8iJJwIeFwZKhhcJHQCahJqaj5UrR+Sipw2iKoAB7wsQBKGGU0ADaKADwItXCohtD4meQA1mQQYWQA2gC6UnXjcqKZx1fQN1kwOXmmAHQfAZbCj9m5KWdTmcLnBZA9tnBjmDYJk-q84B83l8fLDnv9AcC1iASPMqPNcqgLCini8Aec1vh-vNUPimkSfhC4WS+pU-AEyEE0jB6SIAMoQEhQJCqWJxCkCoUZEn-YxrTjAKCZNDoOZkRaQhDCMqZMgkEAAIw2tFMCD4eBgOr1hqgtFOssK0ryVSyEuFb3w+OFcXlUGOAAZTm8taYfccAIyBs2wXrSdlBGg8mBtRVmLQ6H7JpYjLATaqigD67JzMFM+FddkQUZgtHyztWdRgoUOybiZcFbo9wC9VfyMf6scC8AT6ZEjil5hH1i4qCzNGLefipqpNIJifwxpd7YrmrIZQ3pv4sBrdYpy9phMn+DeYBI+GCrfL7s9qDiwae5t7fTZg7gNGTmQcadZ1GXMYkXDYjHXUty3eD4YAgXZhHwWtomqet1k2Ahr1ve820lJ8uxfeDEI5f1TgAQndQ8SwUBCkOOYikLeak8kbOBuDgCNKK1OAAGo4AAZj9T9JH7fwfz-MZrjHACyDHYDi1MASFzFOpNSk8FjXFLdZUuDTYF5ajdPWfSYAAGWAPg9F3Yz7lgayyntE86jjeA7JgQzzTXMD3M82AkUvAB+N4QHQMA4m9dAFRQ6ouUTfktwfHS4B9ESXJ-dyLL4bzYkyyyk13ALvhEfBgtC8LIui504snBLJSSyUQyiqARLWdyrxvO84mONY6jwjtn1fUy-JgIMbJM64HKoj9jLqREhuuEbvIAH2WyFTnyWaEQ+BaHiy7lLzgVb1s2tYNq-AcOSHMgAElwAeGTU3k7Nxho5SwNUxBoVELS+pgtZvpG4zvqIZgQGB+77JsyQYpqdKrtBSGPOonLEcW6iip8Mqwoi1LqtQA7io88sGuFJropjeGghBsHUZplhMYZbGKrx1C4Bqom6u7GCUua1q6m+jqcO63rN3wzsvUBjG32+qaey2+apa8w7jrOU66jmnb6ZAFa1rV4zztE78EfcQg7uufA9FM-AwJQDAsDHUgKCoGgFNeyo4nQ5EGVuUX0I138yH-QPE2TLa6hoR7hyJsdw9okiIWONgAB1k4AelTtO2FMNgABJU7IQK2DtUXfo1-2Nb-TDMmjqww9FiO5OnTJPexXFgHPNcN367ctX3KtjzZiuA7bvFV0vbCup7givTfHtKYDuAy4DxiOVuFP09TgAqbP2G3zPi62suS8b4O4kLOdXtMfMe9MRJkjSWHG3CFt7+6dX328H3IT9hu4CQdAt0KDzBIGUC8RMITPBIHYP+VcjBx0js3QO5sHrTjgOgG2gFbBx1XonNgAA9b6qd9S7w3vqFwIBiGkPzsnQuh8-53gFPMMovIMBCmCAAIVQAwaA4DiRQJgQHZecNF4AKAUgEBYC1yZAEQgoOmE5FRyDqZMc6DMFN2wX-XB698HuSoTnVOtBqEFyLifRejCcQsLYUgTh3DeHSIUFAaBR8DayhrMbamSNLbW0yC9CYYF0IQS2LcMx7UQkQwtuErEOIx50kvFEvqZ5x4QKiWJU2qAUGwG8RbT6gsrYW2MgAAxkEjRAPCIDODBuwN4adykSBKdcOA+o8CMCqWwGpzSoBsGkGnNOcAAAqwRLKghtugf+k5pDfTgGnLeLohDjKJnALefTOmtNcJ0vwbB0DzDLGjB4azWAbO6Q0-ZqyKHVLTs0gAXscqZYRgBsSCVAKQUzekLKsKCMgez5D3MbAKeAFC-DuTKRACp0zZnbN2d7EQ9BllSGBTM95PxPkTQeLCvpCBOm0EkIU+0HiIDUmYhAFIcQ8nWxjEAA))\nof parsing `import` and `export` statements in ECMAScript\n(a complete example can be found [here](https://github.com/joomcode/parse-imports-exports/blob/main/src/index.ts)):\n\n```ts\nimport {createParseFunction} from 'parse-statements';\n\nimport type {OnCommentError, OnCommentParse, OnParse} from 'parse-statements';\n\nconst throwError = (message: string): void => {\n  throw new Error(message);\n};\n\ntype Context = Readonly<{\n  errors: unknown[];\n  exports: [exports: string, ...comments: string[]][];\n  imports: [import: string, ...comments: string[]][];\n  multilineComments: string[];\n  singlelineComments: string[];\n}>;\n\nconst getCommentSource = (\n  source: string,\n  pair: readonly [{end: number}, {start: number}],\n): string => source.slice(pair[0].end, pair[1].start);\n\nconst onCommentError: OnCommentError<Context> = (_context, source, {start}) => {\n  throwError(source.slice(start));\n};\n\nconst onCommentParse: OnCommentParse<Context> = ({singlelineComments}, source, {end}, {start}) => {\n  singlelineComments.push(source.slice(end, start));\n};\n\nconst onError: OnParse<Context> = ({errors}, source, ...tokens) => {\n  errors.push(source.slice(tokens[0]!.start, tokens[tokens.length - 1]!.end + 30));\n};\n\nconst onExportParse: OnParse<Context, 3> = (\n  {exports},\n  source,\n  exportStart,\n  exportListEnd,\n  exportEnd,\n) => {\n  const exportStartComments = exportStart.comments?.map((pair) => getCommentSource(source, pair));\n  const exportListComments = exportListEnd.comments?.map((pair) => getCommentSource(source, pair));\n\n  exports.push([\n    source.slice(exportStart.end, exportEnd.start),\n    ...(exportStartComments || []),\n    ...(exportListComments || []),\n  ]);\n};\n\nconst onImportParse: OnParse<Context, 3> = (\n  {imports},\n  source,\n  importStart,\n  importFrom,\n  importEnd,\n) => {\n  const importStartComments = importStart.comments?.map((pair) => getCommentSource(source, pair));\n  const importFromComments = importFrom.comments?.map((pair) => getCommentSource(source, pair));\n\n  imports.push([\n    source.slice(importStart.end, importEnd.start),\n    ...(importStartComments || []),\n    ...(importFromComments || []),\n  ]);\n};\n\nconst parseImportsExports = createParseFunction<Context>({\n  comments: [\n    {\n      onError: onCommentError,\n      onParse: onCommentParse,\n      tokens: ['\\\\/\\\\/', '$\\\\n?'],\n    },\n    {\n      onError: onCommentError,\n      onParse: ({multilineComments}, source, {end}, {start}) => {\n        multilineComments.push(source.slice(end, start));\n      },\n      tokens: ['\\\\/\\\\*', '\\\\*\\\\/'],\n    },\n  ],\n  onError: (_context, _source, message) => throwError(message),\n  statements: [\n    {\n      canIncludeComments: true,\n      onError,\n      onParse: onImportParse as OnParse,\n      tokens: ['^import\\\\b', '\\\\bfrom\\\\b', '$\\\\n?'],\n      shouldSearchBeforeComments: true,\n    },\n    {\n      canIncludeComments: true,\n      onError,\n      onParse: onExportParse as OnParse,\n      tokens: ['^export\\\\b', '\\\\}', '$\\\\n?'],\n      shouldSearchBeforeComments: true,\n    },\n  ],\n});\n\nconst importsExports: Context = {\n  errors: [],\n  exports: [],\n  imports: [],\n  multilineComments: [],\n  singlelineComments: [],\n};\n\nparseImportsExports(\n  importsExports,\n  `\nimport {foo} from './foo';\nimport bar from './bar'\n\n// This is a comment\n\nimport /* some comment */ bar from bar;\n\n'also import from bar;'\n\nimport bar from './baz'\n\nimport with error;\nimport // comment in import without from;\n\nexport {foo} /* also comment} */;\nexport /* comment in export} */ {bar}\n`,\n);\n\nconsole.log(importsExports);\n```\n\n## Install\n\nRequires [node](https://nodejs.org/en/) version 10 or higher:\n\n```sh\nnpm install parse-statements\n```\n\n`parse-statements` ✂️ works in any environment that supports ES2018\n(because package uses [RegExp Named Capture Groups](https://github.com/tc39/proposal-regexp-named-groups)).\n\n## API\n\n`parse-statements` ✂️ exports one runtime value — the `createParseFunction` function:\n\n```ts\nimport {createParseFunction} from 'parse-statements';\n\ntype Context = ...; // some type\n\nconst parse = createParseFunction<Context>(options);\n\nconst context: Context = ...;\n\nparse(context, 'some source code (as string)');\n```\n\nThe `options` object defines comments, statements, `RegExp` flags and a global error callback handler\n(all of these fields are optional):\n\n```ts\nimport type {Comment, OnGlobalError, Options, ParsedToken, Statement} from 'parse-statements';\n\nconst options: Options<Context> = {\n  comments, // an optional array of comments\n  onError, // an optional callback handler for global parsing errors\n  regexpFlags: 'gmu', // an optional `RegExp` flags used to create all regexps (defaults to `'gmu'`)\n  statements, // an optional array of statements\n};\n\nconst comments: readonly Comment<Context>[] = [\n  {\n    onError(\n      context: Context,\n      source: string,\n      parsedToken: {start: number; end: number; match: RegExpExecArray; token: string},\n    ) {\n      // An optional callback handler is called if, after the opening comment token,\n      // its closing token was not found.\n      // Parsing continues from the point immediately after the opening token.\n    },\n    onParse(\n      context: Context,\n      source: string,\n      openParsedToken: {start: number; end: number; match: RegExpExecArray; token: string},\n      closeParsedToken: {start: number; end: number; match: RegExpExecArray; token: string},\n    ) {\n      // An optional callback handler of comment for putting something in context.\n      // The handler is called when the parsing of the comment is completed,\n      // that is, the parsing of the close comment token is completed.\n      // The handler receives opening parsed token and closing parsed token.\n      // Parsing continues from the point immediately after the closing token.\n    },\n    // Opening and closing tokens of comment\n    // (which are converted to regexps using the `RegExp` constructor).\n    tokens: ['open raw token', 'close raw token'],\n  },\n];\n\nconst onError: OnGlobalError<Context> = (\n  context: Context,\n  source: string,\n  message: string,\n  index: number,\n) => {\n  // An optional callback handler is called when there are global parsing errors.\n};\n\nconst statements: readonly Statement<Context>[] = [\n  {\n    // If `true`, then we parse comments inside the statement (between its parts).\n    canIncludeComments: true,\n    onError(\n      context: Context,\n      source: string,\n      firstParsedToken: ParsedToken & {comments?: [ParsedToken, ParsedToken][]},\n      secondParsedToken: ParsedToken & {comments?: [ParsedToken, ParsedToken][]},\n      // ...,\n      lastParsedToken: ParsedToken,\n    ) {\n      // An optional callback handler is called if parsing the statement failed, that is,\n      // parsing started with the first statement token, but some next token was not found.\n      // The handler receives all already parsed statement tokens.\n      // If there were comments between a token and its next token, they are passed\n      // to the parsed token object as a separate `comments` property\n      // (thus, the last parsed token cannot have comments).\n      // Parsing continues from the point immediately after the last parsed token.\n    },\n    onParse(\n      context: Context,\n      source: string,\n      firstParsedToken: ParsedToken & {comments?: [ParsedToken, ParsedToken][]},\n      secondParsedToken: ParsedToken & {comments?: [ParsedToken, ParsedToken][]},\n      // ...,\n      lastParsedToken: ParsedToken,\n    ) {\n      // An optional callback handler of statement for putting something in context.\n      // The handler is called when the parsing of the statement is completed,\n      // that is, the parsing of the last statement token is completed.\n      // The handler receives all parsed statement tokens.\n      // If there were comments between a token and its next token, they are passed\n      // to the parsed token object as a separate `comments` property\n      // (thus, the last parsed token cannot have comments).\n      // Parsing continues from the point immediately after the last statement token.\n    },\n    // Not-empty array of statement raw tokens\n    // (which are converted to regexps using the `RegExp` constructor).\n    // A statement can have any positive number of tokens.\n    tokens: ['first raw token', 'second raw token'],\n    // If `true`, then the statement fisrt token is searched before the comment tokens,\n    // otherwise after. This can affect parsing because if several different tokens\n    // (first tokens of statements or opening comment tokens) are found\n    // at some position in the source, only the first one will be selected and parsed.\n    shouldSearchBeforeComments: true,\n  },\n];\n```\n\n`parse-statements` ✂️ also exports all types included in the API:\n\n```ts\nexport type {\n  /**\n   * Description of comment as the callback handlers and open and close tokens.\n   */\n  Comment,\n  /**\n   * Pair of the comment open and close tokens (raw or parsed).\n   */\n  CommentPair,\n  /**\n   * `onError` callback handler for error on comment parsing.\n   */\n  OnCommentError,\n  /**\n   * `onParse` callback handler of comment.\n   */\n  OnCommentParse,\n  /**\n   * Global `onError` callback handler for error on parsing.\n   */\n  OnGlobalError,\n  /**\n   * `onParse` callback handler of statement with concrete length (number of tokens).\n   */\n  OnParse,\n  /**\n   * Options of `createParseFunction` function.\n   */\n  Options,\n  /**\n   * Parse function.\n   */\n  Parse,\n  /**\n   * The result of parsing the token.\n   */\n  ParsedToken,\n  /**\n   * Description of statement as the callback handlers and a sequence of tokens.\n   */\n  Statement,\n};\n```\n\n## License\n\n[MIT][license-url]\n\n[conventional-commits-image]: https://img.shields.io/badge/Conventional_Commits-1.0.0-yellow.svg 'The Conventional Commits specification'\n[conventional-commits-url]: https://www.conventionalcommits.org/en/v1.0.0/\n[dependencies-none-image]: https://img.shields.io/badge/dependencies-none-success.svg 'No dependencies'\n[dependencies-none-url]: https://github.com/joomcode/parse-statements/blob/main/package.json\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg 'The MIT License'\n[license-url]: LICENSE\n[npm-image]: https://img.shields.io/npm/v/parse-statements.svg 'parse-statements'\n[npm-url]: https://www.npmjs.com/package/parse-statements\n[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg 'Prettier code formatter'\n[prettier-url]: https://prettier.io/\n[size-image]: https://img.shields.io/bundlephobia/minzip/parse-statements 'parse-statements'\n[size-url]: https://bundlephobia.com/package/parse-statements\n","_attachments":{},"homepage":"https://github.com/joomcode/parse-statements#readme","bugs":{"url":"https://github.com/joomcode/parse-statements/issues"},"license":"MIT"}