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

babel-plugin-sitrep

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-sitrep - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

2

coverage/coverage-final.json

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

{"/Users/kye/github/babel-plugin-sitrep/src/index.js": {"path":"/Users/kye/github/babel-plugin-sitrep/src/index.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":160,"column":1}},"1":{"start":{"line":2,"column":23},"end":{"line":2,"column":28}},"2":{"start":{"line":3,"column":20},"end":{"line":7,"column":3}},"3":{"start":{"line":9,"column":28},"end":{"line":14,"column":5}},"4":{"start":{"line":10,"column":4},"end":{"line":14,"column":5}},"5":{"start":{"line":17,"column":4},"end":{"line":17,"column":47}},"6":{"start":{"line":21,"column":4},"end":{"line":21,"column":55}},"7":{"start":{"line":21,"column":30},"end":{"line":21,"column":54}},"8":{"start":{"line":25,"column":4},"end":{"line":30,"column":5}},"9":{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},"10":{"start":{"line":35,"column":6},"end":{"line":35,"column":30}},"11":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},"12":{"start":{"line":39,"column":6},"end":{"line":39,"column":31}},"13":{"start":{"line":42,"column":27},"end":{"line":42,"column":73}},"14":{"start":{"line":42,"column":48},"end":{"line":42,"column":72}},"15":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"16":{"start":{"line":44,"column":6},"end":{"line":44,"column":40}},"17":{"start":{"line":47,"column":4},"end":{"line":47,"column":57}},"18":{"start":{"line":51,"column":4},"end":{"line":53,"column":5}},"19":{"start":{"line":52,"column":6},"end":{"line":52,"column":12}},"20":{"start":{"line":55,"column":15},"end":{"line":55,"column":28}},"21":{"start":{"line":56,"column":4},"end":{"line":65,"column":7}},"22":{"start":{"line":66,"column":27},"end":{"line":66,"column":32}},"23":{"start":{"line":67,"column":4},"end":{"line":116,"column":6}},"24":{"start":{"line":69,"column":8},"end":{"line":71,"column":9}},"25":{"start":{"line":74,"column":22},"end":{"line":74,"column":44}},"26":{"start":{"line":75,"column":8},"end":{"line":96,"column":10}},"27":{"start":{"line":76,"column":10},"end":{"line":93,"column":11}},"28":{"start":{"line":77,"column":12},"end":{"line":91,"column":16}},"29":{"start":{"line":81,"column":16},"end":{"line":90,"column":17}},"30":{"start":{"line":92,"column":12},"end":{"line":92,"column":18}},"31":{"start":{"line":95,"column":10},"end":{"line":95,"column":77}},"32":{"start":{"line":99,"column":19},"end":{"line":99,"column":66}},"33":{"start":{"line":100,"column":8},"end":{"line":104,"column":9}},"34":{"start":{"line":106,"column":8},"end":{"line":112,"column":9}},"35":{"start":{"line":113,"column":8},"end":{"line":113,"column":31}},"36":{"start":{"line":114,"column":8},"end":{"line":114,"column":31}},"37":{"start":{"line":117,"column":4},"end":{"line":128,"column":5}},"38":{"start":{"line":118,"column":6},"end":{"line":127,"column":9}},"39":{"start":{"line":131,"column":2},"end":{"line":159,"column":3}},"40":{"start":{"line":135,"column":8},"end":{"line":140,"column":9}},"41":{"start":{"line":136,"column":10},"end":{"line":138,"column":11}},"42":{"start":{"line":137,"column":12},"end":{"line":137,"column":42}},"43":{"start":{"line":139,"column":10},"end":{"line":139,"column":38}},"44":{"start":{"line":143,"column":8},"end":{"line":156,"column":9}},"45":{"start":{"line":146,"column":10},"end":{"line":148,"column":11}},"46":{"start":{"line":147,"column":12},"end":{"line":147,"column":54}},"47":{"start":{"line":149,"column":10},"end":{"line":155,"column":11}},"48":{"start":{"line":150,"column":12},"end":{"line":154,"column":14}},"49":{"start":{"line":152,"column":16},"end":{"line":152,"column":44}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}},"loc":{"start":{"line":1,"column":34},"end":{"line":160,"column":1}},"line":1},"1":{"name":"(anonymous_1)","decl":{"start":{"line":9,"column":28},"end":{"line":9,"column":29}},"loc":{"start":{"line":10,"column":4},"end":{"line":14,"column":5}},"line":10},"2":{"name":"getComments","decl":{"start":{"line":16,"column":11},"end":{"line":16,"column":22}},"loc":{"start":{"line":16,"column":30},"end":{"line":18,"column":3}},"line":16},"3":{"name":"hasSitrepComments","decl":{"start":{"line":20,"column":11},"end":{"line":20,"column":28}},"loc":{"start":{"line":20,"column":58},"end":{"line":22,"column":3}},"line":20},"4":{"name":"(anonymous_4)","decl":{"start":{"line":21,"column":25},"end":{"line":21,"column":26}},"loc":{"start":{"line":21,"column":30},"end":{"line":21,"column":54}},"line":21},"5":{"name":"createLogStatement","decl":{"start":{"line":24,"column":11},"end":{"line":24,"column":29}},"loc":{"start":{"line":24,"column":38},"end":{"line":31,"column":3}},"line":24},"6":{"name":"getName","decl":{"start":{"line":33,"column":11},"end":{"line":33,"column":18}},"loc":{"start":{"line":33,"column":26},"end":{"line":48,"column":3}},"line":33},"7":{"name":"(anonymous_7)","decl":{"start":{"line":42,"column":43},"end":{"line":42,"column":44}},"loc":{"start":{"line":42,"column":48},"end":{"line":42,"column":72}},"line":42},"8":{"name":"functionVisitor","decl":{"start":{"line":50,"column":11},"end":{"line":50,"column":26}},"loc":{"start":{"line":50,"column":41},"end":{"line":129,"column":3}},"line":50},"9":{"name":"(anonymous_9)","decl":{"start":{"line":75,"column":22},"end":{"line":75,"column":23}},"loc":{"start":{"line":75,"column":29},"end":{"line":96,"column":9}},"line":75},"10":{"name":"(anonymous_10)","decl":{"start":{"line":80,"column":23},"end":{"line":80,"column":24}},"loc":{"start":{"line":80,"column":31},"end":{"line":91,"column":15}},"line":80}},"branchMap":{"0":{"loc":{"start":{"line":9,"column":34},"end":{"line":9,"column":50}},"type":"default-arg","locations":[{"start":{"line":9,"column":46},"end":{"line":9,"column":50}}],"line":9},"1":{"loc":{"start":{"line":12,"column":27},"end":{"line":12,"column":69}},"type":"cond-expr","locations":[{"start":{"line":12,"column":33},"end":{"line":12,"column":38}},{"start":{"line":12,"column":41},"end":{"line":12,"column":69}}],"line":12},"2":{"loc":{"start":{"line":12,"column":41},"end":{"line":12,"column":69}},"type":"cond-expr","locations":[{"start":{"line":12,"column":53},"end":{"line":12,"column":64}},{"start":{"line":12,"column":67},"end":{"line":12,"column":69}}],"line":12},"3":{"loc":{"start":{"line":17,"column":11},"end":{"line":17,"column":47}},"type":"binary-expr","locations":[{"start":{"line":17,"column":12},"end":{"line":17,"column":16}},{"start":{"line":17,"column":20},"end":{"line":17,"column":40}},{"start":{"line":17,"column":45},"end":{"line":17,"column":47}}],"line":17},"4":{"loc":{"start":{"line":20,"column":40},"end":{"line":20,"column":56}},"type":"default-arg","locations":[{"start":{"line":20,"column":48},"end":{"line":20,"column":56}}],"line":20},"5":{"loc":{"start":{"line":27,"column":6},"end":{"line":29,"column":76}},"type":"cond-expr","locations":[{"start":{"line":28,"column":10},"end":{"line":28,"column":51}},{"start":{"line":29,"column":10},"end":{"line":29,"column":76}}],"line":27},"6":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":54}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":16}},{"start":{"line":27,"column":20},"end":{"line":27,"column":54}}],"line":27},"7":{"loc":{"start":{"line":29,"column":10},"end":{"line":29,"column":76}},"type":"cond-expr","locations":[{"start":{"line":29,"column":23},"end":{"line":29,"column":66}},{"start":{"line":29,"column":69},"end":{"line":29,"column":76}}],"line":29},"8":{"loc":{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},{"start":{"line":34,"column":4},"end":{"line":36,"column":5}}],"line":34},"9":{"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":41}},"type":"binary-expr","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":20}},{"start":{"line":34,"column":24},"end":{"line":34,"column":41}}],"line":34},"10":{"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}}],"line":38},"11":{"loc":{"start":{"line":38,"column":8},"end":{"line":38,"column":54}},"type":"binary-expr","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":21}},{"start":{"line":38,"column":25},"end":{"line":38,"column":54}}],"line":38},"12":{"loc":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},{"start":{"line":43,"column":4},"end":{"line":45,"column":5}}],"line":43},"13":{"loc":{"start":{"line":43,"column":8},"end":{"line":43,"column":64}},"type":"binary-expr","locations":[{"start":{"line":43,"column":8},"end":{"line":43,"column":22}},{"start":{"line":43,"column":26},"end":{"line":43,"column":64}}],"line":43},"14":{"loc":{"start":{"line":51,"column":4},"end":{"line":53,"column":5}},"type":"if","locations":[{"start":{"line":51,"column":4},"end":{"line":53,"column":5}},{"start":{"line":51,"column":4},"end":{"line":53,"column":5}}],"line":51},"15":{"loc":{"start":{"line":76,"column":10},"end":{"line":93,"column":11}},"type":"if","locations":[{"start":{"line":76,"column":10},"end":{"line":93,"column":11}},{"start":{"line":76,"column":10},"end":{"line":93,"column":11}}],"line":76},"16":{"loc":{"start":{"line":84,"column":22},"end":{"line":86,"column":56}},"type":"cond-expr","locations":[{"start":{"line":85,"column":26},"end":{"line":85,"column":58}},{"start":{"line":86,"column":26},"end":{"line":86,"column":56}}],"line":84},"17":{"loc":{"start":{"line":87,"column":22},"end":{"line":87,"column":72}},"type":"cond-expr","locations":[{"start":{"line":87,"column":51},"end":{"line":87,"column":61}},{"start":{"line":87,"column":64},"end":{"line":87,"column":72}}],"line":87},"18":{"loc":{"start":{"line":117,"column":4},"end":{"line":128,"column":5}},"type":"if","locations":[{"start":{"line":117,"column":4},"end":{"line":128,"column":5}},{"start":{"line":117,"column":4},"end":{"line":128,"column":5}}],"line":117},"19":{"loc":{"start":{"line":135,"column":8},"end":{"line":140,"column":9}},"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":140,"column":9}},{"start":{"line":135,"column":8},"end":{"line":140,"column":9}}],"line":135},"20":{"loc":{"start":{"line":136,"column":10},"end":{"line":138,"column":11}},"type":"if","locations":[{"start":{"line":136,"column":10},"end":{"line":138,"column":11}},{"start":{"line":136,"column":10},"end":{"line":138,"column":11}}],"line":136},"21":{"loc":{"start":{"line":143,"column":8},"end":{"line":156,"column":9}},"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":156,"column":9}},{"start":{"line":143,"column":8},"end":{"line":156,"column":9}}],"line":143},"22":{"loc":{"start":{"line":146,"column":10},"end":{"line":148,"column":11}},"type":"if","locations":[{"start":{"line":146,"column":10},"end":{"line":148,"column":11}},{"start":{"line":146,"column":10},"end":{"line":148,"column":11}}],"line":146},"23":{"loc":{"start":{"line":149,"column":10},"end":{"line":155,"column":11}},"type":"if","locations":[{"start":{"line":149,"column":10},"end":{"line":155,"column":11}},{"start":{"line":149,"column":10},"end":{"line":155,"column":11}}],"line":149}},"s":{"0":1,"1":1,"2":1,"3":1,"4":21,"5":52,"6":52,"7":10,"8":19,"9":10,"10":3,"11":7,"12":2,"13":5,"14":9,"15":5,"16":3,"17":2,"18":10,"19":0,"20":10,"21":10,"22":10,"23":10,"24":4,"25":16,"26":16,"27":16,"28":1,"29":4,"30":1,"31":15,"32":11,"33":11,"34":11,"35":11,"36":11,"37":10,"38":0,"39":1,"40":21,"41":7,"42":1,"43":7,"44":31,"45":3,"46":2,"47":3,"48":3,"49":3},"f":{"0":1,"1":21,"2":52,"3":52,"4":10,"5":19,"6":10,"7":9,"8":10,"9":16,"10":4},"b":{"0":[19],"1":[11,10],"2":[9,1],"3":[52,52,42],"4":[49],"5":[11,8],"6":[19,19],"7":[8,0],"8":[3,7],"9":[10,3],"10":[2,5],"11":[7,2],"12":[3,2],"13":[5,3],"14":[0,10],"15":[1,15],"16":[3,1],"17":[3,1],"18":[0,10],"19":[7,14],"20":[1,6],"21":[3,28],"22":[2,1],"23":[3,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"81b23a71608f924d424e20f379ef27618210e3d5"}
{"/Users/kye/github/babel-plugin-sitrep/src/index.js": {"path":"/Users/kye/github/babel-plugin-sitrep/src/index.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":214,"column":1}},"1":{"start":{"line":2,"column":23},"end":{"line":2,"column":28}},"2":{"start":{"line":3,"column":20},"end":{"line":7,"column":3}},"3":{"start":{"line":9,"column":28},"end":{"line":14,"column":5}},"4":{"start":{"line":10,"column":4},"end":{"line":14,"column":5}},"5":{"start":{"line":17,"column":4},"end":{"line":17,"column":47}},"6":{"start":{"line":21,"column":4},"end":{"line":21,"column":55}},"7":{"start":{"line":21,"column":30},"end":{"line":21,"column":54}},"8":{"start":{"line":25,"column":4},"end":{"line":30,"column":5}},"9":{"start":{"line":34,"column":4},"end":{"line":41,"column":5}},"10":{"start":{"line":35,"column":6},"end":{"line":40,"column":7}},"11":{"start":{"line":39,"column":8},"end":{"line":39,"column":44}},"12":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"13":{"start":{"line":44,"column":6},"end":{"line":44,"column":30}},"14":{"start":{"line":47,"column":4},"end":{"line":49,"column":5}},"15":{"start":{"line":48,"column":6},"end":{"line":48,"column":31}},"16":{"start":{"line":51,"column":27},"end":{"line":51,"column":73}},"17":{"start":{"line":51,"column":48},"end":{"line":51,"column":72}},"18":{"start":{"line":52,"column":4},"end":{"line":54,"column":5}},"19":{"start":{"line":53,"column":6},"end":{"line":53,"column":40}},"20":{"start":{"line":56,"column":4},"end":{"line":56,"column":57}},"21":{"start":{"line":60,"column":15},"end":{"line":60,"column":36}},"22":{"start":{"line":61,"column":4},"end":{"line":70,"column":7}},"23":{"start":{"line":71,"column":27},"end":{"line":71,"column":32}},"24":{"start":{"line":73,"column":4},"end":{"line":157,"column":6}},"25":{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},"26":{"start":{"line":76,"column":10},"end":{"line":76,"column":16}},"27":{"start":{"line":78,"column":8},"end":{"line":80,"column":9}},"28":{"start":{"line":83,"column":8},"end":{"line":98,"column":12}},"29":{"start":{"line":87,"column":21},"end":{"line":87,"column":28}},"30":{"start":{"line":88,"column":12},"end":{"line":90,"column":13}},"31":{"start":{"line":89,"column":14},"end":{"line":89,"column":31}},"32":{"start":{"line":91,"column":12},"end":{"line":97,"column":15}},"33":{"start":{"line":101,"column":8},"end":{"line":117,"column":12}},"34":{"start":{"line":105,"column":12},"end":{"line":116,"column":15}},"35":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"36":{"start":{"line":121,"column":10},"end":{"line":121,"column":16}},"37":{"start":{"line":124,"column":22},"end":{"line":124,"column":56}},"38":{"start":{"line":125,"column":8},"end":{"line":137,"column":10}},"39":{"start":{"line":126,"column":10},"end":{"line":128,"column":11}},"40":{"start":{"line":127,"column":12},"end":{"line":127,"column":18}},"41":{"start":{"line":130,"column":10},"end":{"line":132,"column":11}},"42":{"start":{"line":131,"column":12},"end":{"line":131,"column":18}},"43":{"start":{"line":134,"column":10},"end":{"line":136,"column":11}},"44":{"start":{"line":140,"column":19},"end":{"line":140,"column":72}},"45":{"start":{"line":141,"column":8},"end":{"line":145,"column":9}},"46":{"start":{"line":147,"column":8},"end":{"line":153,"column":9}},"47":{"start":{"line":154,"column":8},"end":{"line":154,"column":31}},"48":{"start":{"line":155,"column":8},"end":{"line":155,"column":37}},"49":{"start":{"line":158,"column":4},"end":{"line":169,"column":5}},"50":{"start":{"line":159,"column":6},"end":{"line":168,"column":9}},"51":{"start":{"line":172,"column":2},"end":{"line":213,"column":3}},"52":{"start":{"line":176,"column":8},"end":{"line":186,"column":10}},"53":{"start":{"line":178,"column":12},"end":{"line":184,"column":13}},"54":{"start":{"line":179,"column":14},"end":{"line":183,"column":16}},"55":{"start":{"line":181,"column":18},"end":{"line":181,"column":46}},"56":{"start":{"line":189,"column":8},"end":{"line":194,"column":9}},"57":{"start":{"line":190,"column":10},"end":{"line":192,"column":11}},"58":{"start":{"line":191,"column":12},"end":{"line":191,"column":42}},"59":{"start":{"line":193,"column":10},"end":{"line":193,"column":38}},"60":{"start":{"line":197,"column":8},"end":{"line":210,"column":9}},"61":{"start":{"line":200,"column":10},"end":{"line":202,"column":11}},"62":{"start":{"line":201,"column":12},"end":{"line":201,"column":54}},"63":{"start":{"line":203,"column":10},"end":{"line":209,"column":11}},"64":{"start":{"line":204,"column":12},"end":{"line":208,"column":14}},"65":{"start":{"line":206,"column":16},"end":{"line":206,"column":44}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}},"loc":{"start":{"line":1,"column":34},"end":{"line":214,"column":1}},"line":1},"1":{"name":"(anonymous_1)","decl":{"start":{"line":9,"column":28},"end":{"line":9,"column":29}},"loc":{"start":{"line":10,"column":4},"end":{"line":14,"column":5}},"line":10},"2":{"name":"getComments","decl":{"start":{"line":16,"column":11},"end":{"line":16,"column":22}},"loc":{"start":{"line":16,"column":30},"end":{"line":18,"column":3}},"line":16},"3":{"name":"hasSitrepComments","decl":{"start":{"line":20,"column":11},"end":{"line":20,"column":28}},"loc":{"start":{"line":20,"column":58},"end":{"line":22,"column":3}},"line":20},"4":{"name":"(anonymous_4)","decl":{"start":{"line":21,"column":25},"end":{"line":21,"column":26}},"loc":{"start":{"line":21,"column":30},"end":{"line":21,"column":54}},"line":21},"5":{"name":"createLogStatement","decl":{"start":{"line":24,"column":11},"end":{"line":24,"column":29}},"loc":{"start":{"line":24,"column":38},"end":{"line":31,"column":3}},"line":24},"6":{"name":"getName","decl":{"start":{"line":33,"column":11},"end":{"line":33,"column":18}},"loc":{"start":{"line":33,"column":26},"end":{"line":57,"column":3}},"line":33},"7":{"name":"(anonymous_7)","decl":{"start":{"line":51,"column":43},"end":{"line":51,"column":44}},"loc":{"start":{"line":51,"column":48},"end":{"line":51,"column":72}},"line":51},"8":{"name":"functionVisitor","decl":{"start":{"line":59,"column":11},"end":{"line":59,"column":26}},"loc":{"start":{"line":59,"column":49},"end":{"line":170,"column":3}},"line":59},"9":{"name":"(anonymous_9)","decl":{"start":{"line":86,"column":19},"end":{"line":86,"column":20}},"loc":{"start":{"line":86,"column":30},"end":{"line":98,"column":11}},"line":86},"10":{"name":"(anonymous_10)","decl":{"start":{"line":104,"column":19},"end":{"line":104,"column":20}},"loc":{"start":{"line":104,"column":27},"end":{"line":117,"column":11}},"line":104},"11":{"name":"(anonymous_11)","decl":{"start":{"line":125,"column":22},"end":{"line":125,"column":23}},"loc":{"start":{"line":125,"column":29},"end":{"line":137,"column":9}},"line":125}},"branchMap":{"0":{"loc":{"start":{"line":9,"column":34},"end":{"line":9,"column":50}},"type":"default-arg","locations":[{"start":{"line":9,"column":46},"end":{"line":9,"column":50}}],"line":9},"1":{"loc":{"start":{"line":12,"column":27},"end":{"line":12,"column":69}},"type":"cond-expr","locations":[{"start":{"line":12,"column":33},"end":{"line":12,"column":38}},{"start":{"line":12,"column":41},"end":{"line":12,"column":69}}],"line":12},"2":{"loc":{"start":{"line":12,"column":41},"end":{"line":12,"column":69}},"type":"cond-expr","locations":[{"start":{"line":12,"column":53},"end":{"line":12,"column":64}},{"start":{"line":12,"column":67},"end":{"line":12,"column":69}}],"line":12},"3":{"loc":{"start":{"line":17,"column":11},"end":{"line":17,"column":47}},"type":"binary-expr","locations":[{"start":{"line":17,"column":12},"end":{"line":17,"column":16}},{"start":{"line":17,"column":20},"end":{"line":17,"column":40}},{"start":{"line":17,"column":45},"end":{"line":17,"column":47}}],"line":17},"4":{"loc":{"start":{"line":20,"column":40},"end":{"line":20,"column":56}},"type":"default-arg","locations":[{"start":{"line":20,"column":48},"end":{"line":20,"column":56}}],"line":20},"5":{"loc":{"start":{"line":27,"column":6},"end":{"line":29,"column":76}},"type":"cond-expr","locations":[{"start":{"line":28,"column":10},"end":{"line":28,"column":51}},{"start":{"line":29,"column":10},"end":{"line":29,"column":76}}],"line":27},"6":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":58}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":16}},{"start":{"line":27,"column":20},"end":{"line":27,"column":58}}],"line":27},"7":{"loc":{"start":{"line":29,"column":10},"end":{"line":29,"column":76}},"type":"cond-expr","locations":[{"start":{"line":29,"column":23},"end":{"line":29,"column":66}},{"start":{"line":29,"column":69},"end":{"line":29,"column":76}}],"line":29},"8":{"loc":{"start":{"line":34,"column":4},"end":{"line":41,"column":5}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":41,"column":5}},{"start":{"line":34,"column":4},"end":{"line":41,"column":5}}],"line":34},"9":{"loc":{"start":{"line":35,"column":6},"end":{"line":40,"column":7}},"type":"if","locations":[{"start":{"line":35,"column":6},"end":{"line":40,"column":7}},{"start":{"line":35,"column":6},"end":{"line":40,"column":7}}],"line":35},"10":{"loc":{"start":{"line":36,"column":8},"end":{"line":37,"column":48}},"type":"binary-expr","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":32}},{"start":{"line":37,"column":8},"end":{"line":37,"column":48}}],"line":36},"11":{"loc":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},{"start":{"line":43,"column":4},"end":{"line":45,"column":5}}],"line":43},"12":{"loc":{"start":{"line":43,"column":8},"end":{"line":43,"column":41}},"type":"binary-expr","locations":[{"start":{"line":43,"column":8},"end":{"line":43,"column":20}},{"start":{"line":43,"column":24},"end":{"line":43,"column":41}}],"line":43},"13":{"loc":{"start":{"line":47,"column":4},"end":{"line":49,"column":5}},"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":49,"column":5}},{"start":{"line":47,"column":4},"end":{"line":49,"column":5}}],"line":47},"14":{"loc":{"start":{"line":47,"column":8},"end":{"line":47,"column":54}},"type":"binary-expr","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":21}},{"start":{"line":47,"column":25},"end":{"line":47,"column":54}}],"line":47},"15":{"loc":{"start":{"line":52,"column":4},"end":{"line":54,"column":5}},"type":"if","locations":[{"start":{"line":52,"column":4},"end":{"line":54,"column":5}},{"start":{"line":52,"column":4},"end":{"line":54,"column":5}}],"line":52},"16":{"loc":{"start":{"line":52,"column":8},"end":{"line":52,"column":64}},"type":"binary-expr","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":22}},{"start":{"line":52,"column":26},"end":{"line":52,"column":64}}],"line":52},"17":{"loc":{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},{"start":{"line":75,"column":8},"end":{"line":77,"column":9}}],"line":75},"18":{"loc":{"start":{"line":88,"column":12},"end":{"line":90,"column":13}},"type":"if","locations":[{"start":{"line":88,"column":12},"end":{"line":90,"column":13}},{"start":{"line":88,"column":12},"end":{"line":90,"column":13}}],"line":88},"19":{"loc":{"start":{"line":110,"column":20},"end":{"line":112,"column":54}},"type":"cond-expr","locations":[{"start":{"line":111,"column":24},"end":{"line":111,"column":56}},{"start":{"line":112,"column":24},"end":{"line":112,"column":54}}],"line":110},"20":{"loc":{"start":{"line":113,"column":20},"end":{"line":113,"column":70}},"type":"cond-expr","locations":[{"start":{"line":113,"column":49},"end":{"line":113,"column":59}},{"start":{"line":113,"column":62},"end":{"line":113,"column":70}}],"line":113},"21":{"loc":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},{"start":{"line":120,"column":8},"end":{"line":122,"column":9}}],"line":120},"22":{"loc":{"start":{"line":126,"column":10},"end":{"line":128,"column":11}},"type":"if","locations":[{"start":{"line":126,"column":10},"end":{"line":128,"column":11}},{"start":{"line":126,"column":10},"end":{"line":128,"column":11}}],"line":126},"23":{"loc":{"start":{"line":130,"column":10},"end":{"line":132,"column":11}},"type":"if","locations":[{"start":{"line":130,"column":10},"end":{"line":132,"column":11}},{"start":{"line":130,"column":10},"end":{"line":132,"column":11}}],"line":130},"24":{"loc":{"start":{"line":158,"column":4},"end":{"line":169,"column":5}},"type":"if","locations":[{"start":{"line":158,"column":4},"end":{"line":169,"column":5}},{"start":{"line":158,"column":4},"end":{"line":169,"column":5}}],"line":158},"25":{"loc":{"start":{"line":178,"column":12},"end":{"line":184,"column":13}},"type":"if","locations":[{"start":{"line":178,"column":12},"end":{"line":184,"column":13}},{"start":{"line":178,"column":12},"end":{"line":184,"column":13}}],"line":178},"26":{"loc":{"start":{"line":189,"column":8},"end":{"line":194,"column":9}},"type":"if","locations":[{"start":{"line":189,"column":8},"end":{"line":194,"column":9}},{"start":{"line":189,"column":8},"end":{"line":194,"column":9}}],"line":189},"27":{"loc":{"start":{"line":190,"column":10},"end":{"line":192,"column":11}},"type":"if","locations":[{"start":{"line":190,"column":10},"end":{"line":192,"column":11}},{"start":{"line":190,"column":10},"end":{"line":192,"column":11}}],"line":190},"28":{"loc":{"start":{"line":197,"column":8},"end":{"line":210,"column":9}},"type":"if","locations":[{"start":{"line":197,"column":8},"end":{"line":210,"column":9}},{"start":{"line":197,"column":8},"end":{"line":210,"column":9}}],"line":197},"29":{"loc":{"start":{"line":200,"column":10},"end":{"line":202,"column":11}},"type":"if","locations":[{"start":{"line":200,"column":10},"end":{"line":202,"column":11}},{"start":{"line":200,"column":10},"end":{"line":202,"column":11}}],"line":200},"30":{"loc":{"start":{"line":203,"column":10},"end":{"line":209,"column":11}},"type":"if","locations":[{"start":{"line":203,"column":10},"end":{"line":209,"column":11}},{"start":{"line":203,"column":10},"end":{"line":209,"column":11}}],"line":203}},"s":{"0":1,"1":1,"2":1,"3":1,"4":33,"5":93,"6":93,"7":18,"8":29,"9":16,"10":1,"11":1,"12":15,"13":7,"14":8,"15":3,"16":5,"17":9,"18":5,"19":3,"20":2,"21":16,"22":16,"23":16,"24":16,"25":8,"26":2,"27":6,"28":2,"29":8,"30":8,"31":2,"32":8,"33":2,"34":8,"35":29,"36":2,"37":27,"38":27,"39":33,"40":8,"41":25,"42":2,"43":23,"44":15,"45":15,"46":15,"47":15,"48":15,"49":16,"50":2,"51":1,"52":3,"53":3,"54":2,"55":1,"56":36,"57":12,"58":1,"59":12,"60":54,"61":4,"62":2,"63":4,"64":3,"65":3},"f":{"0":1,"1":33,"2":93,"3":93,"4":18,"5":29,"6":16,"7":9,"8":16,"9":8,"10":8,"11":33},"b":{"0":[31],"1":[17,16],"2":[15,1],"3":[93,93,75],"4":[90],"5":[15,14],"6":[29,29],"7":[14,0],"8":[1,15],"9":[1,0],"10":[1,1],"11":[7,8],"12":[15,7],"13":[3,5],"14":[8,3],"15":[3,2],"16":[5,3],"17":[2,6],"18":[2,6],"19":[6,2],"20":[6,2],"21":[2,27],"22":[8,25],"23":[2,23],"24":[2,14],"25":[2,1],"26":[12,24],"27":[1,11],"28":[4,50],"29":[2,2],"30":[3,1]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"6c5bbd2b6c116f71cd41bb1c9d68747fc1247407"}
}
{
"name": "babel-plugin-sitrep",
"version": "1.2.2",
"version": "1.2.3",
"description": "Log all assignments and the return value of a function with a simple comment",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -8,42 +8,8 @@ const pluginTester = require('babel-plugin-tester')

snapshot: true,
babelOptions: {
babelrc: true,
filename: __filename
},
tests: [
{
title: 'should not add console logs',
code: `
function bar () {
var a = 'foo'
const b = 'bar'
let c = [a, b].map(x => x)
return c.join('-')
}
var cb = x => x.charAt(0)
var cb = x => {
x = x + 2
x.charAt(0)
return x
}
var a = function () {
return 'foo'
}
const obj = {
fn() {
let a = 5
return a + 5
}
}
class Boom {
fire() {
let a = 2
return a + 5
}
}
`
},
{
title: 'function',

@@ -56,2 +22,3 @@ code: `

let c = [a, b].map(x => x)
let d = a
return c.join('-')

@@ -101,2 +68,36 @@ }

{
title: 'object properties with let',
code: `
const obj = {
// sitrep
fn(x) {
let a, b, c, d;
({ a, b, c = 'foo', d: alias } = x);
return a + b + c + alias;
}
}
`
},
{
title: 'array properties',
code: `
// sitrep
function fn() {
const [a, b = 'foo', c, d] = x.split("_");
return a + b + c + d;
}
`
},
{
title: 'array properties with let',
code: `
// sitrep
function fn() {
let a, b, c, d;
[a, b = 'foo', c, d] = x.split("_");
return a + b + c + d;
}
`
},
{
title: 'class methods',

@@ -212,9 +213,51 @@ code: `

}
`,
babelOptions: {
babelrc: true,
filename: __filename
}
`
},
{
title: 'should not add console logs',
code: `
// sitrep
const shouldNotLog = 'bar';
function bar () {
var a = 'foo'
const b = 'bar'
let c = [a, b].map(x => x)
return c.join('-')
}
var cb = x => x.charAt(0)
var cb = x => {
x = x + 2
x.charAt(0)
return x
}
var a = function () {
return 'foo'
}
const obj = {
fn() {
let a = 5
return a + 5
}
}
class Boom {
// sitrep
shouldNotLog = 'bar';
fire() {
let a = 2
return a + 5
}
handleClick = (e) => e.preventDefault()
}
`
}
]
})

@@ -35,3 +35,6 @@ module.exports = function (babel) {

if (path.parentPath.isClassProperty()) {
if (path.parentPath.node.key && t.isIdentifier(path.parentPath.node.key)) {
if (
path.parentPath.node.key &&
t.isIdentifier(path.parentPath.node.key)
) {
return path.parentPath.node.key.name

@@ -70,4 +73,8 @@ }

let didWriteGroupEnd = false
functionPath.traverse({
AssignmentExpression (path) {
if (t.isPattern(path.node.left)) {
return
}
path.insertAfter(

@@ -77,2 +84,39 @@ t.expressionStatement(createLogStatement(path.node.left))

},
ArrayPattern (arrPatternPath) {
arrPatternPath.node.elements
.slice()
.reverse()
.forEach(element => {
let id = element
if (t.isAssignmentPattern(element)) {
id = element.left
}
arrPatternPath
.getStatementParent()
.insertAfter(
t.expressionStatement(
t.callExpression(logCallee, [t.stringLiteral(id.name), id])
)
)
})
},
ObjectPattern (objPatternPath) {
objPatternPath.node.properties
.slice()
.reverse()
.forEach(prop => {
objPatternPath
.getStatementParent()
.insertAfter(
t.expressionStatement(
t.callExpression(logCallee, [
t.isIdentifier(prop.value)
? t.stringLiteral(prop.value.name)
: t.stringLiteral(prop.key.name),
t.isIdentifier(prop.value) ? prop.value : prop.key
])
)
)
})
},
VariableDeclaration (variableDeclPath) {

@@ -85,18 +129,7 @@ if (!variableDeclPath.parentPath.isBlockStatement()) {

decls.forEach(dec => {
if (!dec.init) {
return
}
if (t.isPattern(dec.id)) {
dec.id.properties
.slice()
.reverse()
.forEach(prop => {
variableDeclPath.insertAfter(
t.expressionStatement(
t.callExpression(logCallee, [
t.isIdentifier(prop.value)
? t.stringLiteral(prop.value.name)
: t.stringLiteral(prop.key.name),
t.isIdentifier(prop.value) ? prop.value : prop.key
])
)
)
})
return

@@ -103,0 +136,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc