Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-better-error-handler

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-better-error-handler - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

coverage/coverage.raw.json

@@ -1,1 +0,1 @@

{"/Users/nexus/Public/koa-better-error-handler/lib/index.js":{"path":"/Users/nexus/Public/koa-better-error-handler/lib/index.js","statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}},"2":{"start":{"line":7,"column":19},"end":{"line":7,"column":55}},"3":{"start":{"line":9,"column":20},"end":{"line":9,"column":56}},"4":{"start":{"line":11,"column":17},"end":{"line":11,"column":64}},"5":{"start":{"line":13,"column":18},"end":{"line":13,"column":52}},"6":{"start":{"line":15,"column":25},"end":{"line":15,"column":74}},"7":{"start":{"line":17,"column":25},"end":{"line":17,"column":67}},"8":{"start":{"line":19,"column":10},"end":{"line":19,"column":23}},"9":{"start":{"line":21,"column":11},"end":{"line":21,"column":38}},"10":{"start":{"line":23,"column":12},"end":{"line":23,"column":27}},"11":{"start":{"line":25,"column":13},"end":{"line":25,"column":42}},"12":{"start":{"line":27,"column":13},"end":{"line":27,"column":29}},"13":{"start":{"line":29,"column":14},"end":{"line":29,"column":44}},"14":{"start":{"line":31,"column":14},"end":{"line":31,"column":31}},"15":{"start":{"line":33,"column":15},"end":{"line":33,"column":46}},"16":{"start":{"line":35,"column":12},"end":{"line":35,"column":27}},"17":{"start":{"line":37,"column":13},"end":{"line":37,"column":42}},"18":{"start":{"line":39,"column":10},"end":{"line":39,"column":23}},"19":{"start":{"line":41,"column":11},"end":{"line":41,"column":38}},"20":{"start":{"line":43,"column":12},"end":{"line":43,"column":27}},"21":{"start":{"line":45,"column":13},"end":{"line":45,"column":42}},"22":{"start":{"line":48,"column":2},"end":{"line":48,"column":56}},"23":{"start":{"line":51,"column":11},"end":{"line":53,"column":1}},"24":{"start":{"line":55,"column":15},"end":{"line":61,"column":1}},"25":{"start":{"line":65,"column":11},"end":{"line":65,"column":92}},"26":{"start":{"line":66,"column":11},"end":{"line":66,"column":92}},"27":{"start":{"line":68,"column":12},"end":{"line":68,"column":59}},"28":{"start":{"line":78,"column":0},"end":{"line":332,"column":4}},"29":{"start":{"line":79,"column":13},"end":{"line":325,"column":5}},"30":{"start":{"line":81,"column":4},"end":{"line":324,"column":44}},"31":{"start":{"line":82,"column":6},"end":{"line":323,"column":7}},"32":{"start":{"line":83,"column":8},"end":{"line":322,"column":9}},"33":{"start":{"line":85,"column":12},"end":{"line":88,"column":13}},"34":{"start":{"line":86,"column":14},"end":{"line":86,"column":32}},"35":{"start":{"line":87,"column":14},"end":{"line":87,"column":20}},"36":{"start":{"line":90,"column":12},"end":{"line":90,"column":45}},"37":{"start":{"line":94,"column":12},"end":{"line":94,"column":69}},"38":{"start":{"line":94,"column":48},"end":{"line":94,"column":69}},"39":{"start":{"line":96,"column":12},"end":{"line":96,"column":58}},"40":{"start":{"line":98,"column":12},"end":{"line":102,"column":13}},"41":{"start":{"line":99,"column":14},"end":{"line":99,"column":55}},"42":{"start":{"line":100,"column":14},"end":{"line":100,"column":31}},"43":{"start":{"line":101,"column":14},"end":{"line":101,"column":74}},"44":{"start":{"line":105,"column":12},"end":{"line":105,"column":44}},"45":{"start":{"line":108,"column":12},"end":{"line":108,"column":44}},"46":{"start":{"line":110,"column":12},"end":{"line":110,"column":95}},"47":{"start":{"line":110,"column":62},"end":{"line":110,"column":95}},"48":{"start":{"line":114,"column":12},"end":{"line":114,"column":142}},"49":{"start":{"line":114,"column":107},"end":{"line":114,"column":142}},"50":{"start":{"line":116,"column":12},"end":{"line":116,"column":73}},"51":{"start":{"line":116,"column":56},"end":{"line":116,"column":73}},"52":{"start":{"line":119,"column":12},"end":{"line":119,"column":63}},"53":{"start":{"line":121,"column":12},"end":{"line":121,"column":40}},"54":{"start":{"line":124,"column":12},"end":{"line":124,"column":256}},"55":{"start":{"line":126,"column":12},"end":{"line":126,"column":46}},"56":{"start":{"line":129,"column":12},"end":{"line":129,"column":65}},"57":{"start":{"line":131,"column":12},"end":{"line":131,"column":42}},"58":{"start":{"line":134,"column":12},"end":{"line":134,"column":53}},"59":{"start":{"line":139,"column":12},"end":{"line":139,"column":92}},"60":{"start":{"line":140,"column":12},"end":{"line":140,"column":120}},"61":{"start":{"line":142,"column":12},"end":{"line":142,"column":53}},"62":{"start":{"line":144,"column":12},"end":{"line":144,"column":46}},"63":{"start":{"line":150,"column":12},"end":{"line":153,"column":13}},"64":{"start":{"line":151,"column":14},"end":{"line":151,"column":33}},"65":{"start":{"line":152,"column":14},"end":{"line":152,"column":20}},"66":{"start":{"line":155,"column":12},"end":{"line":155,"column":64}},"67":{"start":{"line":156,"column":12},"end":{"line":156,"column":34}},"68":{"start":{"line":157,"column":12},"end":{"line":157,"column":45}},"69":{"start":{"line":162,"column":12},"end":{"line":162,"column":47}},"70":{"start":{"line":163,"column":12},"end":{"line":163,"column":68}},"71":{"start":{"line":164,"column":12},"end":{"line":164,"column":42}},"72":{"start":{"line":165,"column":12},"end":{"line":165,"column":66}},"73":{"start":{"line":167,"column":12},"end":{"line":167,"column":39}},"74":{"start":{"line":169,"column":12},"end":{"line":169,"column":31}},"75":{"start":{"line":170,"column":12},"end":{"line":170,"column":91}},"76":{"start":{"line":171,"column":12},"end":{"line":171,"column":18}},"77":{"start":{"line":175,"column":12},"end":{"line":175,"column":31}},"78":{"start":{"line":177,"column":12},"end":{"line":180,"column":13}},"79":{"start":{"line":178,"column":14},"end":{"line":178,"column":33}},"80":{"start":{"line":179,"column":14},"end":{"line":179,"column":20}},"81":{"start":{"line":182,"column":12},"end":{"line":185,"column":13}},"82":{"start":{"line":183,"column":14},"end":{"line":183,"column":33}},"83":{"start":{"line":184,"column":14},"end":{"line":184,"column":20}},"84":{"start":{"line":187,"column":12},"end":{"line":187,"column":31}},"85":{"start":{"line":189,"column":12},"end":{"line":189,"column":40}},"86":{"start":{"line":190,"column":12},"end":{"line":190,"column":31}},"87":{"start":{"line":191,"column":12},"end":{"line":191,"column":38}},"88":{"start":{"line":194,"column":12},"end":{"line":194,"column":31}},"89":{"start":{"line":195,"column":12},"end":{"line":195,"column":18}},"90":{"start":{"line":198,"column":12},"end":{"line":198,"column":31}},"91":{"start":{"line":199,"column":12},"end":{"line":199,"column":48}},"92":{"start":{"line":201,"column":12},"end":{"line":201,"column":70}},"93":{"start":{"line":202,"column":12},"end":{"line":202,"column":29}},"94":{"start":{"line":205,"column":12},"end":{"line":205,"column":31}},"95":{"start":{"line":206,"column":12},"end":{"line":206,"column":18}},"96":{"start":{"line":209,"column":12},"end":{"line":209,"column":29}},"97":{"start":{"line":212,"column":12},"end":{"line":212,"column":31}},"98":{"start":{"line":213,"column":12},"end":{"line":213,"column":18}},"99":{"start":{"line":216,"column":12},"end":{"line":219,"column":13}},"100":{"start":{"line":217,"column":14},"end":{"line":217,"column":33}},"101":{"start":{"line":218,"column":14},"end":{"line":218,"column":20}},"102":{"start":{"line":224,"column":12},"end":{"line":224,"column":70}},"103":{"start":{"line":224,"column":28},"end":{"line":224,"column":70}},"104":{"start":{"line":227,"column":12},"end":{"line":227,"column":59}},"105":{"start":{"line":227,"column":26},"end":{"line":227,"column":59}},"106":{"start":{"line":231,"column":12},"end":{"line":234,"column":13}},"107":{"start":{"line":232,"column":14},"end":{"line":232,"column":33}},"108":{"start":{"line":233,"column":14},"end":{"line":233,"column":20}},"109":{"start":{"line":236,"column":12},"end":{"line":236,"column":31}},"110":{"start":{"line":238,"column":12},"end":{"line":238,"column":40}},"111":{"start":{"line":239,"column":12},"end":{"line":239,"column":31}},"112":{"start":{"line":240,"column":12},"end":{"line":240,"column":38}},"113":{"start":{"line":243,"column":12},"end":{"line":243,"column":31}},"114":{"start":{"line":244,"column":12},"end":{"line":244,"column":18}},"115":{"start":{"line":247,"column":12},"end":{"line":247,"column":31}},"116":{"start":{"line":248,"column":12},"end":{"line":248,"column":48}},"117":{"start":{"line":250,"column":12},"end":{"line":250,"column":70}},"118":{"start":{"line":251,"column":12},"end":{"line":251,"column":29}},"119":{"start":{"line":254,"column":12},"end":{"line":254,"column":31}},"120":{"start":{"line":255,"column":12},"end":{"line":255,"column":18}},"121":{"start":{"line":258,"column":12},"end":{"line":258,"column":29}},"122":{"start":{"line":261,"column":12},"end":{"line":261,"column":31}},"123":{"start":{"line":262,"column":12},"end":{"line":262,"column":18}},"124":{"start":{"line":267,"column":12},"end":{"line":267,"column":59}},"125":{"start":{"line":267,"column":26},"end":{"line":267,"column":59}},"126":{"start":{"line":272,"column":12},"end":{"line":275,"column":13}},"127":{"start":{"line":273,"column":14},"end":{"line":273,"column":33}},"128":{"start":{"line":274,"column":14},"end":{"line":274,"column":20}},"129":{"start":{"line":277,"column":12},"end":{"line":277,"column":31}},"130":{"start":{"line":278,"column":12},"end":{"line":278,"column":114}},"131":{"start":{"line":281,"column":12},"end":{"line":281,"column":89}},"132":{"start":{"line":299,"column":12},"end":{"line":299,"column":34}},"133":{"start":{"line":302,"column":12},"end":{"line":302,"column":48}},"134":{"start":{"line":305,"column":12},"end":{"line":305,"column":31}},"135":{"start":{"line":306,"column":12},"end":{"line":306,"column":60}},"136":{"start":{"line":307,"column":12},"end":{"line":307,"column":48}},"137":{"start":{"line":310,"column":12},"end":{"line":310,"column":31}},"138":{"start":{"line":311,"column":12},"end":{"line":311,"column":69}},"139":{"start":{"line":312,"column":12},"end":{"line":312,"column":48}},"140":{"start":{"line":316,"column":12},"end":{"line":316,"column":55}},"141":{"start":{"line":317,"column":12},"end":{"line":317,"column":36}},"142":{"start":{"line":321,"column":12},"end":{"line":321,"column":35}},"143":{"start":{"line":328,"column":4},"end":{"line":328,"column":39}},"144":{"start":{"line":331,"column":2},"end":{"line":331,"column":22}},"145":{"start":{"line":337,"column":2},"end":{"line":337,"column":49}},"146":{"start":{"line":337,"column":38},"end":{"line":337,"column":49}},"147":{"start":{"line":340,"column":15},"end":{"line":340,"column":17}},"148":{"start":{"line":343,"column":2},"end":{"line":353,"column":5}},"149":{"start":{"line":346,"column":4},"end":{"line":352,"column":75}},"150":{"start":{"line":346,"column":61},"end":{"line":346,"column":88}},"151":{"start":{"line":346,"column":93},"end":{"line":352,"column":75}},"152":{"start":{"line":349,"column":6},"end":{"line":349,"column":33}},"153":{"start":{"line":352,"column":6},"end":{"line":352,"column":75}},"154":{"start":{"line":355,"column":2},"end":{"line":355,"column":34}},"155":{"start":{"line":356,"column":2},"end":{"line":356,"column":13}}},"fnMap":{"1":{"name":"_interopRequireDefault","decl":{"start":{"line":47,"column":9},"end":{"line":47,"column":31}},"loc":{"start":{"line":47,"column":37},"end":{"line":49,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":78,"column":18},"end":{"line":78,"column":19}},"loc":{"start":{"line":78,"column":30},"end":{"line":332,"column":1}}},"3":{"name":"_callee","decl":{"start":{"line":79,"column":81},"end":{"line":79,"column":88}},"loc":{"start":{"line":79,"column":94},"end":{"line":325,"column":3}}},"4":{"name":"_callee$","decl":{"start":{"line":81,"column":47},"end":{"line":81,"column":55}},"loc":{"start":{"line":81,"column":66},"end":{"line":324,"column":5}}},"5":{"name":"errorHandler","decl":{"start":{"line":327,"column":11},"end":{"line":327,"column":23}},"loc":{"start":{"line":327,"column":28},"end":{"line":329,"column":3}}},"6":{"name":"parseValidationError","decl":{"start":{"line":334,"column":9},"end":{"line":334,"column":29}},"loc":{"start":{"line":334,"column":35},"end":{"line":357,"column":1}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":343,"column":36},"end":{"line":343,"column":37}},"loc":{"start":{"line":343,"column":53},"end":{"line":353,"column":3}}}},"branchMap":{"1":{"loc":{"start":{"line":48,"column":9},"end":{"line":48,"column":55}},"type":"cond-expr","locations":[{"start":{"line":48,"column":33},"end":{"line":48,"column":36}},{"start":{"line":48,"column":39},"end":{"line":48,"column":55}}]},"2":{"loc":{"start":{"line":48,"column":9},"end":{"line":48,"column":30}},"type":"binary-expr","locations":[{"start":{"line":48,"column":9},"end":{"line":48,"column":12}},{"start":{"line":48,"column":16},"end":{"line":48,"column":30}}]},"3":{"loc":{"start":{"line":83,"column":8},"end":{"line":322,"column":9}},"type":"switch","locations":[{"start":{"line":84,"column":10},"end":{"line":90,"column":45}},{"start":{"line":92,"column":10},"end":{"line":157,"column":45}},{"start":{"line":159,"column":10},"end":{"line":171,"column":18}},{"start":{"line":173,"column":10},"end":{"line":191,"column":38}},{"start":{"line":193,"column":10},"end":{"line":195,"column":18}},{"start":{"line":197,"column":10},"end":{"line":202,"column":29}},{"start":{"line":204,"column":10},"end":{"line":206,"column":18}},{"start":{"line":208,"column":10},"end":{"line":209,"column":29}},{"start":{"line":211,"column":10},"end":{"line":213,"column":18}},{"start":{"line":215,"column":10},"end":{"line":240,"column":38}},{"start":{"line":242,"column":10},"end":{"line":244,"column":18}},{"start":{"line":246,"column":10},"end":{"line":251,"column":29}},{"start":{"line":253,"column":10},"end":{"line":255,"column":18}},{"start":{"line":257,"column":10},"end":{"line":258,"column":29}},{"start":{"line":260,"column":10},"end":{"line":262,"column":18}},{"start":{"line":264,"column":10},"end":{"line":278,"column":114}},{"start":{"line":280,"column":10},"end":{"line":281,"column":89}},{"start":{"line":283,"column":10},"end":{"line":299,"column":34}},{"start":{"line":301,"column":10},"end":{"line":302,"column":48}},{"start":{"line":304,"column":10},"end":{"line":307,"column":48}},{"start":{"line":309,"column":10},"end":{"line":312,"column":48}},{"start":{"line":314,"column":10},"end":{"line":317,"column":36}},{"start":{"line":319,"column":10},"end":{"line":319,"column":18}},{"start":{"line":320,"column":10},"end":{"line":321,"column":35}}]},"4":{"loc":{"start":{"line":85,"column":12},"end":{"line":88,"column":13}},"type":"if","locations":[{"start":{"line":85,"column":12},"end":{"line":88,"column":13}},{"start":{"line":85,"column":12},"end":{"line":88,"column":13}}]},"5":{"loc":{"start":{"line":94,"column":12},"end":{"line":94,"column":69}},"type":"if","locations":[{"start":{"line":94,"column":12},"end":{"line":94,"column":69}},{"start":{"line":94,"column":12},"end":{"line":94,"column":69}}]},"6":{"loc":{"start":{"line":98,"column":12},"end":{"line":102,"column":13}},"type":"if","locations":[{"start":{"line":98,"column":12},"end":{"line":102,"column":13}},{"start":{"line":98,"column":12},"end":{"line":102,"column":13}}]},"7":{"loc":{"start":{"line":110,"column":12},"end":{"line":110,"column":95}},"type":"if","locations":[{"start":{"line":110,"column":12},"end":{"line":110,"column":95}},{"start":{"line":110,"column":12},"end":{"line":110,"column":95}}]},"8":{"loc":{"start":{"line":110,"column":16},"end":{"line":110,"column":60}},"type":"binary-expr","locations":[{"start":{"line":110,"column":16},"end":{"line":110,"column":46}},{"start":{"line":110,"column":50},"end":{"line":110,"column":60}}]},"9":{"loc":{"start":{"line":114,"column":12},"end":{"line":114,"column":142}},"type":"if","locations":[{"start":{"line":114,"column":12},"end":{"line":114,"column":142}},{"start":{"line":114,"column":12},"end":{"line":114,"column":142}}]},"10":{"loc":{"start":{"line":114,"column":16},"end":{"line":114,"column":105}},"type":"binary-expr","locations":[{"start":{"line":114,"column":16},"end":{"line":114,"column":53}},{"start":{"line":114,"column":57},"end":{"line":114,"column":105}}]},"11":{"loc":{"start":{"line":116,"column":12},"end":{"line":116,"column":73}},"type":"if","locations":[{"start":{"line":116,"column":12},"end":{"line":116,"column":73}},{"start":{"line":116,"column":12},"end":{"line":116,"column":73}}]},"12":{"loc":{"start":{"line":124,"column":26},"end":{"line":124,"column":255}},"type":"binary-expr","locations":[{"start":{"line":124,"column":26},"end":{"line":124,"column":65}},{"start":{"line":124,"column":69},"end":{"line":124,"column":113}},{"start":{"line":124,"column":117},"end":{"line":124,"column":158}},{"start":{"line":124,"column":162},"end":{"line":124,"column":201}},{"start":{"line":124,"column":205},"end":{"line":124,"column":255}}]},"13":{"loc":{"start":{"line":139,"column":74},"end":{"line":139,"column":91}},"type":"binary-expr","locations":[{"start":{"line":139,"column":74},"end":{"line":139,"column":84}},{"start":{"line":139,"column":88},"end":{"line":139,"column":91}}]},"14":{"loc":{"start":{"line":140,"column":24},"end":{"line":140,"column":119}},"type":"cond-expr","locations":[{"start":{"line":140,"column":37},"end":{"line":140,"column":55}},{"start":{"line":140,"column":58},"end":{"line":140,"column":119}}]},"15":{"loc":{"start":{"line":150,"column":12},"end":{"line":153,"column":13}},"type":"if","locations":[{"start":{"line":150,"column":12},"end":{"line":153,"column":13}},{"start":{"line":150,"column":12},"end":{"line":153,"column":13}}]},"16":{"loc":{"start":{"line":150,"column":18},"end":{"line":150,"column":51}},"type":"binary-expr","locations":[{"start":{"line":150,"column":18},"end":{"line":150,"column":33}},{"start":{"line":150,"column":37},"end":{"line":150,"column":51}}]},"17":{"loc":{"start":{"line":170,"column":28},"end":{"line":170,"column":90}},"type":"cond-expr","locations":[{"start":{"line":170,"column":53},"end":{"line":170,"column":55}},{"start":{"line":170,"column":58},"end":{"line":170,"column":90}}]},"18":{"loc":{"start":{"line":170,"column":58},"end":{"line":170,"column":90}},"type":"cond-expr","locations":[{"start":{"line":170,"column":83},"end":{"line":170,"column":85}},{"start":{"line":170,"column":88},"end":{"line":170,"column":90}}]},"19":{"loc":{"start":{"line":177,"column":12},"end":{"line":180,"column":13}},"type":"if","locations":[{"start":{"line":177,"column":12},"end":{"line":180,"column":13}},{"start":{"line":177,"column":12},"end":{"line":180,"column":13}}]},"20":{"loc":{"start":{"line":182,"column":12},"end":{"line":185,"column":13}},"type":"if","locations":[{"start":{"line":182,"column":12},"end":{"line":185,"column":13}},{"start":{"line":182,"column":12},"end":{"line":185,"column":13}}]},"21":{"loc":{"start":{"line":216,"column":12},"end":{"line":219,"column":13}},"type":"if","locations":[{"start":{"line":216,"column":12},"end":{"line":219,"column":13}},{"start":{"line":216,"column":12},"end":{"line":219,"column":13}}]},"22":{"loc":{"start":{"line":216,"column":18},"end":{"line":216,"column":51}},"type":"binary-expr","locations":[{"start":{"line":216,"column":18},"end":{"line":216,"column":28}},{"start":{"line":216,"column":32},"end":{"line":216,"column":51}}]},"23":{"loc":{"start":{"line":224,"column":12},"end":{"line":224,"column":70}},"type":"if","locations":[{"start":{"line":224,"column":12},"end":{"line":224,"column":70}},{"start":{"line":224,"column":12},"end":{"line":224,"column":70}}]},"24":{"loc":{"start":{"line":227,"column":12},"end":{"line":227,"column":59}},"type":"if","locations":[{"start":{"line":227,"column":12},"end":{"line":227,"column":59}},{"start":{"line":227,"column":12},"end":{"line":227,"column":59}}]},"25":{"loc":{"start":{"line":231,"column":12},"end":{"line":234,"column":13}},"type":"if","locations":[{"start":{"line":231,"column":12},"end":{"line":234,"column":13}},{"start":{"line":231,"column":12},"end":{"line":234,"column":13}}]},"26":{"loc":{"start":{"line":267,"column":12},"end":{"line":267,"column":59}},"type":"if","locations":[{"start":{"line":267,"column":12},"end":{"line":267,"column":59}},{"start":{"line":267,"column":12},"end":{"line":267,"column":59}}]},"27":{"loc":{"start":{"line":272,"column":12},"end":{"line":275,"column":13}},"type":"if","locations":[{"start":{"line":272,"column":12},"end":{"line":275,"column":13}},{"start":{"line":272,"column":12},"end":{"line":275,"column":13}}]},"28":{"loc":{"start":{"line":272,"column":18},"end":{"line":272,"column":94}},"type":"binary-expr","locations":[{"start":{"line":272,"column":18},"end":{"line":272,"column":35}},{"start":{"line":272,"column":39},"end":{"line":272,"column":53}},{"start":{"line":272,"column":57},"end":{"line":272,"column":69}},{"start":{"line":272,"column":73},"end":{"line":272,"column":94}}]},"29":{"loc":{"start":{"line":337,"column":2},"end":{"line":337,"column":49}},"type":"if","locations":[{"start":{"line":337,"column":2},"end":{"line":337,"column":49}},{"start":{"line":337,"column":2},"end":{"line":337,"column":49}}]},"30":{"loc":{"start":{"line":346,"column":4},"end":{"line":352,"column":75}},"type":"if","locations":[{"start":{"line":346,"column":4},"end":{"line":352,"column":75}},{"start":{"line":346,"column":4},"end":{"line":352,"column":75}}]},"31":{"loc":{"start":{"line":346,"column":93},"end":{"line":352,"column":75}},"type":"if","locations":[{"start":{"line":346,"column":93},"end":{"line":352,"column":75}},{"start":{"line":346,"column":93},"end":{"line":352,"column":75}}]}},"s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":10,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":246,"31":492,"32":983,"33":246,"34":123,"35":123,"36":123,"37":123,"38":0,"39":123,"40":123,"41":0,"42":0,"43":0,"44":123,"45":123,"46":123,"47":0,"48":123,"49":0,"50":123,"51":0,"52":123,"53":123,"54":123,"55":123,"56":123,"57":123,"58":123,"59":123,"60":123,"61":123,"62":123,"63":123,"64":123,"65":123,"66":0,"67":0,"68":0,"69":123,"70":123,"71":123,"72":123,"73":123,"74":123,"75":123,"76":123,"77":41,"78":41,"79":40,"80":40,"81":1,"82":1,"83":1,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":1,"97":1,"98":1,"99":40,"100":0,"101":0,"102":40,"103":40,"104":40,"105":0,"106":40,"107":40,"108":40,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":40,"122":40,"123":40,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":41,"134":41,"135":41,"136":41,"137":41,"138":41,"139":41,"140":123,"141":123,"142":246,"143":246,"144":1,"145":123,"146":123,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0},"f":{"1":10,"2":1,"3":246,"4":492,"5":246,"6":123,"7":0},"b":{"1":[2,8],"2":[10,10],"3":[246,123,123,41,0,0,0,1,1,40,0,0,0,40,40,0,0,0,41,41,41,123,123,246],"4":[123,123],"5":[0,123],"6":[0,123],"7":[0,123],"8":[123,123],"9":[0,123],"10":[123,0],"11":[0,123],"12":[123,0,0,0,0],"13":[123,0],"14":[0,123],"15":[123,0],"16":[123,123],"17":[41,82],"18":[41,41],"19":[40,1],"20":[1,0],"21":[0,40],"22":[40,0],"23":[40,0],"24":[0,40],"25":[40,0],"26":[0,0],"27":[0,0],"28":[0,0,0,0],"29":[123,0],"30":[0,0],"31":[0,0]},"hash":"fdc026f539f52866657aba002e2951f55d0339e7"}}
{"/Users/nexus/Public/koa-better-error-handler/lib/index.js":{"path":"/Users/nexus/Public/koa-better-error-handler/lib/index.js","statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}},"2":{"start":{"line":7,"column":19},"end":{"line":7,"column":55}},"3":{"start":{"line":9,"column":20},"end":{"line":9,"column":56}},"4":{"start":{"line":11,"column":17},"end":{"line":11,"column":64}},"5":{"start":{"line":13,"column":18},"end":{"line":13,"column":52}},"6":{"start":{"line":15,"column":25},"end":{"line":15,"column":74}},"7":{"start":{"line":17,"column":25},"end":{"line":17,"column":67}},"8":{"start":{"line":19,"column":10},"end":{"line":19,"column":23}},"9":{"start":{"line":21,"column":11},"end":{"line":21,"column":38}},"10":{"start":{"line":23,"column":13},"end":{"line":23,"column":29}},"11":{"start":{"line":25,"column":14},"end":{"line":25,"column":44}},"12":{"start":{"line":27,"column":14},"end":{"line":27,"column":31}},"13":{"start":{"line":29,"column":15},"end":{"line":29,"column":46}},"14":{"start":{"line":31,"column":12},"end":{"line":31,"column":27}},"15":{"start":{"line":33,"column":13},"end":{"line":33,"column":42}},"16":{"start":{"line":35,"column":10},"end":{"line":35,"column":23}},"17":{"start":{"line":37,"column":11},"end":{"line":37,"column":38}},"18":{"start":{"line":39,"column":12},"end":{"line":39,"column":27}},"19":{"start":{"line":41,"column":13},"end":{"line":41,"column":42}},"20":{"start":{"line":44,"column":2},"end":{"line":44,"column":56}},"21":{"start":{"line":47,"column":11},"end":{"line":49,"column":1}},"22":{"start":{"line":53,"column":11},"end":{"line":53,"column":92}},"23":{"start":{"line":54,"column":11},"end":{"line":54,"column":92}},"24":{"start":{"line":56,"column":12},"end":{"line":56,"column":59}},"25":{"start":{"line":66,"column":0},"end":{"line":320,"column":4}},"26":{"start":{"line":67,"column":13},"end":{"line":313,"column":5}},"27":{"start":{"line":69,"column":4},"end":{"line":312,"column":44}},"28":{"start":{"line":70,"column":6},"end":{"line":311,"column":7}},"29":{"start":{"line":71,"column":8},"end":{"line":310,"column":9}},"30":{"start":{"line":73,"column":12},"end":{"line":76,"column":13}},"31":{"start":{"line":74,"column":14},"end":{"line":74,"column":32}},"32":{"start":{"line":75,"column":14},"end":{"line":75,"column":20}},"33":{"start":{"line":78,"column":12},"end":{"line":78,"column":45}},"34":{"start":{"line":82,"column":12},"end":{"line":82,"column":69}},"35":{"start":{"line":82,"column":48},"end":{"line":82,"column":69}},"36":{"start":{"line":84,"column":12},"end":{"line":84,"column":58}},"37":{"start":{"line":86,"column":12},"end":{"line":90,"column":13}},"38":{"start":{"line":87,"column":14},"end":{"line":87,"column":55}},"39":{"start":{"line":88,"column":14},"end":{"line":88,"column":31}},"40":{"start":{"line":89,"column":14},"end":{"line":89,"column":74}},"41":{"start":{"line":93,"column":12},"end":{"line":93,"column":50}},"42":{"start":{"line":96,"column":12},"end":{"line":96,"column":44}},"43":{"start":{"line":98,"column":12},"end":{"line":98,"column":95}},"44":{"start":{"line":98,"column":62},"end":{"line":98,"column":95}},"45":{"start":{"line":102,"column":12},"end":{"line":102,"column":142}},"46":{"start":{"line":102,"column":107},"end":{"line":102,"column":142}},"47":{"start":{"line":104,"column":12},"end":{"line":104,"column":73}},"48":{"start":{"line":104,"column":56},"end":{"line":104,"column":73}},"49":{"start":{"line":107,"column":12},"end":{"line":107,"column":63}},"50":{"start":{"line":109,"column":12},"end":{"line":109,"column":40}},"51":{"start":{"line":112,"column":12},"end":{"line":112,"column":256}},"52":{"start":{"line":114,"column":12},"end":{"line":114,"column":46}},"53":{"start":{"line":117,"column":12},"end":{"line":117,"column":65}},"54":{"start":{"line":119,"column":12},"end":{"line":119,"column":42}},"55":{"start":{"line":122,"column":12},"end":{"line":122,"column":53}},"56":{"start":{"line":127,"column":12},"end":{"line":127,"column":92}},"57":{"start":{"line":128,"column":12},"end":{"line":128,"column":86}},"58":{"start":{"line":130,"column":12},"end":{"line":130,"column":53}},"59":{"start":{"line":132,"column":12},"end":{"line":132,"column":46}},"60":{"start":{"line":138,"column":12},"end":{"line":141,"column":13}},"61":{"start":{"line":139,"column":14},"end":{"line":139,"column":33}},"62":{"start":{"line":140,"column":14},"end":{"line":140,"column":20}},"63":{"start":{"line":143,"column":12},"end":{"line":143,"column":64}},"64":{"start":{"line":144,"column":12},"end":{"line":144,"column":34}},"65":{"start":{"line":145,"column":12},"end":{"line":145,"column":45}},"66":{"start":{"line":150,"column":12},"end":{"line":150,"column":47}},"67":{"start":{"line":151,"column":12},"end":{"line":151,"column":68}},"68":{"start":{"line":152,"column":12},"end":{"line":152,"column":42}},"69":{"start":{"line":153,"column":12},"end":{"line":153,"column":66}},"70":{"start":{"line":155,"column":12},"end":{"line":155,"column":39}},"71":{"start":{"line":157,"column":12},"end":{"line":157,"column":31}},"72":{"start":{"line":158,"column":12},"end":{"line":158,"column":91}},"73":{"start":{"line":159,"column":12},"end":{"line":159,"column":18}},"74":{"start":{"line":163,"column":12},"end":{"line":163,"column":31}},"75":{"start":{"line":165,"column":12},"end":{"line":168,"column":13}},"76":{"start":{"line":166,"column":14},"end":{"line":166,"column":33}},"77":{"start":{"line":167,"column":14},"end":{"line":167,"column":20}},"78":{"start":{"line":170,"column":12},"end":{"line":173,"column":13}},"79":{"start":{"line":171,"column":14},"end":{"line":171,"column":33}},"80":{"start":{"line":172,"column":14},"end":{"line":172,"column":20}},"81":{"start":{"line":175,"column":12},"end":{"line":175,"column":31}},"82":{"start":{"line":177,"column":12},"end":{"line":177,"column":40}},"83":{"start":{"line":178,"column":12},"end":{"line":178,"column":31}},"84":{"start":{"line":179,"column":12},"end":{"line":179,"column":38}},"85":{"start":{"line":182,"column":12},"end":{"line":182,"column":31}},"86":{"start":{"line":183,"column":12},"end":{"line":183,"column":18}},"87":{"start":{"line":186,"column":12},"end":{"line":186,"column":31}},"88":{"start":{"line":187,"column":12},"end":{"line":187,"column":48}},"89":{"start":{"line":189,"column":12},"end":{"line":189,"column":70}},"90":{"start":{"line":190,"column":12},"end":{"line":190,"column":29}},"91":{"start":{"line":193,"column":12},"end":{"line":193,"column":31}},"92":{"start":{"line":194,"column":12},"end":{"line":194,"column":18}},"93":{"start":{"line":197,"column":12},"end":{"line":197,"column":29}},"94":{"start":{"line":200,"column":12},"end":{"line":200,"column":31}},"95":{"start":{"line":201,"column":12},"end":{"line":201,"column":18}},"96":{"start":{"line":204,"column":12},"end":{"line":207,"column":13}},"97":{"start":{"line":205,"column":14},"end":{"line":205,"column":33}},"98":{"start":{"line":206,"column":14},"end":{"line":206,"column":20}},"99":{"start":{"line":212,"column":12},"end":{"line":212,"column":70}},"100":{"start":{"line":212,"column":28},"end":{"line":212,"column":70}},"101":{"start":{"line":215,"column":12},"end":{"line":215,"column":59}},"102":{"start":{"line":215,"column":26},"end":{"line":215,"column":59}},"103":{"start":{"line":219,"column":12},"end":{"line":222,"column":13}},"104":{"start":{"line":220,"column":14},"end":{"line":220,"column":33}},"105":{"start":{"line":221,"column":14},"end":{"line":221,"column":20}},"106":{"start":{"line":224,"column":12},"end":{"line":224,"column":31}},"107":{"start":{"line":226,"column":12},"end":{"line":226,"column":40}},"108":{"start":{"line":227,"column":12},"end":{"line":227,"column":31}},"109":{"start":{"line":228,"column":12},"end":{"line":228,"column":38}},"110":{"start":{"line":231,"column":12},"end":{"line":231,"column":31}},"111":{"start":{"line":232,"column":12},"end":{"line":232,"column":18}},"112":{"start":{"line":235,"column":12},"end":{"line":235,"column":31}},"113":{"start":{"line":236,"column":12},"end":{"line":236,"column":48}},"114":{"start":{"line":238,"column":12},"end":{"line":238,"column":70}},"115":{"start":{"line":239,"column":12},"end":{"line":239,"column":29}},"116":{"start":{"line":242,"column":12},"end":{"line":242,"column":31}},"117":{"start":{"line":243,"column":12},"end":{"line":243,"column":18}},"118":{"start":{"line":246,"column":12},"end":{"line":246,"column":29}},"119":{"start":{"line":249,"column":12},"end":{"line":249,"column":31}},"120":{"start":{"line":250,"column":12},"end":{"line":250,"column":18}},"121":{"start":{"line":255,"column":12},"end":{"line":255,"column":59}},"122":{"start":{"line":255,"column":26},"end":{"line":255,"column":59}},"123":{"start":{"line":260,"column":12},"end":{"line":263,"column":13}},"124":{"start":{"line":261,"column":14},"end":{"line":261,"column":33}},"125":{"start":{"line":262,"column":14},"end":{"line":262,"column":20}},"126":{"start":{"line":265,"column":12},"end":{"line":265,"column":31}},"127":{"start":{"line":266,"column":12},"end":{"line":266,"column":114}},"128":{"start":{"line":269,"column":12},"end":{"line":269,"column":89}},"129":{"start":{"line":287,"column":12},"end":{"line":287,"column":34}},"130":{"start":{"line":290,"column":12},"end":{"line":290,"column":48}},"131":{"start":{"line":293,"column":12},"end":{"line":293,"column":31}},"132":{"start":{"line":294,"column":12},"end":{"line":294,"column":69}},"133":{"start":{"line":295,"column":12},"end":{"line":295,"column":48}},"134":{"start":{"line":298,"column":12},"end":{"line":298,"column":31}},"135":{"start":{"line":299,"column":12},"end":{"line":299,"column":69}},"136":{"start":{"line":300,"column":12},"end":{"line":300,"column":48}},"137":{"start":{"line":304,"column":12},"end":{"line":304,"column":55}},"138":{"start":{"line":305,"column":12},"end":{"line":305,"column":36}},"139":{"start":{"line":309,"column":12},"end":{"line":309,"column":35}},"140":{"start":{"line":316,"column":4},"end":{"line":316,"column":39}},"141":{"start":{"line":319,"column":2},"end":{"line":319,"column":22}},"142":{"start":{"line":325,"column":2},"end":{"line":325,"column":49}},"143":{"start":{"line":325,"column":38},"end":{"line":325,"column":49}},"144":{"start":{"line":327,"column":2},"end":{"line":327,"column":17}},"145":{"start":{"line":331,"column":2},"end":{"line":336,"column":3}},"146":{"start":{"line":332,"column":4},"end":{"line":332,"column":65}},"147":{"start":{"line":334,"column":17},"end":{"line":334,"column":85}},"148":{"start":{"line":335,"column":4},"end":{"line":335,"column":127}},"149":{"start":{"line":338,"column":2},"end":{"line":338,"column":13}}},"fnMap":{"1":{"name":"_interopRequireDefault","decl":{"start":{"line":43,"column":9},"end":{"line":43,"column":31}},"loc":{"start":{"line":43,"column":37},"end":{"line":45,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":66,"column":18},"end":{"line":66,"column":19}},"loc":{"start":{"line":66,"column":30},"end":{"line":320,"column":1}}},"3":{"name":"_callee","decl":{"start":{"line":67,"column":81},"end":{"line":67,"column":88}},"loc":{"start":{"line":67,"column":94},"end":{"line":313,"column":3}}},"4":{"name":"_callee$","decl":{"start":{"line":69,"column":47},"end":{"line":69,"column":55}},"loc":{"start":{"line":69,"column":66},"end":{"line":312,"column":5}}},"5":{"name":"errorHandler","decl":{"start":{"line":315,"column":11},"end":{"line":315,"column":23}},"loc":{"start":{"line":315,"column":28},"end":{"line":317,"column":3}}},"6":{"name":"parseValidationError","decl":{"start":{"line":322,"column":9},"end":{"line":322,"column":29}},"loc":{"start":{"line":322,"column":40},"end":{"line":339,"column":1}}}},"branchMap":{"1":{"loc":{"start":{"line":44,"column":9},"end":{"line":44,"column":55}},"type":"cond-expr","locations":[{"start":{"line":44,"column":33},"end":{"line":44,"column":36}},{"start":{"line":44,"column":39},"end":{"line":44,"column":55}}]},"2":{"loc":{"start":{"line":44,"column":9},"end":{"line":44,"column":30}},"type":"binary-expr","locations":[{"start":{"line":44,"column":9},"end":{"line":44,"column":12}},{"start":{"line":44,"column":16},"end":{"line":44,"column":30}}]},"3":{"loc":{"start":{"line":71,"column":8},"end":{"line":310,"column":9}},"type":"switch","locations":[{"start":{"line":72,"column":10},"end":{"line":78,"column":45}},{"start":{"line":80,"column":10},"end":{"line":145,"column":45}},{"start":{"line":147,"column":10},"end":{"line":159,"column":18}},{"start":{"line":161,"column":10},"end":{"line":179,"column":38}},{"start":{"line":181,"column":10},"end":{"line":183,"column":18}},{"start":{"line":185,"column":10},"end":{"line":190,"column":29}},{"start":{"line":192,"column":10},"end":{"line":194,"column":18}},{"start":{"line":196,"column":10},"end":{"line":197,"column":29}},{"start":{"line":199,"column":10},"end":{"line":201,"column":18}},{"start":{"line":203,"column":10},"end":{"line":228,"column":38}},{"start":{"line":230,"column":10},"end":{"line":232,"column":18}},{"start":{"line":234,"column":10},"end":{"line":239,"column":29}},{"start":{"line":241,"column":10},"end":{"line":243,"column":18}},{"start":{"line":245,"column":10},"end":{"line":246,"column":29}},{"start":{"line":248,"column":10},"end":{"line":250,"column":18}},{"start":{"line":252,"column":10},"end":{"line":266,"column":114}},{"start":{"line":268,"column":10},"end":{"line":269,"column":89}},{"start":{"line":271,"column":10},"end":{"line":287,"column":34}},{"start":{"line":289,"column":10},"end":{"line":290,"column":48}},{"start":{"line":292,"column":10},"end":{"line":295,"column":48}},{"start":{"line":297,"column":10},"end":{"line":300,"column":48}},{"start":{"line":302,"column":10},"end":{"line":305,"column":36}},{"start":{"line":307,"column":10},"end":{"line":307,"column":18}},{"start":{"line":308,"column":10},"end":{"line":309,"column":35}}]},"4":{"loc":{"start":{"line":73,"column":12},"end":{"line":76,"column":13}},"type":"if","locations":[{"start":{"line":73,"column":12},"end":{"line":76,"column":13}},{"start":{"line":73,"column":12},"end":{"line":76,"column":13}}]},"5":{"loc":{"start":{"line":82,"column":12},"end":{"line":82,"column":69}},"type":"if","locations":[{"start":{"line":82,"column":12},"end":{"line":82,"column":69}},{"start":{"line":82,"column":12},"end":{"line":82,"column":69}}]},"6":{"loc":{"start":{"line":86,"column":12},"end":{"line":90,"column":13}},"type":"if","locations":[{"start":{"line":86,"column":12},"end":{"line":90,"column":13}},{"start":{"line":86,"column":12},"end":{"line":90,"column":13}}]},"7":{"loc":{"start":{"line":98,"column":12},"end":{"line":98,"column":95}},"type":"if","locations":[{"start":{"line":98,"column":12},"end":{"line":98,"column":95}},{"start":{"line":98,"column":12},"end":{"line":98,"column":95}}]},"8":{"loc":{"start":{"line":98,"column":16},"end":{"line":98,"column":60}},"type":"binary-expr","locations":[{"start":{"line":98,"column":16},"end":{"line":98,"column":46}},{"start":{"line":98,"column":50},"end":{"line":98,"column":60}}]},"9":{"loc":{"start":{"line":102,"column":12},"end":{"line":102,"column":142}},"type":"if","locations":[{"start":{"line":102,"column":12},"end":{"line":102,"column":142}},{"start":{"line":102,"column":12},"end":{"line":102,"column":142}}]},"10":{"loc":{"start":{"line":102,"column":16},"end":{"line":102,"column":105}},"type":"binary-expr","locations":[{"start":{"line":102,"column":16},"end":{"line":102,"column":53}},{"start":{"line":102,"column":57},"end":{"line":102,"column":105}}]},"11":{"loc":{"start":{"line":104,"column":12},"end":{"line":104,"column":73}},"type":"if","locations":[{"start":{"line":104,"column":12},"end":{"line":104,"column":73}},{"start":{"line":104,"column":12},"end":{"line":104,"column":73}}]},"12":{"loc":{"start":{"line":112,"column":26},"end":{"line":112,"column":255}},"type":"binary-expr","locations":[{"start":{"line":112,"column":26},"end":{"line":112,"column":65}},{"start":{"line":112,"column":69},"end":{"line":112,"column":113}},{"start":{"line":112,"column":117},"end":{"line":112,"column":158}},{"start":{"line":112,"column":162},"end":{"line":112,"column":201}},{"start":{"line":112,"column":205},"end":{"line":112,"column":255}}]},"13":{"loc":{"start":{"line":127,"column":74},"end":{"line":127,"column":91}},"type":"binary-expr","locations":[{"start":{"line":127,"column":74},"end":{"line":127,"column":84}},{"start":{"line":127,"column":88},"end":{"line":127,"column":91}}]},"14":{"loc":{"start":{"line":138,"column":12},"end":{"line":141,"column":13}},"type":"if","locations":[{"start":{"line":138,"column":12},"end":{"line":141,"column":13}},{"start":{"line":138,"column":12},"end":{"line":141,"column":13}}]},"15":{"loc":{"start":{"line":138,"column":18},"end":{"line":138,"column":51}},"type":"binary-expr","locations":[{"start":{"line":138,"column":18},"end":{"line":138,"column":33}},{"start":{"line":138,"column":37},"end":{"line":138,"column":51}}]},"16":{"loc":{"start":{"line":158,"column":28},"end":{"line":158,"column":90}},"type":"cond-expr","locations":[{"start":{"line":158,"column":53},"end":{"line":158,"column":55}},{"start":{"line":158,"column":58},"end":{"line":158,"column":90}}]},"17":{"loc":{"start":{"line":158,"column":58},"end":{"line":158,"column":90}},"type":"cond-expr","locations":[{"start":{"line":158,"column":83},"end":{"line":158,"column":85}},{"start":{"line":158,"column":88},"end":{"line":158,"column":90}}]},"18":{"loc":{"start":{"line":165,"column":12},"end":{"line":168,"column":13}},"type":"if","locations":[{"start":{"line":165,"column":12},"end":{"line":168,"column":13}},{"start":{"line":165,"column":12},"end":{"line":168,"column":13}}]},"19":{"loc":{"start":{"line":170,"column":12},"end":{"line":173,"column":13}},"type":"if","locations":[{"start":{"line":170,"column":12},"end":{"line":173,"column":13}},{"start":{"line":170,"column":12},"end":{"line":173,"column":13}}]},"20":{"loc":{"start":{"line":204,"column":12},"end":{"line":207,"column":13}},"type":"if","locations":[{"start":{"line":204,"column":12},"end":{"line":207,"column":13}},{"start":{"line":204,"column":12},"end":{"line":207,"column":13}}]},"21":{"loc":{"start":{"line":204,"column":18},"end":{"line":204,"column":51}},"type":"binary-expr","locations":[{"start":{"line":204,"column":18},"end":{"line":204,"column":28}},{"start":{"line":204,"column":32},"end":{"line":204,"column":51}}]},"22":{"loc":{"start":{"line":212,"column":12},"end":{"line":212,"column":70}},"type":"if","locations":[{"start":{"line":212,"column":12},"end":{"line":212,"column":70}},{"start":{"line":212,"column":12},"end":{"line":212,"column":70}}]},"23":{"loc":{"start":{"line":215,"column":12},"end":{"line":215,"column":59}},"type":"if","locations":[{"start":{"line":215,"column":12},"end":{"line":215,"column":59}},{"start":{"line":215,"column":12},"end":{"line":215,"column":59}}]},"24":{"loc":{"start":{"line":219,"column":12},"end":{"line":222,"column":13}},"type":"if","locations":[{"start":{"line":219,"column":12},"end":{"line":222,"column":13}},{"start":{"line":219,"column":12},"end":{"line":222,"column":13}}]},"25":{"loc":{"start":{"line":255,"column":12},"end":{"line":255,"column":59}},"type":"if","locations":[{"start":{"line":255,"column":12},"end":{"line":255,"column":59}},{"start":{"line":255,"column":12},"end":{"line":255,"column":59}}]},"26":{"loc":{"start":{"line":260,"column":12},"end":{"line":263,"column":13}},"type":"if","locations":[{"start":{"line":260,"column":12},"end":{"line":263,"column":13}},{"start":{"line":260,"column":12},"end":{"line":263,"column":13}}]},"27":{"loc":{"start":{"line":260,"column":18},"end":{"line":260,"column":94}},"type":"binary-expr","locations":[{"start":{"line":260,"column":18},"end":{"line":260,"column":35}},{"start":{"line":260,"column":39},"end":{"line":260,"column":53}},{"start":{"line":260,"column":57},"end":{"line":260,"column":69}},{"start":{"line":260,"column":73},"end":{"line":260,"column":94}}]},"28":{"loc":{"start":{"line":325,"column":2},"end":{"line":325,"column":49}},"type":"if","locations":[{"start":{"line":325,"column":2},"end":{"line":325,"column":49}},{"start":{"line":325,"column":2},"end":{"line":325,"column":49}}]},"29":{"loc":{"start":{"line":331,"column":2},"end":{"line":336,"column":3}},"type":"if","locations":[{"start":{"line":331,"column":2},"end":{"line":336,"column":3}},{"start":{"line":331,"column":2},"end":{"line":336,"column":3}}]},"30":{"loc":{"start":{"line":335,"column":18},"end":{"line":335,"column":126}},"type":"cond-expr","locations":[{"start":{"line":335,"column":28},"end":{"line":335,"column":45}},{"start":{"line":335,"column":48},"end":{"line":335,"column":126}}]}},"s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":9,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":246,"28":492,"29":983,"30":246,"31":123,"32":123,"33":123,"34":123,"35":0,"36":123,"37":123,"38":0,"39":0,"40":0,"41":123,"42":123,"43":123,"44":0,"45":123,"46":0,"47":123,"48":0,"49":123,"50":123,"51":123,"52":123,"53":123,"54":123,"55":123,"56":123,"57":123,"58":123,"59":123,"60":123,"61":123,"62":123,"63":0,"64":0,"65":0,"66":123,"67":123,"68":123,"69":123,"70":123,"71":123,"72":123,"73":123,"74":41,"75":41,"76":40,"77":40,"78":1,"79":1,"80":1,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":1,"94":1,"95":1,"96":40,"97":0,"98":0,"99":40,"100":40,"101":40,"102":0,"103":40,"104":40,"105":40,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":40,"119":40,"120":40,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":41,"131":41,"132":41,"133":41,"134":41,"135":41,"136":41,"137":123,"138":123,"139":246,"140":246,"141":1,"142":123,"143":123,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0},"f":{"1":9,"2":1,"3":246,"4":492,"5":246,"6":123},"b":{"1":[2,7],"2":[9,9],"3":[246,123,123,41,0,0,0,1,1,40,0,0,0,40,40,0,0,0,41,41,41,123,123,246],"4":[123,123],"5":[0,123],"6":[0,123],"7":[0,123],"8":[123,123],"9":[0,123],"10":[123,0],"11":[0,123],"12":[123,0,0,0,0],"13":[123,0],"14":[123,0],"15":[123,123],"16":[41,82],"17":[41,41],"18":[40,1],"19":[1,0],"20":[0,40],"21":[40,0],"22":[40,0],"23":[0,40],"24":[40,0],"25":[0,0],"26":[0,0],"27":[0,0,0,0],"28":[123,0],"29":[0,0],"30":[0,0]},"hash":"bcc194969c20659473ed48f829956f513c983176"}}

@@ -23,6 +23,2 @@ 'use strict';

var _util = require('util');
var _util2 = _interopRequireDefault(_util);
var _debug = require('debug');

@@ -54,10 +50,2 @@

var messages = {
'required': '%s is required',
'min': '%s below minimum',
'max': '%s above maximum',
'enum': '%s not an allowed value',
'Duplicate value': '%s already exists'
};
// error pages were inspired by HTML5 Boilerplate's default 404.html page

@@ -106,3 +94,3 @@ // https://github.com/h5bp/html5-boilerplate/blob/master/src/404.html

// parse mongoose validation errors
err = parseValidationError(err);
err = parseValidationError(this, err);

@@ -142,3 +130,3 @@ // check if we threw just a status code in order to keep it simple

this.status = this.statusCode = err.statusCode = err.status = err.status || 500;
this.body = err.isBoom ? err.output.payload : _boom2.default.create(err.status, err.message).output.payload;
this.body = _boom2.default.create(err.status, err.message).output.payload;

@@ -309,3 +297,3 @@ debug('status code was %d', this.status);

this.type = 'json';
this.body = (0, _stringify2.default)(this.body);
this.body = (0, _stringify2.default)(this.body, null, 2);
return _context.abrupt('break', 83);

@@ -338,3 +326,3 @@

