diff options
Diffstat (limited to 'node_modules/istanbul-lib-instrument')
20 files changed, 2907 insertions, 0 deletions
diff --git a/node_modules/istanbul-lib-instrument/.nyc_output/7b502358b3b753fdfd3ea908241822c5.json b/node_modules/istanbul-lib-instrument/.nyc_output/7b502358b3b753fdfd3ea908241822c5.json new file mode 100644 index 000000000..e02309737 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/.nyc_output/7b502358b3b753fdfd3ea908241822c5.json @@ -0,0 +1 @@ +{"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/index.js":{"path":"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/index.js","statementMap":{"0":{"start":{"line":12,"column":4},"end":{"line":12,"column":34}}},"fnMap":{"0":{"name":"createInstrumenter","decl":{"start":{"line":11,"column":9},"end":{"line":11,"column":27}},"loc":{"start":{"line":11,"column":34},"end":{"line":13,"column":1}}}},"branchMap":{},"s":{"0":1},"f":{"0":1},"b":{},"hash":"798db42fb9d107fddc4118cc15815d3e06eeac70"},"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/instrumenter.js":{"path":"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/instrumenter.js","statementMap":{"0":{"start":{"line":12,"column":4},"end":{"line":21,"column":6}},"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":45}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":33}},"3":{"start":{"line":43,"column":8},"end":{"line":43,"column":30}},"4":{"start":{"line":51,"column":26},"end":{"line":55,"column":9}},"5":{"start":{"line":52,"column":12},"end":{"line":54,"column":13}},"6":{"start":{"line":53,"column":16},"end":{"line":53,"column":42}},"7":{"start":{"line":56,"column":24},"end":{"line":56,"column":37}},"8":{"start":{"line":57,"column":8},"end":{"line":59,"column":11}},"9":{"start":{"line":58,"column":12},"end":{"line":58,"column":37}},"10":{"start":{"line":60,"column":8},"end":{"line":60,"column":20}},"11":{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},"12":{"start":{"line":74,"column":12},"end":{"line":74,"column":53}},"13":{"start":{"line":76,"column":8},"end":{"line":76,"column":68}},"14":{"start":{"line":77,"column":21},"end":{"line":77,"column":30}},"15":{"start":{"line":78,"column":20},"end":{"line":81,"column":10}},"16":{"start":{"line":82,"column":19},"end":{"line":84,"column":10}},"17":{"start":{"line":85,"column":21},"end":{"line":85,"column":23}},"18":{"start":{"line":86,"column":24},"end":{"line":93,"column":9}},"19":{"start":{"line":90,"column":20},"end":{"line":90,"column":43}},"20":{"start":{"line":94,"column":8},"end":{"line":94,"column":31}},"21":{"start":{"line":96,"column":32},"end":{"line":100,"column":9}},"22":{"start":{"line":101,"column":24},"end":{"line":101,"column":60}},"23":{"start":{"line":102,"column":8},"end":{"line":102,"column":48}},"24":{"start":{"line":103,"column":8},"end":{"line":103,"column":37}},"25":{"start":{"line":104,"column":19},"end":{"line":104,"column":49}},"26":{"start":{"line":105,"column":8},"end":{"line":107,"column":9}},"27":{"start":{"line":106,"column":12},"end":{"line":106,"column":50}},"28":{"start":{"line":108,"column":8},"end":{"line":108,"column":28}},"29":{"start":{"line":120,"column":8},"end":{"line":123,"column":9}},"30":{"start":{"line":121,"column":12},"end":{"line":121,"column":32}},"31":{"start":{"line":122,"column":12},"end":{"line":122,"column":28}},"32":{"start":{"line":124,"column":8},"end":{"line":129,"column":9}},"33":{"start":{"line":125,"column":22},"end":{"line":125,"column":57}},"34":{"start":{"line":126,"column":12},"end":{"line":126,"column":32}},"35":{"start":{"line":128,"column":12},"end":{"line":128,"column":25}},"36":{"start":{"line":136,"column":8},"end":{"line":136,"column":33}},"37":{"start":{"line":143,"column":8},"end":{"line":143,"column":30}}},"fnMap":{"0":{"name":"defaultOpts","decl":{"start":{"line":11,"column":9},"end":{"line":11,"column":20}},"loc":{"start":{"line":11,"column":23},"end":{"line":22,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":40,"column":4},"end":{"line":40,"column":5}},"loc":{"start":{"line":40,"column":36},"end":{"line":44,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":50,"column":4},"end":{"line":50,"column":5}},"loc":{"start":{"line":50,"column":24},"end":{"line":61,"column":5}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":51,"column":26},"end":{"line":51,"column":27}},"loc":{"start":{"line":51,"column":50},"end":{"line":55,"column":9}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":57,"column":37},"end":{"line":57,"column":38}},"loc":{"start":{"line":57,"column":50},"end":{"line":59,"column":9}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":72,"column":4},"end":{"line":72,"column":5}},"loc":{"start":{"line":72,"column":35},"end":{"line":109,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":89,"column":22},"end":{"line":89,"column":23}},"loc":{"start":{"line":89,"column":38},"end":{"line":91,"column":17}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":119,"column":4},"end":{"line":119,"column":5}},"loc":{"start":{"line":119,"column":41},"end":{"line":130,"column":5}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":135,"column":4},"end":{"line":135,"column":5}},"loc":{"start":{"line":135,"column":23},"end":{"line":137,"column":5}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":142,"column":4},"end":{"line":142,"column":5}},"loc":{"start":{"line":142,"column":20},"end":{"line":144,"column":5}}}},"branchMap":{"0":{"loc":{"start":{"line":40,"column":16},"end":{"line":40,"column":34}},"type":"default-arg","locations":[{"start":{"line":40,"column":21},"end":{"line":40,"column":34}}]},"1":{"loc":{"start":{"line":52,"column":12},"end":{"line":54,"column":13}},"type":"if","locations":[{"start":{"line":52,"column":12},"end":{"line":54,"column":13}},{"start":{"line":52,"column":12},"end":{"line":54,"column":13}}]},"2":{"loc":{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},{"start":{"line":73,"column":8},"end":{"line":75,"column":9}}]},"3":{"loc":{"start":{"line":76,"column":19},"end":{"line":76,"column":67}},"type":"binary-expr","locations":[{"start":{"line":76,"column":19},"end":{"line":76,"column":27}},{"start":{"line":76,"column":31},"end":{"line":76,"column":67}}]},"4":{"loc":{"start":{"line":80,"column":24},"end":{"line":80,"column":60}},"type":"cond-expr","locations":[{"start":{"line":80,"column":41},"end":{"line":80,"column":49}},{"start":{"line":80,"column":52},"end":{"line":80,"column":60}}]},"5":{"loc":{"start":{"line":105,"column":8},"end":{"line":107,"column":9}},"type":"if","locations":[{"start":{"line":105,"column":8},"end":{"line":107,"column":9}},{"start":{"line":105,"column":8},"end":{"line":107,"column":9}}]},"6":{"loc":{"start":{"line":105,"column":12},"end":{"line":105,"column":41}},"type":"binary-expr","locations":[{"start":{"line":105,"column":12},"end":{"line":105,"column":14}},{"start":{"line":105,"column":18},"end":{"line":105,"column":41}}]},"7":{"loc":{"start":{"line":120,"column":8},"end":{"line":123,"column":9}},"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":123,"column":9}},{"start":{"line":120,"column":8},"end":{"line":123,"column":9}}]},"8":{"loc":{"start":{"line":120,"column":12},"end":{"line":120,"column":55}},"type":"binary-expr","locations":[{"start":{"line":120,"column":12},"end":{"line":120,"column":21}},{"start":{"line":120,"column":25},"end":{"line":120,"column":55}}]}},"s":{"0":163,"1":162,"2":162,"3":162,"4":162,"5":1296,"6":1121,"7":162,"8":162,"9":1296,"10":162,"11":161,"12":1,"13":160,"14":160,"15":160,"16":157,"17":157,"18":157,"19":157,"20":157,"21":157,"22":157,"23":157,"24":157,"25":157,"26":157,"27":1,"28":157,"29":3,"30":2,"31":2,"32":3,"33":3,"34":2,"35":1,"36":157,"37":1},"f":{"0":163,"1":162,"2":162,"3":1296,"4":1296,"5":161,"6":157,"7":3,"8":157,"9":1},"b":{"0":[1],"1":[1121,175],"2":[1,160],"3":[160,3],"4":[2,158],"5":[1,156],"6":[157,1],"7":[2,1],"8":[3,2]},"hash":"e781aefc22affceb979a8b295b23310c87d5017c"},"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/visitor.js":{"path":"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/visitor.js","statementMap":{"0":{"start":{"line":7,"column":19},"end":{"line":7,"column":67}},"1":{"start":{"line":9,"column":22},"end":{"line":9,"column":57}},"2":{"start":{"line":13,"column":15},"end":{"line":13,"column":30}},"3":{"start":{"line":14,"column":4},"end":{"line":14,"column":26}},"4":{"start":{"line":15,"column":4},"end":{"line":15,"column":80}},"5":{"start":{"line":22,"column":8},"end":{"line":22,"column":46}},"6":{"start":{"line":23,"column":8},"end":{"line":23,"column":24}},"7":{"start":{"line":24,"column":8},"end":{"line":24,"column":31}},"8":{"start":{"line":25,"column":8},"end":{"line":25,"column":54}},"9":{"start":{"line":26,"column":8},"end":{"line":26,"column":27}},"10":{"start":{"line":27,"column":8},"end":{"line":27,"column":37}},"11":{"start":{"line":33,"column":8},"end":{"line":33,"column":49}},"12":{"start":{"line":38,"column":19},"end":{"line":38,"column":23}},"13":{"start":{"line":39,"column":8},"end":{"line":47,"column":9}},"14":{"start":{"line":40,"column":12},"end":{"line":46,"column":15}},"15":{"start":{"line":41,"column":26},"end":{"line":41,"column":91}},"16":{"start":{"line":42,"column":31},"end":{"line":42,"column":50}},"17":{"start":{"line":43,"column":16},"end":{"line":45,"column":17}},"18":{"start":{"line":44,"column":20},"end":{"line":44,"column":37}},"19":{"start":{"line":48,"column":8},"end":{"line":48,"column":20}},"20":{"start":{"line":53,"column":21},"end":{"line":53,"column":25}},"21":{"start":{"line":54,"column":27},"end":{"line":65,"column":9}},"22":{"start":{"line":55,"column":12},"end":{"line":57,"column":13}},"23":{"start":{"line":56,"column":16},"end":{"line":56,"column":23}},"24":{"start":{"line":58,"column":12},"end":{"line":64,"column":15}},"25":{"start":{"line":59,"column":26},"end":{"line":59,"column":91}},"26":{"start":{"line":60,"column":31},"end":{"line":60,"column":53}},"27":{"start":{"line":61,"column":16},"end":{"line":63,"column":17}},"28":{"start":{"line":62,"column":20},"end":{"line":62,"column":54}},"29":{"start":{"line":66,"column":8},"end":{"line":66,"column":41}},"30":{"start":{"line":67,"column":8},"end":{"line":67,"column":42}},"31":{"start":{"line":72,"column":18},"end":{"line":72,"column":27}},"32":{"start":{"line":74,"column":8},"end":{"line":74,"column":40}},"33":{"start":{"line":77,"column":8},"end":{"line":79,"column":9}},"34":{"start":{"line":78,"column":12},"end":{"line":78,"column":19}},"35":{"start":{"line":81,"column":21},"end":{"line":81,"column":36}},"36":{"start":{"line":82,"column":8},"end":{"line":85,"column":9}},"37":{"start":{"line":83,"column":12},"end":{"line":83,"column":32}},"38":{"start":{"line":84,"column":12},"end":{"line":84,"column":19}},"39":{"start":{"line":87,"column":8},"end":{"line":89,"column":9}},"40":{"start":{"line":88,"column":12},"end":{"line":88,"column":32}},"41":{"start":{"line":96,"column":8},"end":{"line":98,"column":9}},"42":{"start":{"line":97,"column":12},"end":{"line":97,"column":35}},"43":{"start":{"line":100,"column":8},"end":{"line":100,"column":34}},"44":{"start":{"line":105,"column":8},"end":{"line":105,"column":42}},"45":{"start":{"line":106,"column":8},"end":{"line":106,"column":35}},"46":{"start":{"line":111,"column":18},"end":{"line":111,"column":30}},"47":{"start":{"line":112,"column":8},"end":{"line":114,"column":9}},"48":{"start":{"line":113,"column":12},"end":{"line":113,"column":24}},"49":{"start":{"line":115,"column":8},"end":{"line":115,"column":23}},"50":{"start":{"line":120,"column":18},"end":{"line":120,"column":28}},"51":{"start":{"line":121,"column":22},"end":{"line":124,"column":26}},"52":{"start":{"line":123,"column":25},"end":{"line":123,"column":77}},"53":{"start":{"line":124,"column":25},"end":{"line":124,"column":26}},"54":{"start":{"line":126,"column":8},"end":{"line":134,"column":10}},"55":{"start":{"line":138,"column":18},"end":{"line":138,"column":28}},"56":{"start":{"line":139,"column":8},"end":{"line":147,"column":9}},"57":{"start":{"line":140,"column":12},"end":{"line":140,"column":69}},"58":{"start":{"line":141,"column":15},"end":{"line":147,"column":9}},"59":{"start":{"line":142,"column":12},"end":{"line":142,"column":64}},"60":{"start":{"line":143,"column":56},"end":{"line":147,"column":9}},"61":{"start":{"line":144,"column":12},"end":{"line":144,"column":75}},"62":{"start":{"line":146,"column":12},"end":{"line":146,"column":85}},"63":{"start":{"line":152,"column":8},"end":{"line":154,"column":9}},"64":{"start":{"line":155,"column":22},"end":{"line":155,"column":58}},"65":{"start":{"line":156,"column":26},"end":{"line":156,"column":57}},"66":{"start":{"line":157,"column":8},"end":{"line":157,"column":44}},"67":{"start":{"line":161,"column":18},"end":{"line":161,"column":28}},"68":{"start":{"line":163,"column":8},"end":{"line":165,"column":9}},"69":{"start":{"line":166,"column":18},"end":{"line":166,"column":27}},"70":{"start":{"line":167,"column":19},"end":{"line":167,"column":23}},"71":{"start":{"line":169,"column":8},"end":{"line":181,"column":9}},"72":{"start":{"line":172,"column":16},"end":{"line":174,"column":17}},"73":{"start":{"line":173,"column":20},"end":{"line":173,"column":36}},"74":{"start":{"line":175,"column":16},"end":{"line":175,"column":22}},"75":{"start":{"line":177,"column":16},"end":{"line":179,"column":17}},"76":{"start":{"line":178,"column":20},"end":{"line":178,"column":36}},"77":{"start":{"line":180,"column":16},"end":{"line":180,"column":22}},"78":{"start":{"line":182,"column":8},"end":{"line":187,"column":9}},"79":{"start":{"line":183,"column":12},"end":{"line":186,"column":14}},"80":{"start":{"line":188,"column":21},"end":{"line":188,"column":70}},"81":{"start":{"line":189,"column":22},"end":{"line":189,"column":74}},"82":{"start":{"line":190,"column":26},"end":{"line":190,"column":57}},"83":{"start":{"line":191,"column":21},"end":{"line":191,"column":37}},"84":{"start":{"line":193,"column":8},"end":{"line":197,"column":9}},"85":{"start":{"line":194,"column":12},"end":{"line":194,"column":69}},"86":{"start":{"line":201,"column":22},"end":{"line":201,"column":61}},"87":{"start":{"line":202,"column":8},"end":{"line":202,"column":53}},"88":{"start":{"line":206,"column":26},"end":{"line":206,"column":83}},"89":{"start":{"line":207,"column":8},"end":{"line":207,"column":44}},"90":{"start":{"line":211,"column":8},"end":{"line":213,"column":9}},"91":{"start":{"line":212,"column":12},"end":{"line":212,"column":19}},"92":{"start":{"line":214,"column":8},"end":{"line":226,"column":9}},"93":{"start":{"line":215,"column":25},"end":{"line":215,"column":43}},"94":{"start":{"line":216,"column":12},"end":{"line":219,"column":13}},"95":{"start":{"line":217,"column":16},"end":{"line":217,"column":70}},"96":{"start":{"line":218,"column":16},"end":{"line":218,"column":72}},"97":{"start":{"line":221,"column":12},"end":{"line":225,"column":15}},"98":{"start":{"line":240,"column":18},"end":{"line":240,"column":55}},"99":{"start":{"line":242,"column":25},"end":{"line":251,"column":5}},"100":{"start":{"line":243,"column":8},"end":{"line":243,"column":27}},"101":{"start":{"line":244,"column":8},"end":{"line":246,"column":9}},"102":{"start":{"line":245,"column":12},"end":{"line":245,"column":19}},"103":{"start":{"line":247,"column":21},"end":{"line":247,"column":25}},"104":{"start":{"line":248,"column":8},"end":{"line":250,"column":11}},"105":{"start":{"line":249,"column":12},"end":{"line":249,"column":37}},"106":{"start":{"line":252,"column":17},"end":{"line":254,"column":5}},"107":{"start":{"line":253,"column":8},"end":{"line":253,"column":32}},"108":{"start":{"line":255,"column":4},"end":{"line":258,"column":6}},"109":{"start":{"line":262,"column":4},"end":{"line":262,"column":38}},"110":{"start":{"line":273,"column":4},"end":{"line":273,"column":37}},"111":{"start":{"line":277,"column":4},"end":{"line":277,"column":50}},"112":{"start":{"line":281,"column":4},"end":{"line":283,"column":5}},"113":{"start":{"line":282,"column":8},"end":{"line":282,"column":55}},"114":{"start":{"line":287,"column":14},"end":{"line":287,"column":24}},"115":{"start":{"line":288,"column":4},"end":{"line":290,"column":5}},"116":{"start":{"line":289,"column":8},"end":{"line":289,"column":47}},"117":{"start":{"line":291,"column":4},"end":{"line":294,"column":5}},"118":{"start":{"line":292,"column":8},"end":{"line":292,"column":56}},"119":{"start":{"line":293,"column":8},"end":{"line":293,"column":46}},"120":{"start":{"line":298,"column":4},"end":{"line":300,"column":6}},"121":{"start":{"line":299,"column":8},"end":{"line":299,"column":45}},"122":{"start":{"line":304,"column":14},"end":{"line":304,"column":23}},"123":{"start":{"line":305,"column":14},"end":{"line":305,"column":24}},"124":{"start":{"line":306,"column":4},"end":{"line":319,"column":5}},"125":{"start":{"line":307,"column":21},"end":{"line":307,"column":31}},"126":{"start":{"line":308,"column":8},"end":{"line":308,"column":29}},"127":{"start":{"line":309,"column":8},"end":{"line":313,"column":11}},"128":{"start":{"line":315,"column":8},"end":{"line":315,"column":26}},"129":{"start":{"line":318,"column":8},"end":{"line":318,"column":34}},"130":{"start":{"line":323,"column":14},"end":{"line":323,"column":23}},"131":{"start":{"line":324,"column":15},"end":{"line":324,"column":30}},"132":{"start":{"line":325,"column":19},"end":{"line":325,"column":32}},"133":{"start":{"line":326,"column":21},"end":{"line":326,"column":36}},"134":{"start":{"line":327,"column":17},"end":{"line":327,"column":48}},"135":{"start":{"line":329,"column":4},"end":{"line":333,"column":5}},"136":{"start":{"line":330,"column":8},"end":{"line":330,"column":53}},"137":{"start":{"line":332,"column":8},"end":{"line":332,"column":72}},"138":{"start":{"line":334,"column":4},"end":{"line":338,"column":5}},"139":{"start":{"line":335,"column":8},"end":{"line":335,"column":52}},"140":{"start":{"line":337,"column":8},"end":{"line":337,"column":71}},"141":{"start":{"line":342,"column":14},"end":{"line":342,"column":57}},"142":{"start":{"line":343,"column":4},"end":{"line":343,"column":45}},"143":{"start":{"line":347,"column":14},"end":{"line":347,"column":24}},"144":{"start":{"line":348,"column":14},"end":{"line":348,"column":62}},"145":{"start":{"line":350,"column":4},"end":{"line":352,"column":5}},"146":{"start":{"line":353,"column":22},"end":{"line":353,"column":63}},"147":{"start":{"line":354,"column":4},"end":{"line":354,"column":67}},"148":{"start":{"line":358,"column":14},"end":{"line":358,"column":23}},"149":{"start":{"line":359,"column":17},"end":{"line":359,"column":63}},"150":{"start":{"line":360,"column":16},"end":{"line":360,"column":42}},"151":{"start":{"line":361,"column":16},"end":{"line":361,"column":41}},"152":{"start":{"line":363,"column":4},"end":{"line":365,"column":5}},"153":{"start":{"line":364,"column":8},"end":{"line":364,"column":65}},"154":{"start":{"line":366,"column":4},"end":{"line":368,"column":5}},"155":{"start":{"line":367,"column":8},"end":{"line":367,"column":64}},"156":{"start":{"line":373,"column":14},"end":{"line":373,"column":24}},"157":{"start":{"line":374,"column":4},"end":{"line":376,"column":5}},"158":{"start":{"line":375,"column":8},"end":{"line":375,"column":15}},"159":{"start":{"line":377,"column":17},"end":{"line":377,"column":19}},"160":{"start":{"line":378,"column":4},"end":{"line":378,"column":39}},"161":{"start":{"line":379,"column":14},"end":{"line":379,"column":62}},"162":{"start":{"line":380,"column":4},"end":{"line":391,"column":5}},"163":{"start":{"line":381,"column":21},"end":{"line":381,"column":30}},"164":{"start":{"line":382,"column":21},"end":{"line":382,"column":44}},"165":{"start":{"line":383,"column":8},"end":{"line":385,"column":9}},"166":{"start":{"line":384,"column":12},"end":{"line":384,"column":21}},"167":{"start":{"line":386,"column":26},"end":{"line":386,"column":67}},"168":{"start":{"line":387,"column":8},"end":{"line":389,"column":9}},"169":{"start":{"line":388,"column":12},"end":{"line":388,"column":21}},"170":{"start":{"line":390,"column":8},"end":{"line":390,"column":82}},"171":{"start":{"line":394,"column":20},"end":{"line":422,"column":1}},"172":{"start":{"line":424,"column":25},"end":{"line":438,"column":2}},"173":{"start":{"line":458,"column":14},"end":{"line":458,"column":19}},"174":{"start":{"line":459,"column":23},"end":{"line":459,"column":60}},"175":{"start":{"line":460,"column":4},"end":{"line":485,"column":6}},"176":{"start":{"line":462,"column":12},"end":{"line":462,"column":51}},"177":{"start":{"line":465,"column":12},"end":{"line":465,"column":36}},"178":{"start":{"line":466,"column":33},"end":{"line":466,"column":56}},"179":{"start":{"line":467,"column":12},"end":{"line":467,"column":50}},"180":{"start":{"line":468,"column":25},"end":{"line":468,"column":91}},"181":{"start":{"line":469,"column":33},"end":{"line":469,"column":60}},"182":{"start":{"line":470,"column":12},"end":{"line":470,"column":43}},"183":{"start":{"line":471,"column":23},"end":{"line":477,"column":14}},"184":{"start":{"line":478,"column":12},"end":{"line":478,"column":31}},"185":{"start":{"line":479,"column":12},"end":{"line":479,"column":39}},"186":{"start":{"line":480,"column":12},"end":{"line":483,"column":14}}},"fnMap":{"0":{"name":"genVar","decl":{"start":{"line":12,"column":9},"end":{"line":12,"column":15}},"loc":{"start":{"line":12,"column":26},"end":{"line":16,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":21,"column":4},"end":{"line":21,"column":5}},"loc":{"start":{"line":21,"column":39},"end":{"line":28,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":32,"column":4},"end":{"line":32,"column":5}},"loc":{"start":{"line":32,"column":23},"end":{"line":34,"column":5}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":37,"column":4},"end":{"line":37,"column":5}},"loc":{"start":{"line":37,"column":18},"end":{"line":49,"column":5}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":40,"column":41},"end":{"line":40,"column":42}},"loc":{"start":{"line":40,"column":54},"end":{"line":46,"column":13}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":52,"column":4},"end":{"line":52,"column":5}},"loc":{"start":{"line":52,"column":34},"end":{"line":68,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":54,"column":27},"end":{"line":54,"column":28}},"loc":{"start":{"line":54,"column":41},"end":{"line":65,"column":9}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":58,"column":29},"end":{"line":58,"column":30}},"loc":{"start":{"line":58,"column":42},"end":{"line":64,"column":13}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":71,"column":4},"end":{"line":71,"column":5}},"loc":{"start":{"line":71,"column":18},"end":{"line":90,"column":5}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":94,"column":4},"end":{"line":94,"column":5}},"loc":{"start":{"line":94,"column":17},"end":{"line":101,"column":5}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":104,"column":4},"end":{"line":104,"column":5}},"loc":{"start":{"line":104,"column":31},"end":{"line":107,"column":5}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":110,"column":4},"end":{"line":110,"column":5}},"loc":{"start":{"line":110,"column":24},"end":{"line":116,"column":5}}},"12":{"name":"(anonymous_12)","decl":{"start":{"line":119,"column":4},"end":{"line":119,"column":5}},"loc":{"start":{"line":119,"column":30},"end":{"line":135,"column":5}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":123,"column":18},"end":{"line":123,"column":19}},"loc":{"start":{"line":123,"column":25},"end":{"line":123,"column":77}}},"14":{"name":"(anonymous_14)","decl":{"start":{"line":124,"column":18},"end":{"line":124,"column":19}},"loc":{"start":{"line":124,"column":25},"end":{"line":124,"column":26}}},"15":{"name":"(anonymous_15)","decl":{"start":{"line":137,"column":4},"end":{"line":137,"column":5}},"loc":{"start":{"line":137,"column":35},"end":{"line":148,"column":5}}},"16":{"name":"(anonymous_16)","decl":{"start":{"line":150,"column":4},"end":{"line":150,"column":5}},"loc":{"start":{"line":150,"column":33},"end":{"line":158,"column":5}}},"17":{"name":"(anonymous_17)","decl":{"start":{"line":160,"column":4},"end":{"line":160,"column":5}},"loc":{"start":{"line":160,"column":32},"end":{"line":198,"column":5}}},"18":{"name":"(anonymous_18)","decl":{"start":{"line":200,"column":4},"end":{"line":200,"column":5}},"loc":{"start":{"line":200,"column":40},"end":{"line":203,"column":5}}},"19":{"name":"(anonymous_19)","decl":{"start":{"line":205,"column":4},"end":{"line":205,"column":5}},"loc":{"start":{"line":205,"column":47},"end":{"line":208,"column":5}}},"20":{"name":"(anonymous_20)","decl":{"start":{"line":210,"column":4},"end":{"line":210,"column":5}},"loc":{"start":{"line":210,"column":52},"end":{"line":227,"column":5}}},"21":{"name":"entries","decl":{"start":{"line":239,"column":9},"end":{"line":239,"column":16}},"loc":{"start":{"line":239,"column":19},"end":{"line":259,"column":1}}},"22":{"name":"(anonymous_22)","decl":{"start":{"line":242,"column":25},"end":{"line":242,"column":26}},"loc":{"start":{"line":242,"column":47},"end":{"line":251,"column":5}}},"23":{"name":"(anonymous_23)","decl":{"start":{"line":248,"column":22},"end":{"line":248,"column":23}},"loc":{"start":{"line":248,"column":35},"end":{"line":250,"column":9}}},"24":{"name":"(anonymous_24)","decl":{"start":{"line":252,"column":17},"end":{"line":252,"column":18}},"loc":{"start":{"line":252,"column":39},"end":{"line":254,"column":5}}},"25":{"name":"coverStatement","decl":{"start":{"line":261,"column":9},"end":{"line":261,"column":23}},"loc":{"start":{"line":261,"column":30},"end":{"line":263,"column":1}}},"26":{"name":"coverFunction","decl":{"start":{"line":272,"column":9},"end":{"line":272,"column":22}},"loc":{"start":{"line":272,"column":29},"end":{"line":274,"column":1}}},"27":{"name":"coverVariableDeclarator","decl":{"start":{"line":276,"column":9},"end":{"line":276,"column":32}},"loc":{"start":{"line":276,"column":39},"end":{"line":278,"column":1}}},"28":{"name":"skipInit","decl":{"start":{"line":280,"column":9},"end":{"line":280,"column":17}},"loc":{"start":{"line":280,"column":24},"end":{"line":284,"column":1}}},"29":{"name":"makeBlock","decl":{"start":{"line":286,"column":9},"end":{"line":286,"column":18}},"loc":{"start":{"line":286,"column":25},"end":{"line":295,"column":1}}},"30":{"name":"blockProp","decl":{"start":{"line":297,"column":9},"end":{"line":297,"column":18}},"loc":{"start":{"line":297,"column":25},"end":{"line":301,"column":1}}},"31":{"name":"(anonymous_31)","decl":{"start":{"line":298,"column":11},"end":{"line":298,"column":12}},"loc":{"start":{"line":298,"column":27},"end":{"line":300,"column":5}}},"32":{"name":"convertArrowExpression","decl":{"start":{"line":303,"column":9},"end":{"line":303,"column":31}},"loc":{"start":{"line":303,"column":38},"end":{"line":320,"column":1}}},"33":{"name":"coverIfBranches","decl":{"start":{"line":322,"column":9},"end":{"line":322,"column":24}},"loc":{"start":{"line":322,"column":31},"end":{"line":339,"column":1}}},"34":{"name":"createSwitchBranch","decl":{"start":{"line":341,"column":9},"end":{"line":341,"column":27}},"loc":{"start":{"line":341,"column":34},"end":{"line":344,"column":1}}},"35":{"name":"coverSwitchCase","decl":{"start":{"line":346,"column":9},"end":{"line":346,"column":24}},"loc":{"start":{"line":346,"column":31},"end":{"line":355,"column":1}}},"36":{"name":"coverTernary","decl":{"start":{"line":357,"column":9},"end":{"line":357,"column":21}},"loc":{"start":{"line":357,"column":28},"end":{"line":369,"column":1}}},"37":{"name":"coverLogicalExpression","decl":{"start":{"line":372,"column":9},"end":{"line":372,"column":31}},"loc":{"start":{"line":372,"column":38},"end":{"line":392,"column":1}}},"38":{"name":"programVisitor","decl":{"start":{"line":457,"column":9},"end":{"line":457,"column":23}},"loc":{"start":{"line":457,"column":105},"end":{"line":486,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":33,"column":15},"end":{"line":33,"column":48}},"type":"binary-expr","locations":[{"start":{"line":33,"column":15},"end":{"line":33,"column":30}},{"start":{"line":33,"column":34},"end":{"line":33,"column":48}}]},"1":{"loc":{"start":{"line":39,"column":8},"end":{"line":47,"column":9}},"type":"if","locations":[{"start":{"line":39,"column":8},"end":{"line":47,"column":9}},{"start":{"line":39,"column":8},"end":{"line":47,"column":9}}]},"2":{"loc":{"start":{"line":41,"column":27},"end":{"line":41,"column":83}},"type":"binary-expr","locations":[{"start":{"line":41,"column":27},"end":{"line":41,"column":34}}]},"3":{"loc":{"start":{"line":43,"column":16},"end":{"line":45,"column":17}},"type":"if","locations":[{"start":{"line":43,"column":16},"end":{"line":45,"column":17}},{"start":{"line":43,"column":16},"end":{"line":45,"column":17}}]},"4":{"loc":{"start":{"line":55,"column":12},"end":{"line":57,"column":13}},"type":"if","locations":[{"start":{"line":55,"column":12},"end":{"line":57,"column":13}},{"start":{"line":55,"column":12},"end":{"line":57,"column":13}}]},"5":{"loc":{"start":{"line":59,"column":27},"end":{"line":59,"column":83}},"type":"binary-expr","locations":[{"start":{"line":59,"column":27},"end":{"line":59,"column":34}}]},"6":{"loc":{"start":{"line":61,"column":16},"end":{"line":63,"column":17}},"type":"if","locations":[{"start":{"line":61,"column":16},"end":{"line":63,"column":17}},{"start":{"line":61,"column":16},"end":{"line":63,"column":17}}]},"7":{"loc":{"start":{"line":77,"column":8},"end":{"line":79,"column":9}},"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":79,"column":9}},{"start":{"line":77,"column":8},"end":{"line":79,"column":9}}]},"8":{"loc":{"start":{"line":82,"column":8},"end":{"line":85,"column":9}},"type":"if","locations":[{"start":{"line":82,"column":8},"end":{"line":85,"column":9}},{"start":{"line":82,"column":8},"end":{"line":85,"column":9}}]},"9":{"loc":{"start":{"line":87,"column":8},"end":{"line":89,"column":9}},"type":"if","locations":[{"start":{"line":87,"column":8},"end":{"line":89,"column":9}},{"start":{"line":87,"column":8},"end":{"line":89,"column":9}}]},"10":{"loc":{"start":{"line":96,"column":8},"end":{"line":98,"column":9}},"type":"if","locations":[{"start":{"line":96,"column":8},"end":{"line":98,"column":9}},{"start":{"line":96,"column":8},"end":{"line":98,"column":9}}]},"11":{"loc":{"start":{"line":105,"column":23},"end":{"line":105,"column":41}},"type":"binary-expr","locations":[{"start":{"line":105,"column":23},"end":{"line":105,"column":35}},{"start":{"line":105,"column":39},"end":{"line":105,"column":41}}]},"12":{"loc":{"start":{"line":112,"column":8},"end":{"line":114,"column":9}},"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":114,"column":9}},{"start":{"line":112,"column":8},"end":{"line":114,"column":9}}]},"13":{"loc":{"start":{"line":121,"column":22},"end":{"line":124,"column":26}},"type":"cond-expr","locations":[{"start":{"line":123,"column":18},"end":{"line":123,"column":77}},{"start":{"line":124,"column":18},"end":{"line":124,"column":26}}]},"14":{"loc":{"start":{"line":139,"column":8},"end":{"line":147,"column":9}},"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":147,"column":9}},{"start":{"line":139,"column":8},"end":{"line":147,"column":9}}]},"15":{"loc":{"start":{"line":141,"column":15},"end":{"line":147,"column":9}},"type":"if","locations":[{"start":{"line":141,"column":15},"end":{"line":147,"column":9}},{"start":{"line":141,"column":15},"end":{"line":147,"column":9}}]},"16":{"loc":{"start":{"line":143,"column":56},"end":{"line":147,"column":9}},"type":"if","locations":[{"start":{"line":143,"column":56},"end":{"line":147,"column":9}},{"start":{"line":143,"column":56},"end":{"line":147,"column":9}}]},"17":{"loc":{"start":{"line":152,"column":8},"end":{"line":154,"column":9}},"type":"if","locations":[{"start":{"line":152,"column":8},"end":{"line":154,"column":9}}]},"18":{"loc":{"start":{"line":152,"column":14},"end":{"line":152,"column":40}},"type":"binary-expr","locations":[{"start":{"line":152,"column":14},"end":{"line":152,"column":23}},{"start":{"line":152,"column":27},"end":{"line":152,"column":40}}]},"19":{"loc":{"start":{"line":163,"column":8},"end":{"line":165,"column":9}},"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":165,"column":9}}]},"20":{"loc":{"start":{"line":163,"column":14},"end":{"line":163,"column":40}},"type":"binary-expr","locations":[{"start":{"line":163,"column":14},"end":{"line":163,"column":23}},{"start":{"line":163,"column":27},"end":{"line":163,"column":40}}]},"21":{"loc":{"start":{"line":169,"column":8},"end":{"line":181,"column":9}},"type":"switch","locations":[{"start":{"line":170,"column":12},"end":{"line":175,"column":22}},{"start":{"line":176,"column":12},"end":{"line":180,"column":22}}]},"22":{"loc":{"start":{"line":172,"column":16},"end":{"line":174,"column":17}},"type":"if","locations":[{"start":{"line":172,"column":16},"end":{"line":174,"column":17}}]},"23":{"loc":{"start":{"line":177,"column":16},"end":{"line":179,"column":17}},"type":"if","locations":[{"start":{"line":177,"column":16},"end":{"line":179,"column":17}},{"start":{"line":177,"column":16},"end":{"line":179,"column":17}}]},"24":{"loc":{"start":{"line":182,"column":8},"end":{"line":187,"column":9}},"type":"if","locations":[{"start":{"line":182,"column":8},"end":{"line":187,"column":9}},{"start":{"line":182,"column":8},"end":{"line":187,"column":9}}]},"25":{"loc":{"start":{"line":188,"column":21},"end":{"line":188,"column":70}},"type":"cond-expr","locations":[{"start":{"line":188,"column":36},"end":{"line":188,"column":53}},{"start":{"line":188,"column":56},"end":{"line":188,"column":70}}]},"26":{"loc":{"start":{"line":193,"column":8},"end":{"line":197,"column":9}},"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":197,"column":9}}]},"27":{"loc":{"start":{"line":206,"column":62},"end":{"line":206,"column":82}},"type":"binary-expr","locations":[{"start":{"line":206,"column":62},"end":{"line":206,"column":65}},{"start":{"line":206,"column":69},"end":{"line":206,"column":82}}]},"28":{"loc":{"start":{"line":211,"column":8},"end":{"line":213,"column":9}},"type":"if","locations":[{"start":{"line":211,"column":8},"end":{"line":213,"column":9}},{"start":{"line":211,"column":8},"end":{"line":213,"column":9}}]},"29":{"loc":{"start":{"line":214,"column":8},"end":{"line":226,"column":9}},"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":226,"column":9}},{"start":{"line":214,"column":8},"end":{"line":226,"column":9}}]},"30":{"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}}]},"31":{"loc":{"start":{"line":244,"column":8},"end":{"line":246,"column":9}},"type":"if","locations":[{"start":{"line":244,"column":8},"end":{"line":246,"column":9}},{"start":{"line":244,"column":8},"end":{"line":246,"column":9}}]},"32":{"loc":{"start":{"line":281,"column":4},"end":{"line":283,"column":5}},"type":"if","locations":[{"start":{"line":281,"column":4},"end":{"line":283,"column":5}},{"start":{"line":281,"column":4},"end":{"line":283,"column":5}}]},"33":{"loc":{"start":{"line":288,"column":4},"end":{"line":290,"column":5}},"type":"if","locations":[{"start":{"line":288,"column":4},"end":{"line":290,"column":5}},{"start":{"line":288,"column":4},"end":{"line":290,"column":5}}]},"34":{"loc":{"start":{"line":291,"column":4},"end":{"line":294,"column":5}},"type":"if","locations":[{"start":{"line":291,"column":4},"end":{"line":294,"column":5}},{"start":{"line":291,"column":4},"end":{"line":294,"column":5}}]},"35":{"loc":{"start":{"line":306,"column":4},"end":{"line":319,"column":5}},"type":"if","locations":[{"start":{"line":306,"column":4},"end":{"line":319,"column":5}},{"start":{"line":306,"column":4},"end":{"line":319,"column":5}}]},"36":{"loc":{"start":{"line":329,"column":4},"end":{"line":333,"column":5}},"type":"if","locations":[{"start":{"line":329,"column":4},"end":{"line":333,"column":5}},{"start":{"line":329,"column":4},"end":{"line":333,"column":5}}]},"37":{"loc":{"start":{"line":334,"column":4},"end":{"line":338,"column":5}},"type":"if","locations":[{"start":{"line":334,"column":4},"end":{"line":338,"column":5}},{"start":{"line":334,"column":4},"end":{"line":338,"column":5}}]},"38":{"loc":{"start":{"line":350,"column":4},"end":{"line":352,"column":5}},"type":"if","locations":[{"start":{"line":350,"column":4},"end":{"line":352,"column":5}}]},"39":{"loc":{"start":{"line":363,"column":4},"end":{"line":365,"column":5}},"type":"if","locations":[{"start":{"line":363,"column":4},"end":{"line":365,"column":5}},{"start":{"line":363,"column":4},"end":{"line":365,"column":5}}]},"40":{"loc":{"start":{"line":366,"column":4},"end":{"line":368,"column":5}},"type":"if","locations":[{"start":{"line":366,"column":4},"end":{"line":368,"column":5}},{"start":{"line":366,"column":4},"end":{"line":368,"column":5}}]},"41":{"loc":{"start":{"line":374,"column":4},"end":{"line":376,"column":5}},"type":"if","locations":[{"start":{"line":374,"column":4},"end":{"line":376,"column":5}},{"start":{"line":374,"column":4},"end":{"line":376,"column":5}}]},"42":{"loc":{"start":{"line":383,"column":8},"end":{"line":385,"column":9}},"type":"if","locations":[{"start":{"line":383,"column":8},"end":{"line":385,"column":9}},{"start":{"line":383,"column":8},"end":{"line":385,"column":9}}]},"43":{"loc":{"start":{"line":387,"column":8},"end":{"line":389,"column":9}},"type":"if","locations":[{"start":{"line":387,"column":8},"end":{"line":389,"column":9}},{"start":{"line":387,"column":8},"end":{"line":389,"column":9}}]},"44":{"loc":{"start":{"line":457,"column":31},"end":{"line":457,"column":60}},"type":"default-arg","locations":[{"start":{"line":457,"column":48},"end":{"line":457,"column":60}}]},"45":{"loc":{"start":{"line":457,"column":62},"end":{"line":457,"column":103}},"type":"default-arg","locations":[{"start":{"line":457,"column":69},"end":{"line":457,"column":103}}]}},"s":{"0":1,"1":1,"2":157,"3":157,"4":157,"5":157,"6":157,"7":157,"8":157,"9":157,"10":157,"11":1948,"12":2104,"13":2104,"14":170,"15":39,"16":39,"17":39,"18":35,"19":2104,"20":1948,"21":1948,"22":3896,"23":3599,"24":297,"25":35,"26":35,"27":35,"28":1,"29":1948,"30":1948,"31":1948,"32":1948,"33":1948,"34":26,"35":1922,"36":1922,"37":11,"38":11,"39":1911,"40":12,"41":1948,"42":23,"43":1948,"44":39,"45":39,"46":1954,"47":1954,"48":1899,"49":55,"50":956,"51":956,"52":304,"53":652,"54":956,"55":862,"56":862,"57":208,"58":654,"59":546,"60":108,"61":108,"62":0,"63":642,"64":627,"65":627,"66":627,"67":25,"68":25,"69":25,"70":25,"71":25,"72":11,"73":11,"74":11,"75":5,"76":2,"77":5,"78":25,"79":12,"80":25,"81":25,"82":25,"83":25,"84":25,"85":25,"86":304,"87":304,"88":235,"89":235,"90":45,"91":0,"92":45,"93":18,"94":18,"95":16,"96":16,"97":27,"98":27,"99":27,"100":1948,"101":1948,"102":911,"103":1037,"104":1037,"105":1142,"106":27,"107":1948,"108":27,"109":546,"110":25,"111":96,"112":17,"113":12,"114":251,"115":251,"116":44,"117":251,"118":131,"119":131,"120":8,"121":251,"122":8,"123":8,"124":8,"125":6,"126":6,"127":6,"128":6,"129":6,"130":109,"131":109,"132":109,"133":109,"134":109,"135":109,"136":5,"137":104,"138":109,"139":5,"140":104,"141":17,"142":17,"143":43,"144":43,"145":43,"146":43,"147":43,"148":14,"149":14,"150":14,"151":14,"152":14,"153":13,"154":14,"155":14,"156":16,"157":16,"158":3,"159":13,"160":13,"161":13,"162":13,"163":27,"164":27,"165":27,"166":1,"167":26,"168":26,"169":0,"170":26,"171":1,"172":1,"173":157,"174":157,"175":157,"176":157,"177":157,"178":157,"179":157,"180":157,"181":157,"182":157,"183":157,"184":157,"185":157,"186":157},"f":{"0":157,"1":157,"2":1948,"3":2104,"4":39,"5":1948,"6":3896,"7":35,"8":1948,"9":1948,"10":39,"11":1954,"12":956,"13":304,"14":652,"15":862,"16":642,"17":25,"18":304,"19":235,"20":45,"21":27,"22":1948,"23":1142,"24":1948,"25":546,"26":25,"27":96,"28":17,"29":251,"30":8,"31":251,"32":8,"33":109,"34":17,"35":43,"36":14,"37":16,"38":157},"b":{"0":[1948,1899],"1":[170,1934],"2":[39],"3":[35,4],"4":[3599,297],"5":[35],"6":[1,34],"7":[26,1922],"8":[11,1911],"9":[12,1899],"10":[23,1925],"11":[39,39],"12":[1899,55],"13":[304,652],"14":[208,654],"15":[546,108],"16":[108,0],"17":[627],"18":[642,627],"19":[25],"20":[25,25],"21":[11,5],"22":[11],"23":[2,3],"24":[12,13],"25":[13,12],"26":[25],"27":[235,27],"28":[0,45],"29":[18,27],"30":[16,2],"31":[911,1037],"32":[12,5],"33":[44,207],"34":[131,120],"35":[6,2],"36":[5,104],"37":[5,104],"38":[43],"39":[13,1],"40":[14,0],"41":[3,13],"42":[1,26],"43":[0,26],"44":[0],"45":[0]},"hash":"6495f8b3227e694f5124e377c6f0e545da797d67"},"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/source-coverage.js":{"path":"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/source-coverage.js","statementMap":{"0":{"start":{"line":4,"column":4},"end":{"line":13,"column":6}},"1":{"start":{"line":27,"column":8},"end":{"line":27,"column":25}},"2":{"start":{"line":28,"column":8},"end":{"line":34,"column":10}},"3":{"start":{"line":38,"column":16},"end":{"line":38,"column":32}},"4":{"start":{"line":39,"column":8},"end":{"line":39,"column":55}},"5":{"start":{"line":40,"column":8},"end":{"line":40,"column":27}},"6":{"start":{"line":41,"column":8},"end":{"line":41,"column":30}},"7":{"start":{"line":42,"column":8},"end":{"line":42,"column":17}},"8":{"start":{"line":46,"column":16},"end":{"line":46,"column":32}},"9":{"start":{"line":47,"column":8},"end":{"line":47,"column":47}},"10":{"start":{"line":48,"column":8},"end":{"line":52,"column":10}},"11":{"start":{"line":53,"column":8},"end":{"line":53,"column":27}},"12":{"start":{"line":54,"column":8},"end":{"line":54,"column":30}},"13":{"start":{"line":55,"column":8},"end":{"line":55,"column":17}},"14":{"start":{"line":59,"column":16},"end":{"line":59,"column":32}},"15":{"start":{"line":60,"column":8},"end":{"line":60,"column":28}},"16":{"start":{"line":61,"column":8},"end":{"line":65,"column":10}},"17":{"start":{"line":66,"column":8},"end":{"line":66,"column":30}},"18":{"start":{"line":67,"column":8},"end":{"line":67,"column":17}},"19":{"start":{"line":71,"column":20},"end":{"line":71,"column":45}},"20":{"start":{"line":72,"column":21},"end":{"line":72,"column":38}},"21":{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},"22":{"start":{"line":78,"column":8},"end":{"line":78,"column":54}},"23":{"start":{"line":79,"column":8},"end":{"line":79,"column":23}},"24":{"start":{"line":80,"column":8},"end":{"line":80,"column":33}},"25":{"start":{"line":85,"column":18},"end":{"line":85,"column":37}},"26":{"start":{"line":86,"column":23},"end":{"line":86,"column":34}},"27":{"start":{"line":87,"column":8},"end":{"line":92,"column":11}},"28":{"start":{"line":88,"column":12},"end":{"line":91,"column":13}},"29":{"start":{"line":89,"column":16},"end":{"line":89,"column":30}},"30":{"start":{"line":90,"column":16},"end":{"line":90,"column":35}}},"fnMap":{"0":{"name":"cloneLocation","decl":{"start":{"line":3,"column":9},"end":{"line":3,"column":22}},"loc":{"start":{"line":3,"column":28},"end":{"line":14,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":26,"column":4},"end":{"line":26,"column":5}},"loc":{"start":{"line":26,"column":27},"end":{"line":35,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":37,"column":4},"end":{"line":37,"column":5}},"loc":{"start":{"line":37,"column":22},"end":{"line":43,"column":5}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":45,"column":4},"end":{"line":45,"column":5}},"loc":{"start":{"line":45,"column":33},"end":{"line":56,"column":5}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":58,"column":4},"end":{"line":58,"column":5}},"loc":{"start":{"line":58,"column":25},"end":{"line":68,"column":5}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":70,"column":4},"end":{"line":70,"column":5}},"loc":{"start":{"line":70,"column":34},"end":{"line":81,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":83,"column":4},"end":{"line":83,"column":5}},"loc":{"start":{"line":83,"column":13},"end":{"line":93,"column":5}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":87,"column":33},"end":{"line":87,"column":34}},"loc":{"start":{"line":87,"column":46},"end":{"line":92,"column":9}}}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":39}},"type":"binary-expr","locations":[{"start":{"line":6,"column":18},"end":{"line":6,"column":21}},{"start":{"line":6,"column":25},"end":{"line":6,"column":39}}]},"1":{"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":43}},"type":"binary-expr","locations":[{"start":{"line":7,"column":20},"end":{"line":7,"column":23}},{"start":{"line":7,"column":27},"end":{"line":7,"column":43}}]},"2":{"loc":{"start":{"line":10,"column":18},"end":{"line":10,"column":37}},"type":"binary-expr","locations":[{"start":{"line":10,"column":18},"end":{"line":10,"column":21}},{"start":{"line":10,"column":25},"end":{"line":10,"column":37}}]},"3":{"loc":{"start":{"line":11,"column":20},"end":{"line":11,"column":41}},"type":"binary-expr","locations":[{"start":{"line":11,"column":20},"end":{"line":11,"column":23}},{"start":{"line":11,"column":27},"end":{"line":11,"column":41}}]},"4":{"loc":{"start":{"line":47,"column":15},"end":{"line":47,"column":46}},"type":"binary-expr","locations":[{"start":{"line":47,"column":15},"end":{"line":47,"column":19}},{"start":{"line":47,"column":23},"end":{"line":47,"column":46}}]},"5":{"loc":{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":77,"column":9}}]},"6":{"loc":{"start":{"line":88,"column":12},"end":{"line":91,"column":13}},"type":"if","locations":[{"start":{"line":88,"column":12},"end":{"line":91,"column":13}},{"start":{"line":88,"column":12},"end":{"line":91,"column":13}}]}},"s":{"0":1134,"1":157,"2":157,"3":627,"4":627,"5":627,"6":627,"7":627,"8":25,"9":25,"10":25,"11":25,"12":25,"13":25,"14":153,"15":153,"16":153,"17":153,"18":153,"19":304,"20":304,"21":304,"22":304,"23":304,"24":304,"25":157,"26":157,"27":157,"28":153,"29":1,"30":1},"f":{"0":1134,"1":157,"2":627,"3":25,"4":153,"5":304,"6":157,"7":153},"b":{"0":[1134,1134],"1":[1134,1134],"2":[1134,1134],"3":[1134,1134],"4":[25,12],"5":[304],"6":[1,152]},"hash":"4e936fda45d04eb0cd742a22f579020751606ec8"},"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/constants.js":{"path":"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/constants.js","statementMap":{"0":{"start":{"line":6,"column":19},"end":{"line":6,"column":25}},"1":{"start":{"line":8,"column":25},"end":{"line":8,"column":42}},"2":{"start":{"line":10,"column":27},"end":{"line":10,"column":92}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1},"f":{},"b":{},"hash":"a89e43e2b22e8d69cb89355d5632b5cc8f69d8f5"},"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/read-coverage.js":{"path":"/Users/benjamincoe/bcoe/istanbul-lib-instrument/src/read-coverage.js","statementMap":{"0":{"start":{"line":7,"column":4},"end":{"line":9,"column":5}},"1":{"start":{"line":8,"column":8},"end":{"line":8,"column":49}},"2":{"start":{"line":12,"column":16},"end":{"line":18,"column":6}},"3":{"start":{"line":21,"column":4},"end":{"line":36,"column":7}},"4":{"start":{"line":23,"column":29},"end":{"line":23,"column":33}},"5":{"start":{"line":24,"column":12},"end":{"line":34,"column":13}},"6":{"start":{"line":28,"column":35},"end":{"line":28,"column":63}},"7":{"start":{"line":29,"column":16},"end":{"line":31,"column":17}},"8":{"start":{"line":30,"column":20},"end":{"line":30,"column":27}},"9":{"start":{"line":32,"column":16},"end":{"line":32,"column":58}},"10":{"start":{"line":33,"column":16},"end":{"line":33,"column":28}},"11":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},"12":{"start":{"line":39,"column":8},"end":{"line":39,"column":20}},"13":{"start":{"line":42,"column":19},"end":{"line":42,"column":21}},"14":{"start":{"line":44,"column":4},"end":{"line":55,"column":5}},"15":{"start":{"line":45,"column":24},"end":{"line":45,"column":51}},"16":{"start":{"line":46,"column":8},"end":{"line":48,"column":9}},"17":{"start":{"line":47,"column":12},"end":{"line":47,"column":24}},"18":{"start":{"line":49,"column":26},"end":{"line":49,"column":50}},"19":{"start":{"line":50,"column":22},"end":{"line":50,"column":42}},"20":{"start":{"line":51,"column":8},"end":{"line":53,"column":9}},"21":{"start":{"line":52,"column":12},"end":{"line":52,"column":24}},"22":{"start":{"line":54,"column":8},"end":{"line":54,"column":34}},"23":{"start":{"line":57,"column":4},"end":{"line":57,"column":42}},"24":{"start":{"line":59,"column":4},"end":{"line":59,"column":18}}},"fnMap":{"0":{"name":"readInitialCoverage","decl":{"start":{"line":6,"column":24},"end":{"line":6,"column":43}},"loc":{"start":{"line":6,"column":51},"end":{"line":60,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":22,"column":24},"end":{"line":22,"column":25}},"loc":{"start":{"line":22,"column":40},"end":{"line":35,"column":9}}}},"branchMap":{"0":{"loc":{"start":{"line":7,"column":4},"end":{"line":9,"column":5}},"type":"if","locations":[{"start":{"line":7,"column":4},"end":{"line":9,"column":5}},{"start":{"line":7,"column":4},"end":{"line":9,"column":5}}]},"1":{"loc":{"start":{"line":24,"column":12},"end":{"line":34,"column":13}},"type":"if","locations":[{"start":{"line":24,"column":12},"end":{"line":34,"column":13}},{"start":{"line":24,"column":12},"end":{"line":34,"column":13}}]},"2":{"loc":{"start":{"line":24,"column":16},"end":{"line":26,"column":43}},"type":"binary-expr","locations":[{"start":{"line":24,"column":16},"end":{"line":24,"column":30}},{"start":{"line":25,"column":16},"end":{"line":25,"column":40}},{"start":{"line":26,"column":16},"end":{"line":26,"column":43}}]},"3":{"loc":{"start":{"line":29,"column":16},"end":{"line":31,"column":17}},"type":"if","locations":[{"start":{"line":29,"column":16},"end":{"line":31,"column":17}},{"start":{"line":29,"column":16},"end":{"line":31,"column":17}}]},"4":{"loc":{"start":{"line":29,"column":20},"end":{"line":29,"column":77}},"type":"binary-expr","locations":[{"start":{"line":29,"column":20},"end":{"line":29,"column":41}},{"start":{"line":29,"column":45},"end":{"line":29,"column":77}}]},"5":{"loc":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},{"start":{"line":38,"column":4},"end":{"line":40,"column":5}}]},"6":{"loc":{"start":{"line":46,"column":8},"end":{"line":48,"column":9}},"type":"if","locations":[{"start":{"line":46,"column":8},"end":{"line":48,"column":9}},{"start":{"line":46,"column":8},"end":{"line":48,"column":9}}]},"7":{"loc":{"start":{"line":51,"column":8},"end":{"line":53,"column":9}},"type":"if","locations":[{"start":{"line":51,"column":8},"end":{"line":53,"column":9}},{"start":{"line":51,"column":8},"end":{"line":53,"column":9}}]}},"s":{"0":150,"1":0,"2":150,"3":150,"4":10028,"5":10028,"6":150,"7":150,"8":0,"9":150,"10":150,"11":150,"12":0,"13":150,"14":150,"15":600,"16":600,"17":0,"18":600,"19":600,"20":600,"21":0,"22":600,"23":150,"24":150},"f":{"0":150,"1":10028},"b":{"0":[0,150],"1":[150,9878],"2":[10028,10028,8444],"3":[0,150],"4":[150,150],"5":[0,150],"6":[0,600],"7":[0,600]},"hash":"a886dac5f16a53ac74ba10dbce70090b7d8e8eaa"}}
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/.nyc_output/90393c02039ac688911f97e2beef256f.json b/node_modules/istanbul-lib-instrument/.nyc_output/90393c02039ac688911f97e2beef256f.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/node_modules/istanbul-lib-instrument/.nyc_output/90393c02039ac688911f97e2beef256f.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/CHANGELOG.md b/node_modules/istanbul-lib-instrument/CHANGELOG.md new file mode 100644 index 000000000..ec35a89bb --- /dev/null +++ b/node_modules/istanbul-lib-instrument/CHANGELOG.md @@ -0,0 +1,71 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +<a name="1.2.0"></a> +# [1.2.0](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.1.4...v1.2.0) (2016-10-25) + + +### Features + +* implement function to extract empty coverage data from an instrumented file ([#28](https://github.com/istanbuljs/istanbul-lib-instrument/issues/28)) ([06d0ef6](https://github.com/istanbuljs/istanbul-lib-instrument/commit/06d0ef6)) + + + +<a name="1.1.4"></a> +## [1.1.4](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.1.3...v1.1.4) (2016-10-17) + + +### Bug Fixes + +* hoist coverage variable to very top of file ([#26](https://github.com/istanbuljs/istanbul-lib-instrument/issues/26)) ([0225e8c](https://github.com/istanbuljs/istanbul-lib-instrument/commit/0225e8c)) + + + +<a name="1.1.3"></a> +## [1.1.3](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.1.2...v1.1.3) (2016-09-13) + + +### Performance Improvements + +* simplify coverage variable naming https://github.com/istanbuljs/istanbul-lib-instrument/pull/24 ([7252aae](https://github.com/istanbuljs/istanbul-lib-instrument/commit/7252aae)) + + + +<a name="1.1.2"></a> +## [1.1.2](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.1.1...v1.1.2) (2016-09-08) + + +### Performance Improvements + +* use zero-based numeric indices for much faster instrumented code ([#22](https://github.com/istanbuljs/istanbul-lib-instrument/issues/22)) ([5b401f5](https://github.com/istanbuljs/istanbul-lib-instrument/commit/5b401f5)) + + + +<a name="1.1.1"></a> +## [1.1.1](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.1.0...v1.1.1) (2016-08-30) + + +### Bug Fixes + +* upgrade istanbul-lib-coverage ([eb9b1f6](https://github.com/istanbuljs/istanbul-lib-instrument/commit/eb9b1f6)) + + + +<a name="1.1.0"></a> +# [1.1.0](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.1.0-alpha.4...v1.1.0) (2016-08-11) + + +### Bug Fixes + +* guard against invalid loc ([#16](https://github.com/istanbuljs/istanbul-lib-instrument/issues/16)) ([23ebfc3](https://github.com/istanbuljs/istanbul-lib-instrument/commit/23ebfc3)) + + + +<a name="1.1.0-alpha.4"></a> +# [1.1.0-alpha.4](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.0.0-alpha.5...v1.1.0-alpha.4) (2016-07-20) + + +### Bug Fixes + +* require more performant babel-generator ([#15](https://github.com/istanbuljs/istanbul-lib-instrument/issues/15)) ([21b2563](https://github.com/istanbuljs/istanbul-lib-instrument/commit/21b2563)) diff --git a/node_modules/istanbul-lib-instrument/LICENSE b/node_modules/istanbul-lib-instrument/LICENSE new file mode 100644 index 000000000..d55d2916e --- /dev/null +++ b/node_modules/istanbul-lib-instrument/LICENSE @@ -0,0 +1,24 @@ +Copyright 2012-2015 Yahoo! Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Yahoo! Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/istanbul-lib-instrument/README.md b/node_modules/istanbul-lib-instrument/README.md new file mode 100644 index 000000000..c98dc25cb --- /dev/null +++ b/node_modules/istanbul-lib-instrument/README.md @@ -0,0 +1,24 @@ +istanbul-lib-instrument +----------------------- + +[](https://travis-ci.org/istanbuljs/istanbul-lib-instrument) + +Istanbul instrumenter library. + +Version 1.1.x now implements instrumentation using `Babel`. The implementation is inspired +by prior art by @dtinth as demonstrated in the `__coverage__` babel plugin. + +It provides 2 "modes" of instrumentation. + +* The old API that is mostly unchanged (except for incompatibilities noted) and + performs the instrumentation using babel as a library. + +* A `programVisitor` function for the Babel AST that can be used by a Babel plugin + to emit instrumentation for ES6 code directly without any source map + processing. This is the preferred path for babel users. The Babel plugin is + called `babel-plugin-istanbul`. + +Incompatibilities and changes to instrumentation behavior can be found in +[v0-changes.md](v0-changes.md). + + diff --git a/node_modules/istanbul-lib-instrument/dist/constants.js b/node_modules/istanbul-lib-instrument/dist/constants.js new file mode 100644 index 000000000..9ab743249 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/dist/constants.js @@ -0,0 +1,19 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.MAGIC_VALUE = exports.MAGIC_KEY = exports.SHA = undefined; + +var _semver = require('semver'); + +var _package = require('../package.json'); + +var _crypto = require('crypto'); + +// function to use for creating hashes +var SHA = exports.SHA = 'sha1'; +// name of coverage data magic key +var MAGIC_KEY = exports.MAGIC_KEY = '_coverageSchema'; +// name of coverage data magic value +var MAGIC_VALUE = exports.MAGIC_VALUE = (0, _crypto.createHash)(SHA).update(_package.name + '@' + (0, _semver.major)(_package.version)).digest('hex');
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/dist/index.js b/node_modules/istanbul-lib-instrument/dist/index.js new file mode 100644 index 000000000..4a5a979f0 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/dist/index.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.readInitialCoverage = exports.programVisitor = exports.createInstrumenter = undefined; + +var _instrumenter = require('./instrumenter'); + +var _instrumenter2 = _interopRequireDefault(_instrumenter); + +var _visitor = require('./visitor'); + +var _visitor2 = _interopRequireDefault(_visitor); + +var _readCoverage = require('./read-coverage'); + +var _readCoverage2 = _interopRequireDefault(_readCoverage); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * createInstrumenter creates a new instrumenter with the + * supplied options. + * @param {Object} opts - instrumenter options. See the documentation + * for the Instrumenter class. + */ +function createInstrumenter(opts) { + return new _instrumenter2.default(opts); +} + +exports.createInstrumenter = createInstrumenter; +exports.programVisitor = _visitor2.default; +exports.readInitialCoverage = _readCoverage2.default;
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/dist/instrumenter.js b/node_modules/istanbul-lib-instrument/dist/instrumenter.js new file mode 100644 index 000000000..1307bfd8a --- /dev/null +++ b/node_modules/istanbul-lib-instrument/dist/instrumenter.js @@ -0,0 +1,199 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + + +var _babylon = require('babylon'); + +var babylon = _interopRequireWildcard(_babylon); + +var _babelTypes = require('babel-types'); + +var t = _interopRequireWildcard(_babelTypes); + +var _babelTraverse = require('babel-traverse'); + +var _babelTraverse2 = _interopRequireDefault(_babelTraverse); + +var _babelGenerator = require('babel-generator'); + +var _babelGenerator2 = _interopRequireDefault(_babelGenerator); + +var _visitor = require('./visitor'); + +var _visitor2 = _interopRequireDefault(_visitor); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function defaultOpts() { + return { + coverageVariable: "__coverage__", + preserveComments: false, + compact: true, + esModules: false, + autoWrap: false, + produceSourceMap: false, + sourceMapUrlCallback: null, + debug: false + }; +} +/** + * Instrumenter is the public API for the instrument library. + * It is typically used for ES5 code. For ES6 code that you + * are already running under `babel` use the coverage plugin + * instead. + * @param {Object} opts optional. + * @param {string} [opts.coverageVariable=__coverage__] name of global coverage variable. + * @param {boolean} [opts.preserveComments=false] preserve comments in output + * @param {boolean} [opts.compact=true] generate compact code. + * @param {boolean} [opts.esModules=false] set to true to instrument ES6 modules. + * @param {boolean} [opts.autoWrap=false] set to true to allow `return` statements outside of functions. + * @param {boolean} [opts.produceSourceMap=false] set to true to produce a source map for the instrumented code. + * @param {Function} [opts.sourceMapUrlCallback=null] a callback function that is called when a source map URL + * is found in the original code. This function is called with the source file name and the source map URL. + * @param {boolean} [opts.debug=false] - turn debugging on + */ + +var Instrumenter = function () { + function Instrumenter() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOpts(); + + _classCallCheck(this, Instrumenter); + + this.opts = this.normalizeOpts(opts); + this.fileCoverage = null; + this.sourceMap = null; + } + /** + * normalize options passed in and assign defaults. + * @param opts + * @private + */ + + + _createClass(Instrumenter, [{ + key: 'normalizeOpts', + value: function normalizeOpts(opts) { + var normalize = function normalize(name, defaultValue) { + if (!opts.hasOwnProperty(name)) { + opts[name] = defaultValue; + } + }; + var defOpts = defaultOpts(); + Object.keys(defOpts).forEach(function (k) { + normalize(k, defOpts[k]); + }); + return opts; + } + /** + * instrument the supplied code and track coverage against the supplied + * filename. It throws if invalid code is passed to it. ES5 and ES6 syntax + * is supported. To instrument ES6 modules, make sure that you set the + * `esModules` property to `true` when creating the instrumenter. + * + * @param {string} code - the code to instrument + * @param {string} filename - the filename against which to track coverage. + * @returns {string} the instrumented code. + */ + + }, { + key: 'instrumentSync', + value: function instrumentSync(code, filename) { + if (typeof code !== 'string') { + throw new Error('Code must be a string'); + } + filename = filename || String(new Date().getTime()) + '.js'; + var opts = this.opts; + var ast = babylon.parse(code, { + allowReturnOutsideFunction: opts.autoWrap, + sourceType: opts.esModules ? "module" : "script" + }); + var ee = (0, _visitor2.default)(t, filename, { + coverageVariable: opts.coverageVariable + }); + var output = {}; + var visitor = { + Program: { + enter: ee.enter, + exit: function exit(path) { + output = ee.exit(path); + } + } + }; + (0, _babelTraverse2.default)(ast, visitor); + + var generateOptions = { + compact: opts.compact, + sourceMaps: opts.produceSourceMap, + sourceFileName: filename + }; + var codeMap = (0, _babelGenerator2.default)(ast, generateOptions, code); + this.fileCoverage = output.fileCoverage; + this.sourceMap = codeMap.map; + var cb = this.opts.sourceMapUrlCallback; + if (cb && output.sourceMappingURL) { + cb(filename, output.sourceMappingURL); + } + return codeMap.code; + } + /** + * callback-style instrument method that calls back with an error + * as opposed to throwing one. Note that in the current implementation, + * the callback will be called in the same process tick and is not asynchronous. + * + * @param {string} code - the code to instrument + * @param {string} filename - the filename against which to track coverage. + * @param {Function} callback - the callback + */ + + }, { + key: 'instrument', + value: function instrument(code, filename, callback) { + if (!callback && typeof filename === 'function') { + callback = filename; + filename = null; + } + try { + var out = this.instrumentSync(code, filename); + callback(null, out); + } catch (ex) { + callback(ex); + } + } + /** + * returns the file coverage object for the last file instrumented. + * @returns {Object} the file coverage object. + */ + + }, { + key: 'lastFileCoverage', + value: function lastFileCoverage() { + return this.fileCoverage; + } + /** + * returns the source map produced for the last file instrumented. + * @returns {null|Object} the source map object. + */ + + }, { + key: 'lastSourceMap', + value: function lastSourceMap() { + return this.sourceMap; + } + }]); + + return Instrumenter; +}(); + +exports.default = Instrumenter;
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/dist/read-coverage.js b/node_modules/istanbul-lib-instrument/dist/read-coverage.js new file mode 100644 index 000000000..73e74291a --- /dev/null +++ b/node_modules/istanbul-lib-instrument/dist/read-coverage.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = readInitialCoverage; + +var _constants = require('./constants'); + +var _babylon = require('babylon'); + +var _babelTraverse = require('babel-traverse'); + +var _babelTraverse2 = _interopRequireDefault(_babelTraverse); + +var _babelTypes = require('babel-types'); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function readInitialCoverage(code) { + if (typeof code !== 'string') { + throw new Error('Code must be a string'); + } + + // Parse as leniently as possible + var ast = (0, _babylon.parse)(code, { + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true, + sourceType: "script", // I think ? + plugins: ["*"] + }); + + var covScope = void 0; + (0, _babelTraverse2.default)(ast, { + ObjectProperty: function ObjectProperty(path) { + var node = path.node; + + if (!node.computed && t.isIdentifier(node.key) && node.key.name === _constants.MAGIC_KEY) { + var magicValue = path.get('value').evaluate(); + if (!magicValue.confident || magicValue.value !== _constants.MAGIC_VALUE) { + return; + } + covScope = path.scope.getFunctionParent(); + path.stop(); + } + } + }); + + if (!covScope) { + return null; + } + + var result = {}; + + var _arr = ['path', 'hash', 'gcv', 'coverageData']; + for (var _i = 0; _i < _arr.length; _i++) { + var key = _arr[_i]; + var binding = covScope.getOwnBinding(key); + if (!binding) { + return null; + } + var valuePath = binding.path.get('init'); + var value = valuePath.evaluate(); + if (!value.confident) { + return null; + } + result[key] = value.value; + } + + delete result.coverageData[_constants.MAGIC_KEY]; + + return result; +}
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/dist/source-coverage.js b/node_modules/istanbul-lib-instrument/dist/source-coverage.js new file mode 100644 index 000000000..eac98f551 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/dist/source-coverage.js @@ -0,0 +1,127 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SourceCoverage = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _istanbulLibCoverage = require('istanbul-lib-coverage'); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function cloneLocation(loc) { + return { + start: { + line: loc && loc.start.line, + column: loc && loc.start.column + }, + end: { + line: loc && loc.end.line, + column: loc && loc.end.column + } + }; +} +/** + * SourceCoverage provides mutation methods to manipulate the structure of + * a file coverage object. Used by the instrumenter to create a full coverage + * object for a file incrementally. + * + * @private + * @param pathOrObj {String|Object} - see the argument for {@link FileCoverage} + * @extends FileCoverage + * @constructor + */ + +var SourceCoverage = function (_classes$FileCoverage) { + _inherits(SourceCoverage, _classes$FileCoverage); + + function SourceCoverage(pathOrObj) { + _classCallCheck(this, SourceCoverage); + + var _this = _possibleConstructorReturn(this, (SourceCoverage.__proto__ || Object.getPrototypeOf(SourceCoverage)).call(this, pathOrObj)); + + _this.meta = { + last: { + s: 0, + f: 0, + b: 0 + } + }; + return _this; + } + + _createClass(SourceCoverage, [{ + key: 'newStatement', + value: function newStatement(loc) { + var s = this.meta.last.s; + this.data.statementMap[s] = cloneLocation(loc); + this.data.s[s] = 0; + this.meta.last.s += 1; + return s; + } + }, { + key: 'newFunction', + value: function newFunction(name, decl, loc) { + var f = this.meta.last.f; + name = name || '(anonymous_' + f + ')'; + this.data.fnMap[f] = { + name: name, + decl: cloneLocation(decl), + loc: cloneLocation(loc) + }; + this.data.f[f] = 0; + this.meta.last.f += 1; + return f; + } + }, { + key: 'newBranch', + value: function newBranch(type, loc) { + var b = this.meta.last.b; + this.data.b[b] = []; + this.data.branchMap[b] = { + loc: cloneLocation(loc), + type: type, + locations: [] + }; + this.meta.last.b += 1; + return b; + } + }, { + key: 'addBranchPath', + value: function addBranchPath(name, location) { + var bMeta = this.data.branchMap[name], + counts = this.data.b[name]; + + /* istanbul ignore if: paranoid check */ + if (!bMeta) { + throw new Error("Invalid branch " + name); + } + bMeta.locations.push(cloneLocation(location)); + counts.push(0); + return counts.length - 1; + } + }, { + key: 'freeze', + value: function freeze() { + // prune empty branches + var map = this.data.branchMap, + branches = this.data.b; + Object.keys(map).forEach(function (b) { + if (map[b].locations.length === 0) { + delete map[b]; + delete branches[b]; + } + }); + } + }]); + + return SourceCoverage; +}(_istanbulLibCoverage.classes.FileCoverage); + +exports.SourceCoverage = SourceCoverage;
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/dist/visitor.js b/node_modules/istanbul-lib-instrument/dist/visitor.js new file mode 100644 index 000000000..55a616848 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/dist/visitor.js @@ -0,0 +1,522 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _sourceCoverage = require('./source-coverage'); + +var _constants = require('./constants'); + +var _crypto = require('crypto'); + +var _babelTemplate = require('babel-template'); + +var _babelTemplate2 = _interopRequireDefault(_babelTemplate); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// istanbul ignore comment pattern +var COMMENT_RE = /^\s*istanbul\s+ignore\s+(if|else|next)(?=\W|$)/; +// source map URL pattern +var SOURCE_MAP_RE = /[#@]\s*sourceMappingURL=(.*)\s*$/m; + +// generate a variable name from hashing the supplied file path +function genVar(filename) { + var hash = (0, _crypto.createHash)(_constants.SHA); + hash.update(filename); + return 'cov_' + parseInt(hash.digest('hex').substr(0, 12), 16).toString(36); +} + +// VisitState holds the state of the visitor, provides helper functions +// and is the `this` for the individual coverage visitors. + +var VisitState = function () { + function VisitState(types, sourceFilePath) { + _classCallCheck(this, VisitState); + + this.varName = genVar(sourceFilePath); + this.attrs = {}; + this.nextIgnore = null; + this.cov = new _sourceCoverage.SourceCoverage(sourceFilePath); + this.types = types; + this.sourceMappingURL = null; + } + + // should we ignore the node? Yes, if specifically ignoring + // or if the node is generated. + + + _createClass(VisitState, [{ + key: 'shouldIgnore', + value: function shouldIgnore(path) { + return this.nextIgnore || !path.node.loc; + } + + // extract the ignore comment hint (next|if|else) or null + + }, { + key: 'hintFor', + value: function hintFor(node) { + var hint = null; + if (node.leadingComments) { + node.leadingComments.forEach(function (c) { + var v = (c.value || /* istanbul ignore next: paranoid check */"").trim(); + var groups = v.match(COMMENT_RE); + if (groups) { + hint = groups[1]; + } + }); + } + return hint; + } + + // extract a source map URL from comments and keep track of it + + }, { + key: 'maybeAssignSourceMapURL', + value: function maybeAssignSourceMapURL(node) { + var that = this; + var extractURL = function extractURL(comments) { + if (!comments) { + return; + } + comments.forEach(function (c) { + var v = (c.value || /* istanbul ignore next: paranoid check */"").trim(); + var groups = v.match(SOURCE_MAP_RE); + if (groups) { + that.sourceMappingURL = groups[1]; + } + }); + }; + extractURL(node.leadingComments); + extractURL(node.trailingComments); + } + + // all the generic stuff that needs to be done on enter for every node + + }, { + key: 'onEnter', + value: function onEnter(path) { + var n = path.node; + + this.maybeAssignSourceMapURL(n); + + // if already ignoring, nothing more to do + if (this.nextIgnore !== null) { + return; + } + // check hint to see if ignore should be turned on + var hint = this.hintFor(n); + if (hint === 'next') { + this.nextIgnore = n; + return; + } + // else check custom node attribute set by a prior visitor + if (this.getAttr(path.node, 'skip-all') !== null) { + this.nextIgnore = n; + } + } + + // all the generic stuff on exit of a node, + // including reseting ignores and custom node attrs + + }, { + key: 'onExit', + value: function onExit(path) { + // restore ignore status, if needed + if (path.node === this.nextIgnore) { + this.nextIgnore = null; + } + // nuke all attributes for the node + delete path.node.__cov__; + } + + // set a node attribute for the supplied node + + }, { + key: 'setAttr', + value: function setAttr(node, name, value) { + node.__cov__ = node.__cov__ || {}; + node.__cov__[name] = value; + } + + // retrieve a node attribute for the supplied node or null + + }, { + key: 'getAttr', + value: function getAttr(node, name) { + var c = node.__cov__; + if (!c) { + return null; + } + return c[name]; + } + + // + + }, { + key: 'increase', + value: function increase(type, id, index) { + var T = this.types; + var wrap = index !== null + // If `index` present, turn `x` into `x[index]`. + ? function (x) { + return T.memberExpression(x, T.numericLiteral(index), true); + } : function (x) { + return x; + }; + return T.unaryExpression('++', wrap(T.memberExpression(T.memberExpression(T.identifier(this.varName), T.identifier(type)), T.numericLiteral(id), true))); + } + }, { + key: 'insertCounter', + value: function insertCounter(path, increment) { + var T = this.types; + if (path.isBlockStatement()) { + path.node.body.unshift(T.expressionStatement(increment)); + } else if (path.isStatement()) { + path.insertBefore(T.expressionStatement(increment)); + } else /* istanbul ignore else: not expected */if (path.isExpression()) { + path.replaceWith(T.sequenceExpression([increment, path.node])); + } else { + console.error('Unable to insert counter for node type:', path.node.type); + } + } + }, { + key: 'insertStatementCounter', + value: function insertStatementCounter(path) { + /* istanbul ignore if: paranoid check */ + if (!(path.node && path.node.loc)) { + return; + } + var index = this.cov.newStatement(path.node.loc); + var increment = this.increase('s', index, null); + this.insertCounter(path, increment); + } + }, { + key: 'insertFunctionCounter', + value: function insertFunctionCounter(path) { + var T = this.types; + /* istanbul ignore if: paranoid check */ + if (!(path.node && path.node.loc)) { + return; + } + var n = path.node; + var dloc = null; + // get location for declaration + switch (n.type) { + case "FunctionDeclaration": + /* istanbul ignore else: paranoid check */ + if (n.id) { + dloc = n.id.loc; + } + break; + case "FunctionExpression": + if (n.id) { + dloc = n.id.loc; + } + break; + } + if (!dloc) { + dloc = { + start: n.loc.start, + end: { line: n.loc.start.line, column: n.loc.start.column + 1 } + }; + } + var name = path.node.id ? path.node.id.name : path.node.name; + var index = this.cov.newFunction(name, dloc, path.node.body.loc); + var increment = this.increase('f', index, null); + var body = path.get('body'); + /* istanbul ignore else: not expected */ + if (body.isBlockStatement()) { + body.node.body.unshift(T.expressionStatement(increment)); + } else { + console.error('Unable to process function body node type:', path.node.type); + } + } + }, { + key: 'getBranchIncrement', + value: function getBranchIncrement(branchName, loc) { + var index = this.cov.addBranchPath(branchName, loc); + return this.increase('b', branchName, index); + } + }, { + key: 'insertBranchCounter', + value: function insertBranchCounter(path, branchName, loc) { + var increment = this.getBranchIncrement(branchName, loc || path.node.loc); + this.insertCounter(path, increment); + } + }, { + key: 'findLeaves', + value: function findLeaves(node, accumulator, parent, property) { + if (!node) { + return; + } + if (node.type === "LogicalExpression") { + var hint = this.hintFor(node); + if (hint !== 'next') { + this.findLeaves(node.left, accumulator, node, 'left'); + this.findLeaves(node.right, accumulator, node, 'right'); + } + } else { + accumulator.push({ + node: node, + parent: parent, + property: property + }); + } + } + }]); + + return VisitState; +}(); + +// generic function that takes a set of visitor methods and +// returns a visitor object with `enter` and `exit` properties, +// such that: +// +// * standard entry processing is done +// * the supplied visitors are called only when ignore is not in effect +// This relieves them from worrying about ignore states and generated nodes. +// * standard exit processing is done +// + + +function entries() { + var enter = Array.prototype.slice.call(arguments); + // the enter function + var wrappedEntry = function wrappedEntry(path, node) { + this.onEnter(path); + if (this.shouldIgnore(path)) { + return; + } + var that = this; + enter.forEach(function (e) { + e.call(that, path, node); + }); + }; + var exit = function exit(path, node) { + this.onExit(path, node); + }; + return { + enter: wrappedEntry, + exit: exit + }; +} + +function coverStatement(path) { + this.insertStatementCounter(path); +} + +/* istanbul ignore next: no node.js support */ +function coverAssignmentPattern(path) { + var n = path.node; + var b = this.cov.newBranch('default-arg', n.loc); + this.insertBranchCounter(path.get('right'), b); +} + +function coverFunction(path) { + this.insertFunctionCounter(path); +} + +function coverVariableDeclarator(path) { + this.insertStatementCounter(path.get('init')); +} + +function skipInit(path) { + if (path.node.init) { + this.setAttr(path.node.init, 'skip-all', true); + } +} + +function makeBlock(path) { + var T = this.types; + if (!path.node) { + path.replaceWith(T.blockStatement([])); + } + if (!path.isBlockStatement()) { + path.replaceWith(T.blockStatement([path.node])); + path.node.loc = path.node.body[0].loc; + } +} + +function blockProp(prop) { + return function (path) { + makeBlock.call(this, path.get(prop)); + }; +} + +function convertArrowExpression(path) { + var n = path.node; + var T = this.types; + if (n.expression) { + var bloc = n.body.loc; + n.expression = false; + n.body = T.blockStatement([T.returnStatement(n.body)]); + // restore body location + n.body.loc = bloc; + // set up the location for the return statement so it gets + // instrumented + n.body.body[0].loc = bloc; + } +} + +function coverIfBranches(path) { + var n = path.node, + hint = this.hintFor(n), + ignoreIf = hint === 'if', + ignoreElse = hint === 'else', + branch = this.cov.newBranch('if', n.loc); + + if (ignoreIf) { + this.setAttr(n.consequent, 'skip-all', true); + } else { + this.insertBranchCounter(path.get('consequent'), branch, n.loc); + } + if (ignoreElse) { + this.setAttr(n.alternate, 'skip-all', true); + } else { + this.insertBranchCounter(path.get('alternate'), branch, n.loc); + } +} + +function createSwitchBranch(path) { + var b = this.cov.newBranch('switch', path.node.loc); + this.setAttr(path.node, 'branchName', b); +} + +function coverSwitchCase(path) { + var T = this.types; + var b = this.getAttr(path.parentPath.node, 'branchName'); + /* istanbul ignore if: paranoid check */ + if (b === null) { + throw new Error('Unable to get switch branch name'); + } + var increment = this.getBranchIncrement(b, path.node.loc); + path.node.consequent.unshift(T.expressionStatement(increment)); +} + +function coverTernary(path) { + var n = path.node, + branch = this.cov.newBranch('cond-expr', path.node.loc), + cHint = this.hintFor(n.consequent), + aHint = this.hintFor(n.alternate); + + if (cHint !== 'next') { + this.insertBranchCounter(path.get('consequent'), branch); + } + if (aHint !== 'next') { + this.insertBranchCounter(path.get('alternate'), branch); + } +} + +function coverLogicalExpression(path) { + var T = this.types; + if (path.parentPath.node.type === "LogicalExpression") { + return; // already processed + } + var leaves = []; + this.findLeaves(path.node, leaves); + var b = this.cov.newBranch("binary-expr", path.node.loc); + for (var i = 0; i < leaves.length; i += 1) { + var leaf = leaves[i]; + var hint = this.hintFor(leaf.node); + if (hint === 'next') { + continue; + } + var increment = this.getBranchIncrement(b, leaf.node.loc); + if (!increment) { + continue; + } + leaf.parent[leaf.property] = T.sequenceExpression([increment, leaf.node]); + } +} + +var codeVisitor = { + ArrowFunctionExpression: entries(convertArrowExpression, coverFunction), + AssignmentPattern: entries(coverAssignmentPattern), + BlockStatement: entries(), // ignore processing only + ClassMethod: entries(coverFunction), + ExpressionStatement: entries(coverStatement), + BreakStatement: entries(coverStatement), + ContinueStatement: entries(coverStatement), + DebuggerStatement: entries(coverStatement), + ReturnStatement: entries(coverStatement), + ThrowStatement: entries(coverStatement), + TryStatement: entries(coverStatement), + VariableDeclaration: entries(), // ignore processing only + VariableDeclarator: entries(coverVariableDeclarator), + IfStatement: entries(blockProp('consequent'), blockProp('alternate'), coverStatement, coverIfBranches), + ForStatement: entries(blockProp('body'), skipInit, coverStatement), + ForInStatement: entries(blockProp('body'), skipInit, coverStatement), + ForOfStatement: entries(blockProp('body'), skipInit, coverStatement), + WhileStatement: entries(blockProp('body'), coverStatement), + DoWhileStatement: entries(blockProp('body'), coverStatement), + SwitchStatement: entries(createSwitchBranch, coverStatement), + SwitchCase: entries(coverSwitchCase), + WithStatement: entries(blockProp('body'), coverStatement), + FunctionDeclaration: entries(coverFunction), + FunctionExpression: entries(coverFunction), + LabeledStatement: entries(coverStatement), + ConditionalExpression: entries(coverTernary), + LogicalExpression: entries(coverLogicalExpression) +}; +// the template to insert at the top of the program. +var coverageTemplate = (0, _babelTemplate2.default)('\n var COVERAGE_VAR = (function () {\n var path = PATH,\n hash = HASH,\n global = (new Function(\'return this\'))(),\n gcv = GLOBAL_COVERAGE_VAR,\n coverageData = INITIAL,\n coverage = global[gcv] || (global[gcv] = {});\n if (coverage[path] && coverage[path].hash === hash) {\n return coverage[path];\n }\n coverageData.hash = hash;\n return coverage[path] = coverageData;\n })();\n'); +/** + * programVisitor is a `babel` adaptor for instrumentation. + * It returns an object with two methods `enter` and `exit`. + * These should be assigned to or called from `Program` entry and exit functions + * in a babel visitor. + * These functions do not make assumptions about the state set by Babel and thus + * can be used in a context other than a Babel plugin. + * + * The exit function returns an object that currently has the following keys: + * + * `fileCoverage` - the file coverage object created for the source file. + * `sourceMappingURL` - any source mapping URL found when processing the file. + * + * @param {Object} types - an instance of babel-types + * @param {string} sourceFilePath - the path to source file + * @param {Object} opts - additional options + * @param {string} [opts.coverageVariable=__coverage__] the global coverage variable name. + */ +function programVisitor(types) { + var sourceFilePath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'unknown.js'; + var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { coverageVariable: '__coverage__' }; + + var T = types; + var visitState = new VisitState(types, sourceFilePath); + return { + enter: function enter(path) { + path.traverse(codeVisitor, visitState); + }, + exit: function exit(path) { + visitState.cov.freeze(); + var coverageData = visitState.cov.toJSON(); + coverageData[_constants.MAGIC_KEY] = _constants.MAGIC_VALUE; + var hash = (0, _crypto.createHash)(_constants.SHA).update(JSON.stringify(coverageData)).digest('hex'); + var coverageNode = T.valueToNode(coverageData); + delete coverageData[_constants.MAGIC_KEY]; + var cv = coverageTemplate({ + GLOBAL_COVERAGE_VAR: T.stringLiteral(opts.coverageVariable), + COVERAGE_VAR: T.identifier(visitState.varName), + PATH: T.stringLiteral(sourceFilePath), + INITIAL: coverageNode, + HASH: T.stringLiteral(hash) + }); + cv._blockHoist = 3; + path.node.body.unshift(cv); + return { + fileCoverage: coverageData, + sourceMappingURL: visitState.sourceMappingURL + }; + } + }; +} + +exports.default = programVisitor;
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/node_modules/.bin/babylon b/node_modules/istanbul-lib-instrument/node_modules/.bin/babylon new file mode 120000 index 000000000..7ceac0182 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/.bin/babylon @@ -0,0 +1 @@ +../../../babylon/bin/babylon.js
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/node_modules/.bin/semver b/node_modules/istanbul-lib-instrument/node_modules/.bin/semver new file mode 120000 index 000000000..58b26795f --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/.bin/semver @@ -0,0 +1 @@ +../../../normalize-package-data/node_modules/semver/bin/semver
\ No newline at end of file diff --git a/node_modules/istanbul-lib-instrument/node_modules/semver/LICENSE b/node_modules/istanbul-lib-instrument/node_modules/semver/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/istanbul-lib-instrument/node_modules/semver/README.md b/node_modules/istanbul-lib-instrument/node_modules/semver/README.md new file mode 100644 index 000000000..cbd956549 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/semver/README.md @@ -0,0 +1,350 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Usage + + $ npm install semver + $ node + var semver = require('semver') + + semver.valid('1.2.3') // '1.2.3' + semver.valid('a.b.c') // null + semver.clean(' =v1.2.3 ') // '1.2.3' + semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true + semver.gt('1.2.3', '9.8.7') // false + semver.lt('1.2.3', '9.8.7') // true + +As a command-line utility: + + $ semver -h + + SemVer 5.1.0 + + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] <version> [<version> [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range <range> + Print versions that match the specified range. + + -i --increment [<level>] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid <identifier> + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely + + Program exits successfully if any valid version satisfies + all supplied ranges, and prints all satisfying versions. + + If no satisfying versions are found, then exits failure. + + Versions are printed in ascending order, so supplying + multiple versions to the utility will just sort them. + +## Versions + +A "version" is described by the `v2.0.0` specification found at +<http://semver.org/>. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +> semver.inc('1.2.3', 'prerelease', 'beta') +'1.2.4-beta.0' +``` + +command-line example: + +```shell +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```shell +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `loose` boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. diff --git a/node_modules/istanbul-lib-instrument/node_modules/semver/bin/semver b/node_modules/istanbul-lib-instrument/node_modules/semver/bin/semver new file mode 100755 index 000000000..c5f2e857e --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/semver/bin/semver @@ -0,0 +1,133 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + , versions = [] + , range = [] + , gt = [] + , lt = [] + , eq = [] + , inc = null + , version = require("../package.json").version + , loose = false + , identifier = undefined + , semver = require("../semver") + , reverse = false + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var i = a.indexOf('=') + if (i !== -1) { + a = a.slice(0, i) + argv.unshift(a.slice(i + 1)) + } + switch (a) { + case "-rv": case "-rev": case "--rev": case "--reverse": + reverse = true + break + case "-l": case "--loose": + loose = true + break + case "-v": case "--version": + versions.push(argv.shift()) + break + case "-i": case "--inc": case "--increment": + switch (argv[0]) { + case "major": case "minor": case "patch": case "prerelease": + case "premajor": case "preminor": case "prepatch": + inc = argv.shift() + break + default: + inc = "patch" + break + } + break + case "--preid": + identifier = argv.shift() + break + case "-r": case "--range": + range.push(argv.shift()) + break + case "-h": case "--help": case "-?": + return help() + default: + versions.push(a) + break + } + } + + versions = versions.filter(function (v) { + return semver.valid(v, loose) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) + return failInc() + + for (var i = 0, l = range.length; i < l ; i ++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], loose) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error("--inc can only be used on a single version with no range") + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? "rcompare" : "compare" + versions.sort(function (a, b) { + return semver[compare](a, b, loose) + }).map(function (v) { + return semver.clean(v, loose) + }).map(function (v) { + return inc ? semver.inc(v, inc, loose, identifier) : v + }).forEach(function (v,i,_) { console.log(v) }) +} + +function help () { + console.log(["SemVer " + version + ,"" + ,"A JavaScript implementation of the http://semver.org/ specification" + ,"Copyright Isaac Z. Schlueter" + ,"" + ,"Usage: semver [options] <version> [<version> [...]]" + ,"Prints valid versions sorted by SemVer precedence" + ,"" + ,"Options:" + ,"-r --range <range>" + ," Print versions that match the specified range." + ,"" + ,"-i --increment [<level>]" + ," Increment a version by the specified level. Level can" + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." + ," Only one version may be specified." + ,"" + ,"--preid <identifier>" + ," Identifier to be used to prefix premajor, preminor," + ," prepatch or prerelease version increments." + ,"" + ,"-l --loose" + ," Interpret versions and ranges loosely" + ,"" + ,"Program exits successfully if any valid version satisfies" + ,"all supplied ranges, and prints all satisfying versions." + ,"" + ,"If no satisfying versions are found, then exits failure." + ,"" + ,"Versions are printed in ascending order, so supplying" + ,"multiple versions to the utility will just sort them." + ].join("\n")) +} diff --git a/node_modules/istanbul-lib-instrument/node_modules/semver/package.json b/node_modules/istanbul-lib-instrument/node_modules/semver/package.json new file mode 100644 index 000000000..ec9b01643 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/semver/package.json @@ -0,0 +1,22 @@ +{ + "name": "semver", + "version": "5.3.0", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap test/*.js" + }, + "devDependencies": { + "tap": "^2.0.0" + }, + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "./bin/semver" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ] +} diff --git a/node_modules/istanbul-lib-instrument/node_modules/semver/range.bnf b/node_modules/istanbul-lib-instrument/node_modules/semver/range.bnf new file mode 100644 index 000000000..25ebd5c83 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/istanbul-lib-instrument/node_modules/semver/semver.js b/node_modules/istanbul-lib-instrument/node_modules/semver/semver.js new file mode 100644 index 000000000..5f1a3c5c9 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/node_modules/semver/semver.js @@ -0,0 +1,1203 @@ +exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +var MAX_LENGTH = 256; +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + if (version instanceof SemVer) + return version; + + if (typeof version !== 'string') + return null; + + if (version.length > MAX_LENGTH) + return null; + + var r = loose ? re[LOOSE] : re[FULL]; + if (!r.test(version)) + return null; + + try { + return new SemVer(version, loose); + } catch (er) { + return null; + } +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (version.length > MAX_LENGTH) + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) + throw new TypeError('Invalid major version') + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) + throw new TypeError('Invalid minor version') + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) + throw new TypeError('Invalid patch version') + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + if (/^[0-9]+$/.test(id)) { + var num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) + return num; + } + return id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + this.raw = this.version; + return this; +}; + +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} + +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.major = major; +function major(a, loose) { + return new SemVer(a, loose).major; +} + +exports.minor = minor; +function minor(a, loose) { + return new SemVer(a, loose).minor; +} + +exports.patch = patch; +function patch(a, loose) { + return new SemVer(a, loose).patch; +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; + + debug('comp', this); +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + + debug('tilde return', ret); + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + debug('caret', comp, loose); + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + debug('replaceCaret pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + + debug('caret return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<'; + if (xm) + M = +M + 1; + else + m = +m + 1; + } + + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } + + debug('xRange return', ret); + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + continue; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.minSatisfying = minSatisfying; +function minSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return compare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +exports.prerelease = prerelease; +function prerelease(version, loose) { + var parsed = parse(version, loose); + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; +} diff --git a/node_modules/istanbul-lib-instrument/package.json b/node_modules/istanbul-lib-instrument/package.json new file mode 100644 index 000000000..12800b885 --- /dev/null +++ b/node_modules/istanbul-lib-instrument/package.json @@ -0,0 +1,66 @@ +{ + "name": "istanbul-lib-instrument", + "version": "1.2.0", + "description": "Core istanbul API for JS code coverage", + "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", + "main": "dist/index.js", + "scripts": { + "release": "babel src --out-dir dist && documentation build -f md -o api.md src", + "test": "cross-env NODE_ENV=test nyc --check-coverage --statements 90 --branches 80 mocha --recursive test/", + "pretest": "jshint src/ test/", + "prepublish": "npm test && npm run release", + "version": "standard-version", + "coverage": "nyc report --reporter=text-lcov | coveralls" + }, + "dependencies": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.13.0", + "istanbul-lib-coverage": "^1.0.0", + "semver": "^5.3.0" + }, + "devDependencies": { + "babel-cli": "^6.3.17", + "babel-plugin-istanbul": "^2.0.3", + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.16.3", + "chai": "^3.0.0", + "clone": "^2.0.0", + "coveralls": "^2.11.4", + "cross-env": "^2.0.1", + "documentation": "^4.0.0-beta9", + "js-yaml": "^3.3.1", + "jshint": "^2.8.0", + "mocha": "^3.1.2", + "nopt": "^3.0.6", + "nyc": "^8.3.1", + "standard-version": "^3.0.0" + }, + "nyc": { + "include": [ + "src/**/*.js" + ], + "require": [ + "babel-register" + ], + "sourceMap": false, + "instrument": false + }, + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/istanbuljs/istanbul-lib-instrument/issues" + }, + "homepage": "https://github.com/istanbuljs/istanbul-lib-instrument", + "repository": { + "type": "git", + "url": "git@github.com:istanbuljs/istanbul-lib-instrument.git" + }, + "keywords": [ + "coverage", + "istanbul", + "js", + "instrumentation" + ] +} |