function parseValidationError(err) {
function parseValidationError(ctx, err) {

@@ -344,21 +332,15 @@ // inspired by https://github.com/syntagma/mongoose-error-helper

// a ValidationError can contain more than one error
var errors = [];
ctx.api = true;
// loop over the errors object of the Validation Error
_lodash2.default.each(err.errors, function (field) {
// with support for HTML error lists
if (_lodash2.default.values(err.errors).length === 1) {
err.message = _lodash2.default.values(err.errors)[0].message;
} else {
var errors = _lodash2.default.map(_lodash2.default.values(err.errors), 'message');
err.message = ctx.api ? errors.join(', ') : '<ul class="text-xs-left mb-0"><li>' + errors.join('</li><li>') + '</li></ul>';
}
// if a custom message is defined on the schema
if (_lodash2.default.isString(field.properties.message)) errors.push(field.message);else if (!_lodash2.default.isString(messages[field.kind]))
// and if we don't have a message for `kind`
// then just push the error through
errors.push(field.message);else
// otherwise use util.format to format message
// and pass the path for interpolation
errors.push(_util2.default.format(messages[field.kind], field.path));
});
err.message = errors.join(', ');
return err;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7O0FBRUEsSUFBTSxPQUFPO0FBQ1gsWUFBVTtBQURDLENBQWI7O0FBSUEsSUFBTSxXQUFXO0FBQ2YsY0FBWSxnQkFERztBQUVmLFNBQU8sa0JBRlE7QUFHZixTQUFPLGtCQUhRO0FBSWYsVUFBUSx5QkFKTztBQUtm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HRoaXMuc3RhdGUuY29va2llc0tleSkge1xuICAgICAgICAgIGF3YWl0IGNvLndyYXAodGhpcy5zZXNzaW9uU3RvcmUuc2V0KS5jYWxsKFxuICAgICAgICAgICAgdGhpcy5zZXNzaW9uU3RvcmUsXG4gICAgICAgICAgICB0aGlzLnNlc3Npb25JZCxcbiAgICAgICAgICAgIHRoaXMuc2Vzc2lvblxuICAgICAgICAgICk7XG4gICAgICAgICAgdGhpcy5jb29raWVzLnNldChcbiAgICAgICAgICAgIHRoaXMuc3RhdGUuY29va2llc0tleSxcbiAgICAgICAgICAgIHRoaXMuc2Vzc2lvbklkLFxuICAgICAgICAgICAgdGhpcy5zZXNzaW9uLmNvb2tpZVxuICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICAvKlxuICAgICAgICAvLyBpZiB3ZSdyZSB1c2luZyBga29hLXNlc3Npb24tc3RvcmVgIHdlIG5lZWQgdG8gYWRkXG4gICAgICAgIC8vIGB0aGlzLl9zZXNzaW9uID0gbmV3IFNlc3Npb24oKWAsIGFuZCB0aGVuIHJ1biB0aGlzOlxuICAgICAgICBhd2FpdCBjby53cmFwKHRoaXMuX3Nlc3Npb24uX3N0b3JlLnNhdmUpLmNhbGwoXG4gICAgICAgICAgdGhpcy5fc2Vzc2lvbi5fc3RvcmUsXG4gICAgICAgICAgdGhpcy5fc2Vzc2lvbi5fc2lkLFxuICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHRoaXMuc2Vzc2lvbilcbiAgICAgICAgKTtcbiAgICAgICAgdGhpcy5jb29raWVzLnNldCh0aGlzLl9zZXNzaW9uLl9uYW1lLCBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgX3NpZDogdGhpcy5fc2Vzc2lvbi5fc2lkXG4gICAgICAgIH0pLCB0aGlzLl9zZXNzaW9uLl9jb29raWVPcHRzKTtcbiAgICAgICAgKi9cblxuICAgICAgICAvLyByZWRpcmVjdCB0aGUgdXNlciB0byB0aGUgcGFnZSB0aGV5I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9keSwgbnVsbCwgMik7XG4gICAgICBicmVhaztcbiAgfVxuXG4gIHRoaXMubGVuZ3RoID0gQnVmZmVyLmJ5dGVMZW5ndGgodGhpcy5ib2R5KTtcbiAgdGhpcy5yZXMuZW5kKHRoaXMuYm9keSk7XG5cbn07XG5cbmZ1bmN0aW9uIHBhcnNlVmFsaWRhdGlvbkVycm9yKGN0eCwgZXJyKSB7XG5cbiAgLy8gaW5zcGlyZWQgYnkgaHR0cHM6Ly9naXRodWIuY29tL3N5bnRhZ21hL21vbmdvb3NlLWVycm9yLWhlbHBlclxuICBpZiAoZXJyLm5hbWUgIT09ICdWYWxpZGF0aW9uRXJyb3InKVxuICAgIHJldHVybiBlcnI7XG5cbiAgY3R4LmFwaSA9IHRydWU7XG5cbiAgLy8gbG9vcCBvdmVyIHRoZSBlcnJvcnMgb2JqZWN0IG9mIHRoZSBWYWxpZGF0aW9uIEVycm9yXG4gIC8vIHdpdGggc3VwcG9ydCBmb3IgSFRNTCBlcnJvciBsaXN0c1xuICBpZiAoXy52YWx1ZXMoZXJyLmVycm9ycykubGVuZ3RoID09PSAxKSB7XG4gICAgZXJyLm1lc3NhZ2UgPSBfLnZhbHVlcyhlcnIuZXJyb3JzKVswXS5tZXNzYWdlO1xuICB9IGVsc2Uge1xuICAgIGNvbnN0IGVycm9ycyA9IF8ubWFwKF8udmFsdWVzKGVyci5lcnJvcnMpLCAnbWVzc2FnZScpO1xuICAgIGVyci5tZXNzYWdlID0gY3R4LmFwaSA/XG4gICAgICBlcnJvcnMuam9pbignLCAnKVxuICAgICAgOiBgPHVsIGNsYXNzPVwidGV4dC14cy1sZWZ0IG1iLTBcIj48bGk+JHtlcnJvcnMuam9pbignPC9saT48bGk+Jyl9PC9saT48L3VsPmA7XG4gIH1cblxuICByZXR1cm4gZXJyO1xuXG59XG4iXX0=
{
"name": "koa-better-error-handler",
"description": "A better error-handler for Koa v2+, built for CrocodileJS. Makes `ctx.throw` beautiful again :sparkles!",
"version": "1.0.7",
"version": "1.0.8",
"author": "Nick Baugh <niftylettuce@gmail.com>",
"bugs": "https://github.com/niftylettuce/koa-better-error-handler/issues",
"dependencies": {
"boom": "^3.2.2",
"boom": "^4.2.0",
"co": "^4.6.0",
"debug": "^2.2.0",
"lodash": "^4.13.1"
"lodash": "^4.16.4"
},
"devDependencies": {
"babel-cli": "^6.11.4",
"babel-plugin-transform-runtime": "^6.12.0",
"babel-cli": "^6.18.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-crocodile": "^1.0.0",

@@ -26,7 +26,7 @@ "chai": "^3.5.0",

"koa-generic-session": "^1.11.3",
"koa-redis": "^2.1.1",
"koa-redis": "^2.1.2",
"koa-router": "^7.0.1",
"mocha": "^2.5.3",
"mocha": "^3.1.2",
"redis": "^2.6.2",
"supertest": "^1.2.0"
"supertest": "^2.0.1"
},

@@ -61,2 +61,3 @@ "engines": {

"compile": "rm -rf lib/ && babel -d lib src",
"watch": "babel -d lib src -w",
"coverage": "rm -rf coverage/ && npm run analyze-coverage && npm run check-coverage && node_modules/.bin/codecov",

@@ -63,0 +64,0 @@ "lint": "eslint .",

@@ -22,2 +22,3 @@

* [User-Friendly Responses](#user-friendly-responses)
* [HTML Error Lists](#html-error-lists)
* [License](#license)

@@ -33,4 +34,6 @@

* Fixes annoying redirect issue where flash messages were lost upon an error being thrown
* Supports [HTML Error Lists](#html-error-lists) using `<ul>` for Mongoose validation errors with more than one message
* Makes `ctx.throw` beautiful messages (e.g. `ctx.throw(404)` will output a beautiful error object :hibiscus:)
* Supports `text/html`, `application/json`, and `text` response types
* Supports and recommends use of [mongoose-beautiful-unique-validation][mongoose-beautiful-unique-validation]

@@ -62,2 +65,5 @@

// specify that this is our api
app.context.api = true;
// set up some routes

@@ -178,2 +184,29 @@ const router = new Router();

## HTML Error Lists
If you specify `app.context.api = true` or set `ctx.api = true`, and if a Mongoose validation error message occurs that has more than one message (e.g. multiple fields were invalid) &ndash; then `err.message` will be joined by a comma instead of by `<li>`.
Therefore if you _DO_ want your API error messages to return HTML formatted error lists for Mongoose validation, then set `app.context.api = true` before using this error handler.
> With error lists:
```json
{
"statusCode": 400,
"error": "Bad Request",
"message": "<ul class=\"text-xs-left mb-0\"><li>Path `company_logo` is required.</li><li>Gig description must be 100-300 characters.</li></ul>"
}
```
> Without error lists:
```json
{
"statusCode":400,
"error":"Bad Request",
"message":"Path `company_logo` is required., Gig description must be 100-300 characters."
}
```
## License

@@ -200,1 +233,2 @@

[gh-500-issue]: https://github.com/koajs/koa/blob/e4bcdecef295d7adbf5cce1bdc09adc0a24117b7/lib/context.js#L94-L140
[mongoose-beautiful-unique-validation]: https://github.com/BohdanTkachenko/mongoose-beautiful-unique-validation

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc