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

najax

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

najax - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

2

coverage/coverage.json

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

{"/Users/alz/dev/git/najax/lib/najax.js":{"path":"/Users/alz/dev/git/najax/lib/najax.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":54,"12":54,"13":54,"14":54,"15":54,"16":54,"17":1,"18":53,"19":2,"20":1,"21":1,"22":1,"23":1,"24":0,"25":54,"26":6,"27":1,"28":0,"29":1,"30":5,"31":54,"32":1,"33":54,"34":54,"35":5,"36":49,"37":5,"38":44,"39":5,"40":54,"41":54,"42":0,"43":0,"44":1,"45":216,"46":0,"47":0,"48":54,"49":54,"50":53,"51":1,"52":53,"53":1,"54":1,"55":2,"56":1,"57":53,"58":53,"59":53,"60":53,"61":53,"62":0,"63":0,"64":0,"65":53,"66":53,"67":53,"68":0,"69":53,"70":0,"71":53,"72":53,"73":53,"74":53,"75":53,"76":53,"77":51,"78":53,"79":0,"80":0,"81":54,"82":1,"83":2,"84":2,"85":2,"86":0,"87":2,"88":54,"89":1,"90":1,"91":1,"92":1,"93":1,"94":54,"95":5,"96":54,"97":54,"98":54,"99":54,"100":1,"101":3,"102":1,"103":1,"104":4,"105":41,"106":1},"b":{"1":[1,53],"2":[54,6,6],"3":[2,51],"4":[53,5,5,2],"5":[1,1,0],"6":[6,48],"7":[1,5],"8":[0,1],"9":[1,53],"10":[54,53],"11":[54,44],"12":[5,39],"13":[5,49],"14":[5,44],"15":[49,5],"16":[5,39],"17":[0,54],"18":[0,0],"19":[0,0],"20":[0,0],"21":[5,49],"22":[0,53],"23":[53,53],"24":[0,53],"25":[53,53],"26":[0,53],"27":[53,53,0],"28":[53,0],"29":[53,0],"30":[51,2],"31":[2,0],"32":[0,2],"33":[1,53],"34":[54,1],"35":[5,49],"36":[54,45]},"f":{"1":1,"2":54,"3":216,"4":0,"5":53,"6":1,"7":1,"8":53,"9":53,"10":2,"11":1,"12":1,"13":3,"14":4,"15":41},"fnMap":{"1":{"name":"(anonymous_1)","line":20,"loc":{"start":{"line":20,"column":20},"end":{"line":20,"column":43}}},"2":{"name":"najax","line":31,"loc":{"start":{"line":31,"column":0},"end":{"line":31,"column":40}}},"3":{"name":"notImplemented","line":104,"loc":{"start":{"line":104,"column":2},"end":{"line":104,"column":33}}},"4":{"name":"(anonymous_4)","line":105,"loc":{"start":{"line":105,"column":11},"end":{"line":105,"column":23}}},"5":{"name":"requestHandler","line":121,"loc":{"start":{"line":121,"column":50},"end":{"line":121,"column":80}}},"6":{"name":"getResponseHeader","line":123,"loc":{"start":{"line":123,"column":54},"end":{"line":123,"column":90}}},"7":{"name":"getAllResponseHeaders","line":126,"loc":{"start":{"line":126,"column":62},"end":{"line":126,"column":96}}},"8":{"name":"onData","line":133,"loc":{"start":{"line":133,"column":19},"end":{"line":133,"column":39}}},"9":{"name":"onEnd","line":134,"loc":{"start":{"line":134,"column":18},"end":{"line":134,"column":36}}},"10":{"name":"onError","line":181,"loc":{"start":{"line":181,"column":2},"end":{"line":181,"column":23}}},"11":{"name":"onSocket","line":191,"loc":{"start":{"line":191,"column":21},"end":{"line":191,"column":48}}},"12":{"name":"onTimeout","line":193,"loc":{"start":{"line":193,"column":27},"end":{"line":193,"column":49}}},"13":{"name":"defaults","line":210,"loc":{"start":{"line":210,"column":17},"end":{"line":210,"column":42}}},"14":{"name":"handleMethod","line":217,"loc":{"start":{"line":217,"column":0},"end":{"line":217,"column":31}}},"15":{"name":"methodHandler","line":218,"loc":{"start":{"line":218,"column":32},"end":{"line":218,"column":80}}}},"statementMap":{"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":28}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":26}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":40}},"4":{"start":{"line":9,"column":0},"end":{"line":9,"column":24}},"5":{"start":{"line":10,"column":0},"end":{"line":10,"column":34}},"6":{"start":{"line":11,"column":0},"end":{"line":11,"column":25}},"7":{"start":{"line":12,"column":0},"end":{"line":12,"column":45}},"8":{"start":{"line":13,"column":0},"end":{"line":23,"column":1}},"9":{"start":{"line":21,"column":4},"end":{"line":21,"column":30}},"10":{"start":{"line":31,"column":0},"end":{"line":208,"column":1}},"11":{"start":{"line":32,"column":2},"end":{"line":32,"column":28}},"12":{"start":{"line":33,"column":2},"end":{"line":33,"column":70}},"13":{"start":{"line":34,"column":2},"end":{"line":34,"column":26}},"14":{"start":{"line":35,"column":2},"end":{"line":35,"column":45}},"15":{"start":{"line":36,"column":2},"end":{"line":36,"column":15}},"16":{"start":{"line":43,"column":2},"end":{"line":56,"column":3}},"17":{"start":{"line":44,"column":4},"end":{"line":44,"column":42}},"18":{"start":{"line":45,"column":9},"end":{"line":56,"column":3}},"19":{"start":{"line":46,"column":4},"end":{"line":55,"column":5}},"20":{"start":{"line":48,"column":8},"end":{"line":48,"column":39}},"21":{"start":{"line":49,"column":8},"end":{"line":49,"column":13}},"22":{"start":{"line":51,"column":8},"end":{"line":51,"column":46}},"23":{"start":{"line":52,"column":8},"end":{"line":52,"column":13}},"24":{"start":{"line":54,"column":8},"end":{"line":54,"column":31}},"25":{"start":{"line":59,"column":2},"end":{"line":73,"column":3}},"26":{"start":{"line":60,"column":4},"end":{"line":72,"column":5}},"27":{"start":{"line":61,"column":6},"end":{"line":65,"column":7}},"28":{"start":{"line":62,"column":8},"end":{"line":62,"column":32}},"29":{"start":{"line":64,"column":8},"end":{"line":64,"column":31}},"30":{"start":{"line":68,"column":6},"end":{"line":71,"column":19}},"31":{"start":{"line":75,"column":2},"end":{"line":75,"column":35}},"32":{"start":{"line":75,"column":20},"end":{"line":75,"column":35}},"33":{"start":{"line":77,"column":2},"end":{"line":84,"column":3}},"34":{"start":{"line":88,"column":2},"end":{"line":94,"column":3}},"35":{"start":{"line":89,"column":4},"end":{"line":89,"column":25}},"36":{"start":{"line":90,"column":9},"end":{"line":94,"column":3}},"37":{"start":{"line":91,"column":4},"end":{"line":91,"column":48}},"38":{"start":{"line":92,"column":9},"end":{"line":94,"column":3}},"39":{"start":{"line":93,"column":4},"end":{"line":93,"column":25}},"40":{"start":{"line":96,"column":2},"end":{"line":96,"column":49}},"41":{"start":{"line":98,"column":2},"end":{"line":101,"column":3}},"42":{"start":{"line":99,"column":4},"end":{"line":99,"column":87}},"43":{"start":{"line":100,"column":4},"end":{"line":100,"column":18}},"44":{"start":{"line":104,"column":2},"end":{"line":109,"column":3}},"45":{"start":{"line":105,"column":4},"end":{"line":108,"column":5}},"46":{"start":{"line":106,"column":6},"end":{"line":106,"column":73}},"47":{"start":{"line":107,"column":6},"end":{"line":107,"column":21}},"48":{"start":{"line":111,"column":2},"end":{"line":119,"column":3}},"49":{"start":{"line":121,"column":2},"end":{"line":176,"column":4}},"50":{"start":{"line":123,"column":4},"end":{"line":125,"column":5}},"51":{"start":{"line":124,"column":6},"end":{"line":124,"column":46}},"52":{"start":{"line":126,"column":4},"end":{"line":132,"column":5}},"53":{"start":{"line":127,"column":6},"end":{"line":127,"column":22}},"54":{"start":{"line":128,"column":6},"end":{"line":130,"column":7}},"55":{"start":{"line":129,"column":8},"end":{"line":129,"column":51}},"56":{"start":{"line":131,"column":6},"end":{"line":131,"column":31}},"57":{"start":{"line":133,"column":4},"end":{"line":133,"column":53}},"58":{"start":{"line":133,"column":41},"end":{"line":133,"column":51}},"59":{"start":{"line":134,"column":4},"end":{"line":175,"column":6}},"60":{"start":{"line":135,"column":6},"end":{"line":135,"column":31}},"61":{"start":{"line":136,"column":6},"end":{"line":143,"column":7}},"62":{"start":{"line":138,"column":8},"end":{"line":142,"column":9}},"63":{"start":{"line":139,"column":10},"end":{"line":139,"column":60}},"64":{"start":{"line":141,"column":10},"end":{"line":141,"column":27}},"65":{"start":{"line":145,"column":6},"end":{"line":145,"column":37}},"66":{"start":{"line":146,"column":6},"end":{"line":146,"column":32}},"67":{"start":{"line":148,"column":6},"end":{"line":152,"column":7}},"68":{"start":{"line":149,"column":8},"end":{"line":149,"column":32}},"69":{"start":{"line":150,"column":13},"end":{"line":152,"column":7}},"70":{"start":{"line":151,"column":8},"end":{"line":151,"column":34}},"71":{"start":{"line":156,"column":6},"end":{"line":156,"column":81}},"72":{"start":{"line":158,"column":6},"end":{"line":158,"column":47}},"73":{"start":{"line":159,"column":6},"end":{"line":159,"column":31}},"74":{"start":{"line":161,"column":6},"end":{"line":174,"column":7}},"75":{"start":{"line":163,"column":8},"end":{"line":163,"column":37}},"76":{"start":{"line":165,"column":8},"end":{"line":165,"column":71}},"77":{"start":{"line":165,"column":37},"end":{"line":165,"column":71}},"78":{"start":{"line":167,"column":8},"end":{"line":167,"column":44}},"79":{"start":{"line":172,"column":8},"end":{"line":172,"column":28}},"80":{"start":{"line":173,"column":8},"end":{"line":173,"column":57}},"81":{"start":{"line":179,"column":2},"end":{"line":179,"column":26}},"82":{"start":{"line":181,"column":2},"end":{"line":187,"column":3}},"83":{"start":{"line":183,"column":4},"end":{"line":183,"column":66}},"84":{"start":{"line":183,"column":38},"end":{"line":183,"column":66}},"85":{"start":{"line":184,"column":4},"end":{"line":184,"column":66}},"86":{"start":{"line":184,"column":31},"end":{"line":184,"column":66}},"87":{"start":{"line":186,"column":4},"end":{"line":186,"column":42}},"88":{"start":{"line":190,"column":2},"end":{"line":198,"column":3}},"89":{"start":{"line":191,"column":4},"end":{"line":197,"column":6}},"90":{"start":{"line":192,"column":6},"end":{"line":192,"column":34}},"91":{"start":{"line":193,"column":6},"end":{"line":196,"column":8}},"92":{"start":{"line":194,"column":8},"end":{"line":194,"column":19}},"93":{"start":{"line":195,"column":8},"end":{"line":195,"column":37}},"94":{"start":{"line":201,"column":2},"end":{"line":201,"column":62}},"95":{"start":{"line":201,"column":36},"end":{"line":201,"column":62}},"96":{"start":{"line":202,"column":2},"end":{"line":202,"column":11}},"97":{"start":{"line":205,"column":2},"end":{"line":205,"column":24}},"98":{"start":{"line":206,"column":2},"end":{"line":206,"column":22}},"99":{"start":{"line":207,"column":2},"end":{"line":207,"column":12}},"100":{"start":{"line":210,"column":0},"end":{"line":212,"column":1}},"101":{"start":{"line":211,"column":2},"end":{"line":211,"column":33}},"102":{"start":{"line":215,"column":0},"end":{"line":215,"column":54}},"103":{"start":{"line":217,"column":0},"end":{"line":221,"column":1}},"104":{"start":{"line":218,"column":2},"end":{"line":220,"column":3}},"105":{"start":{"line":219,"column":4},"end":{"line":219,"column":84}},"106":{"start":{"line":223,"column":0},"end":{"line":223,"column":22}}},"branchMap":{"1":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":2},"end":{"line":43,"column":2}},{"start":{"line":43,"column":2},"end":{"line":43,"column":2}}]},"2":{"line":43,"type":"binary-expr","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":12}},{"start":{"line":43,"column":16},"end":{"line":43,"column":29}},{"start":{"line":43,"column":33},"end":{"line":43,"column":51}}]},"3":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":9},"end":{"line":45,"column":9}},{"start":{"line":45,"column":9},"end":{"line":45,"column":9}}]},"4":{"line":45,"type":"binary-expr","locations":[{"start":{"line":45,"column":13},"end":{"line":45,"column":19}},{"start":{"line":45,"column":23},"end":{"line":45,"column":36}},{"start":{"line":45,"column":40},"end":{"line":45,"column":66}},{"start":{"line":45,"column":70},"end":{"line":45,"column":88}}]},"5":{"line":46,"type":"switch","locations":[{"start":{"line":47,"column":6},"end":{"line":49,"column":13}},{"start":{"line":50,"column":6},"end":{"line":52,"column":13}},{"start":{"line":53,"column":6},"end":{"line":54,"column":31}}]},"6":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":2},"end":{"line":59,"column":2}},{"start":{"line":59,"column":2},"end":{"line":59,"column":2}}]},"7":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":60,"column":4}},{"start":{"line":60,"column":4},"end":{"line":60,"column":4}}]},"8":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":6},"end":{"line":61,"column":6}},{"start":{"line":61,"column":6},"end":{"line":61,"column":6}}]},"9":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":2},"end":{"line":75,"column":2}},{"start":{"line":75,"column":2},"end":{"line":75,"column":2}}]},"10":{"line":79,"type":"binary-expr","locations":[{"start":{"line":79,"column":24},"end":{"line":79,"column":32}},{"start":{"line":79,"column":36},"end":{"line":79,"column":38}}]},"11":{"line":81,"type":"binary-expr","locations":[{"start":{"line":81,"column":10},"end":{"line":81,"column":24}},{"start":{"line":81,"column":29},"end":{"line":81,"column":43}}]},"12":{"line":81,"type":"cond-expr","locations":[{"start":{"line":81,"column":35},"end":{"line":81,"column":38}},{"start":{"line":81,"column":41},"end":{"line":81,"column":43}}]},"13":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":2},"end":{"line":88,"column":2}},{"start":{"line":88,"column":2},"end":{"line":88,"column":2}}]},"14":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":9},"end":{"line":90,"column":9}},{"start":{"line":90,"column":9},"end":{"line":90,"column":9}}]},"15":{"line":90,"type":"binary-expr","locations":[{"start":{"line":90,"column":13},"end":{"line":90,"column":23}},{"start":{"line":90,"column":27},"end":{"line":90,"column":37}}]},"16":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":9},"end":{"line":92,"column":9}},{"start":{"line":92,"column":9},"end":{"line":92,"column":9}}]},"17":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":2},"end":{"line":98,"column":2}},{"start":{"line":98,"column":2},"end":{"line":98,"column":2}}]},"18":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":33},"end":{"line":99,"column":39}},{"start":{"line":99,"column":43},"end":{"line":99,"column":48}}]},"19":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":50},"end":{"line":99,"column":59}},{"start":{"line":99,"column":63},"end":{"line":99,"column":68}}]},"20":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":70},"end":{"line":99,"column":77}},{"start":{"line":99,"column":81},"end":{"line":99,"column":86}}]},"21":{"line":121,"type":"cond-expr","locations":[{"start":{"line":121,"column":19},"end":{"line":121,"column":24}},{"start":{"line":121,"column":27},"end":{"line":121,"column":31}}]},"22":{"line":136,"type":"if","locations":[{"start":{"line":136,"column":6},"end":{"line":136,"column":6}},{"start":{"line":136,"column":6},"end":{"line":136,"column":6}}]},"23":{"line":136,"type":"binary-expr","locations":[{"start":{"line":136,"column":10},"end":{"line":136,"column":31}},{"start":{"line":136,"column":35},"end":{"line":136,"column":57}}]},"24":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":6},"end":{"line":148,"column":6}},{"start":{"line":148,"column":6},"end":{"line":148,"column":6}}]},"25":{"line":148,"type":"binary-expr","locations":[{"start":{"line":148,"column":10},"end":{"line":148,"column":28}},{"start":{"line":148,"column":32},"end":{"line":148,"column":57}}]},"26":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":13},"end":{"line":150,"column":13}},{"start":{"line":150,"column":13},"end":{"line":150,"column":13}}]},"27":{"line":156,"type":"binary-expr","locations":[{"start":{"line":156,"column":22},"end":{"line":156,"column":39}},{"start":{"line":156,"column":43},"end":{"line":156,"column":59}},{"start":{"line":156,"column":63},"end":{"line":156,"column":81}}]},"28":{"line":158,"type":"cond-expr","locations":[{"start":{"line":158,"column":42},"end":{"line":158,"column":43}},{"start":{"line":158,"column":46},"end":{"line":158,"column":47}}]},"29":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":6},"end":{"line":161,"column":6}},{"start":{"line":161,"column":6},"end":{"line":161,"column":6}}]},"30":{"line":165,"type":"if","locations":[{"start":{"line":165,"column":8},"end":{"line":165,"column":8}},{"start":{"line":165,"column":8},"end":{"line":165,"column":8}}]},"31":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":4},"end":{"line":183,"column":4}},{"start":{"line":183,"column":4},"end":{"line":183,"column":4}}]},"32":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":4},"end":{"line":184,"column":4}},{"start":{"line":184,"column":4},"end":{"line":184,"column":4}}]},"33":{"line":190,"type":"if","locations":[{"start":{"line":190,"column":2},"end":{"line":190,"column":2}},{"start":{"line":190,"column":2},"end":{"line":190,"column":2}}]},"34":{"line":190,"type":"binary-expr","locations":[{"start":{"line":190,"column":6},"end":{"line":190,"column":15}},{"start":{"line":190,"column":19},"end":{"line":190,"column":32}}]},"35":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":2},"end":{"line":201,"column":2}},{"start":{"line":201,"column":2},"end":{"line":201,"column":2}}]},"36":{"line":201,"type":"binary-expr","locations":[{"start":{"line":201,"column":6},"end":{"line":201,"column":24}},{"start":{"line":201,"column":28},"end":{"line":201,"column":34}}]}}},"/Users/alz/dev/git/najax/lib/parse-options.js":{"path":"/Users/alz/dev/git/najax/lib/parse-options.js","s":{"1":1,"2":1,"3":95,"4":95,"5":31,"6":64,"7":95,"8":43,"9":52,"10":7,"11":52,"12":95,"13":95},"b":{"1":[31,64],"2":[43,52],"3":[7,45],"4":[95,54]},"f":{"1":95},"fnMap":{"1":{"name":"parseOptions","line":3,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":64}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},"2":{"start":{"line":3,"column":0},"end":{"line":21,"column":1}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":15}},"4":{"start":{"line":5,"column":2},"end":{"line":9,"column":3}},"5":{"start":{"line":6,"column":4},"end":{"line":6,"column":18}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":23}},"7":{"start":{"line":10,"column":2},"end":{"line":15,"column":3}},"8":{"start":{"line":11,"column":4},"end":{"line":11,"column":26}},"9":{"start":{"line":13,"column":4},"end":{"line":13,"column":55}},"10":{"start":{"line":13,"column":32},"end":{"line":13,"column":55}},"11":{"start":{"line":14,"column":4},"end":{"line":14,"column":27}},"12":{"start":{"line":18,"column":2},"end":{"line":18,"column":40}},"13":{"start":{"line":20,"column":2},"end":{"line":20,"column":13}}},"branchMap":{"1":{"line":5,"type":"if","locations":[{"start":{"line":5,"column":2},"end":{"line":5,"column":2}},{"start":{"line":5,"column":2},"end":{"line":5,"column":2}}]},"2":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":2},"end":{"line":10,"column":2}},{"start":{"line":10,"column":2},"end":{"line":10,"column":2}}]},"3":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":13,"column":4}},{"start":{"line":13,"column":4},"end":{"line":13,"column":4}}]},"4":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":16},"end":{"line":18,"column":27}},{"start":{"line":18,"column":31},"end":{"line":18,"column":40}}]}}}}
{"/Users/alz/dev/git/najax/lib/najax.js":{"path":"/Users/alz/dev/git/najax/lib/najax.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":63,"13":63,"14":63,"15":63,"16":63,"17":1,"18":62,"19":2,"20":1,"21":1,"22":1,"23":1,"24":0,"25":63,"26":6,"27":1,"28":0,"29":1,"30":5,"31":63,"32":1,"33":63,"34":63,"35":5,"36":58,"37":5,"38":53,"39":5,"40":63,"41":63,"42":0,"43":0,"44":1,"45":252,"46":0,"47":0,"48":63,"49":63,"50":61,"51":1,"52":61,"53":1,"54":1,"55":2,"56":1,"57":1,"58":61,"59":61,"60":0,"61":0,"62":0,"63":61,"64":61,"65":61,"66":0,"67":61,"68":0,"69":61,"70":61,"71":61,"72":61,"73":61,"74":0,"75":0,"76":61,"77":61,"78":61,"79":61,"80":61,"81":61,"82":61,"83":4,"84":4,"85":0,"86":4,"87":57,"88":4,"89":4,"90":0,"91":4,"92":53,"93":63,"94":1,"95":4,"96":0,"97":4,"98":63,"99":2,"100":2,"101":2,"102":2,"103":63,"104":5,"105":63,"106":63,"107":63,"108":63,"109":63,"110":63,"111":63,"112":63,"113":1,"114":3,"115":1,"116":1,"117":4,"118":50,"119":1},"b":{"1":[1,62],"2":[63,6,6],"3":[2,60],"4":[62,5,5,2],"5":[1,1,0],"6":[6,57],"7":[1,5],"8":[0,1],"9":[1,62],"10":[63,62],"11":[63,53],"12":[5,48],"13":[5,58],"14":[5,53],"15":[58,5],"16":[5,48],"17":[0,63],"18":[0,0],"19":[0,0],"20":[0,0],"21":[5,58],"22":[0,61],"23":[61,61],"24":[0,61],"25":[61,61],"26":[0,61],"27":[61,61,0],"28":[61,0],"29":[61,0],"30":[4,57],"31":[0,4],"32":[4,53],"33":[0,4],"34":[0,4],"35":[2,61],"36":[63,2],"37":[5,58],"38":[63,52]},"f":{"1":1,"2":63,"3":252,"4":0,"5":61,"6":1,"7":1,"8":61,"9":61,"10":61,"11":4,"12":4,"13":4,"14":2,"15":3,"16":4,"17":50},"fnMap":{"1":{"name":"(anonymous_1)","line":21,"loc":{"start":{"line":21,"column":20},"end":{"line":21,"column":43}}},"2":{"name":"najax","line":32,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":40}}},"3":{"name":"notImplemented","line":104,"loc":{"start":{"line":104,"column":2},"end":{"line":104,"column":33}}},"4":{"name":"(anonymous_4)","line":105,"loc":{"start":{"line":105,"column":11},"end":{"line":105,"column":23}}},"5":{"name":"(anonymous_5)","line":121,"loc":{"start":{"line":121,"column":50},"end":{"line":121,"column":65}}},"6":{"name":"getResponseHeader","line":123,"loc":{"start":{"line":123,"column":54},"end":{"line":123,"column":90}}},"7":{"name":"getAllResponseHeaders","line":126,"loc":{"start":{"line":126,"column":62},"end":{"line":126,"column":96}}},"8":{"name":"dataHandler","line":134,"loc":{"start":{"line":134,"column":4},"end":{"line":134,"column":32}}},"9":{"name":"(anonymous_9)","line":173,"loc":{"start":{"line":173,"column":19},"end":{"line":173,"column":36}}},"10":{"name":"(anonymous_10)","line":174,"loc":{"start":{"line":174,"column":18},"end":{"line":174,"column":30}}},"11":{"name":"(anonymous_11)","line":178,"loc":{"start":{"line":178,"column":28},"end":{"line":178,"column":51}}},"12":{"name":"(anonymous_12)","line":186,"loc":{"start":{"line":186,"column":29},"end":{"line":186,"column":52}}},"13":{"name":"onError","line":202,"loc":{"start":{"line":202,"column":2},"end":{"line":202,"column":23}}},"14":{"name":"(anonymous_14)","line":211,"loc":{"start":{"line":211,"column":30},"end":{"line":211,"column":42}}},"15":{"name":"defaults","line":232,"loc":{"start":{"line":232,"column":17},"end":{"line":232,"column":42}}},"16":{"name":"handleMethod","line":239,"loc":{"start":{"line":239,"column":0},"end":{"line":239,"column":31}}},"17":{"name":"methodHandler","line":240,"loc":{"start":{"line":240,"column":32},"end":{"line":240,"column":80}}}},"statementMap":{"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":28}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":26}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":40}},"4":{"start":{"line":9,"column":0},"end":{"line":9,"column":24}},"5":{"start":{"line":10,"column":0},"end":{"line":10,"column":26}},"6":{"start":{"line":11,"column":0},"end":{"line":11,"column":34}},"7":{"start":{"line":12,"column":0},"end":{"line":12,"column":25}},"8":{"start":{"line":13,"column":0},"end":{"line":13,"column":45}},"9":{"start":{"line":14,"column":0},"end":{"line":24,"column":1}},"10":{"start":{"line":22,"column":4},"end":{"line":22,"column":30}},"11":{"start":{"line":32,"column":0},"end":{"line":230,"column":1}},"12":{"start":{"line":33,"column":2},"end":{"line":33,"column":28}},"13":{"start":{"line":34,"column":2},"end":{"line":34,"column":70}},"14":{"start":{"line":35,"column":2},"end":{"line":35,"column":26}},"15":{"start":{"line":36,"column":2},"end":{"line":36,"column":45}},"16":{"start":{"line":43,"column":2},"end":{"line":56,"column":3}},"17":{"start":{"line":44,"column":4},"end":{"line":44,"column":42}},"18":{"start":{"line":45,"column":9},"end":{"line":56,"column":3}},"19":{"start":{"line":46,"column":4},"end":{"line":55,"column":5}},"20":{"start":{"line":48,"column":8},"end":{"line":48,"column":39}},"21":{"start":{"line":49,"column":8},"end":{"line":49,"column":13}},"22":{"start":{"line":51,"column":8},"end":{"line":51,"column":46}},"23":{"start":{"line":52,"column":8},"end":{"line":52,"column":13}},"24":{"start":{"line":54,"column":8},"end":{"line":54,"column":31}},"25":{"start":{"line":59,"column":2},"end":{"line":73,"column":3}},"26":{"start":{"line":60,"column":4},"end":{"line":72,"column":5}},"27":{"start":{"line":61,"column":6},"end":{"line":65,"column":7}},"28":{"start":{"line":62,"column":8},"end":{"line":62,"column":32}},"29":{"start":{"line":64,"column":8},"end":{"line":64,"column":31}},"30":{"start":{"line":68,"column":6},"end":{"line":71,"column":19}},"31":{"start":{"line":75,"column":2},"end":{"line":75,"column":35}},"32":{"start":{"line":75,"column":20},"end":{"line":75,"column":35}},"33":{"start":{"line":77,"column":2},"end":{"line":84,"column":3}},"34":{"start":{"line":88,"column":2},"end":{"line":94,"column":3}},"35":{"start":{"line":89,"column":4},"end":{"line":89,"column":25}},"36":{"start":{"line":90,"column":9},"end":{"line":94,"column":3}},"37":{"start":{"line":91,"column":4},"end":{"line":91,"column":48}},"38":{"start":{"line":92,"column":9},"end":{"line":94,"column":3}},"39":{"start":{"line":93,"column":4},"end":{"line":93,"column":25}},"40":{"start":{"line":96,"column":2},"end":{"line":96,"column":49}},"41":{"start":{"line":98,"column":2},"end":{"line":101,"column":3}},"42":{"start":{"line":99,"column":4},"end":{"line":99,"column":87}},"43":{"start":{"line":100,"column":4},"end":{"line":100,"column":18}},"44":{"start":{"line":104,"column":2},"end":{"line":109,"column":3}},"45":{"start":{"line":105,"column":4},"end":{"line":108,"column":5}},"46":{"start":{"line":106,"column":6},"end":{"line":106,"column":73}},"47":{"start":{"line":107,"column":6},"end":{"line":107,"column":21}},"48":{"start":{"line":111,"column":2},"end":{"line":119,"column":3}},"49":{"start":{"line":121,"column":2},"end":{"line":197,"column":4}},"50":{"start":{"line":123,"column":4},"end":{"line":125,"column":5}},"51":{"start":{"line":124,"column":6},"end":{"line":124,"column":46}},"52":{"start":{"line":126,"column":4},"end":{"line":132,"column":5}},"53":{"start":{"line":127,"column":6},"end":{"line":127,"column":22}},"54":{"start":{"line":128,"column":6},"end":{"line":130,"column":7}},"55":{"start":{"line":129,"column":8},"end":{"line":129,"column":51}},"56":{"start":{"line":131,"column":6},"end":{"line":131,"column":31}},"57":{"start":{"line":134,"column":4},"end":{"line":171,"column":5}},"58":{"start":{"line":135,"column":6},"end":{"line":135,"column":31}},"59":{"start":{"line":136,"column":6},"end":{"line":143,"column":7}},"60":{"start":{"line":138,"column":8},"end":{"line":142,"column":9}},"61":{"start":{"line":139,"column":10},"end":{"line":139,"column":60}},"62":{"start":{"line":141,"column":10},"end":{"line":141,"column":27}},"63":{"start":{"line":145,"column":6},"end":{"line":145,"column":37}},"64":{"start":{"line":146,"column":6},"end":{"line":146,"column":34}},"65":{"start":{"line":148,"column":6},"end":{"line":152,"column":7}},"66":{"start":{"line":149,"column":8},"end":{"line":149,"column":38}},"67":{"start":{"line":150,"column":13},"end":{"line":152,"column":7}},"68":{"start":{"line":151,"column":8},"end":{"line":151,"column":40}},"69":{"start":{"line":156,"column":6},"end":{"line":156,"column":81}},"70":{"start":{"line":158,"column":6},"end":{"line":158,"column":47}},"71":{"start":{"line":159,"column":6},"end":{"line":159,"column":31}},"72":{"start":{"line":161,"column":6},"end":{"line":170,"column":7}},"73":{"start":{"line":163,"column":8},"end":{"line":163,"column":50}},"74":{"start":{"line":168,"column":8},"end":{"line":168,"column":34}},"75":{"start":{"line":169,"column":8},"end":{"line":169,"column":57}},"76":{"start":{"line":172,"column":4},"end":{"line":172,"column":19}},"77":{"start":{"line":173,"column":4},"end":{"line":173,"column":59}},"78":{"start":{"line":173,"column":38},"end":{"line":173,"column":57}},"79":{"start":{"line":174,"column":4},"end":{"line":196,"column":6}},"80":{"start":{"line":175,"column":6},"end":{"line":175,"column":40}},"81":{"start":{"line":176,"column":6},"end":{"line":176,"column":52}},"82":{"start":{"line":177,"column":6},"end":{"line":195,"column":7}},"83":{"start":{"line":178,"column":8},"end":{"line":184,"column":10}},"84":{"start":{"line":179,"column":10},"end":{"line":183,"column":11}},"85":{"start":{"line":180,"column":12},"end":{"line":180,"column":24}},"86":{"start":{"line":182,"column":12},"end":{"line":182,"column":42}},"87":{"start":{"line":185,"column":13},"end":{"line":195,"column":7}},"88":{"start":{"line":186,"column":8},"end":{"line":192,"column":10}},"89":{"start":{"line":187,"column":10},"end":{"line":191,"column":11}},"90":{"start":{"line":188,"column":12},"end":{"line":188,"column":24}},"91":{"start":{"line":190,"column":12},"end":{"line":190,"column":42}},"92":{"start":{"line":194,"column":8},"end":{"line":194,"column":38}},"93":{"start":{"line":200,"column":2},"end":{"line":200,"column":26}},"94":{"start":{"line":202,"column":2},"end":{"line":207,"column":3}},"95":{"start":{"line":204,"column":4},"end":{"line":204,"column":66}},"96":{"start":{"line":204,"column":38},"end":{"line":204,"column":66}},"97":{"start":{"line":206,"column":4},"end":{"line":206,"column":42}},"98":{"start":{"line":210,"column":2},"end":{"line":216,"column":3}},"99":{"start":{"line":211,"column":4},"end":{"line":215,"column":6}},"100":{"start":{"line":212,"column":6},"end":{"line":212,"column":17}},"101":{"start":{"line":213,"column":6},"end":{"line":213,"column":34}},"102":{"start":{"line":214,"column":6},"end":{"line":214,"column":35}},"103":{"start":{"line":219,"column":2},"end":{"line":219,"column":62}},"104":{"start":{"line":219,"column":36},"end":{"line":219,"column":62}},"105":{"start":{"line":220,"column":2},"end":{"line":220,"column":11}},"106":{"start":{"line":223,"column":2},"end":{"line":223,"column":21}},"107":{"start":{"line":224,"column":2},"end":{"line":224,"column":22}},"108":{"start":{"line":225,"column":2},"end":{"line":225,"column":19}},"109":{"start":{"line":226,"column":2},"end":{"line":226,"column":22}},"110":{"start":{"line":227,"column":2},"end":{"line":227,"column":24}},"111":{"start":{"line":228,"column":2},"end":{"line":228,"column":22}},"112":{"start":{"line":229,"column":2},"end":{"line":229,"column":12}},"113":{"start":{"line":232,"column":0},"end":{"line":234,"column":1}},"114":{"start":{"line":233,"column":2},"end":{"line":233,"column":33}},"115":{"start":{"line":237,"column":0},"end":{"line":237,"column":54}},"116":{"start":{"line":239,"column":0},"end":{"line":243,"column":1}},"117":{"start":{"line":240,"column":2},"end":{"line":242,"column":3}},"118":{"start":{"line":241,"column":4},"end":{"line":241,"column":84}},"119":{"start":{"line":245,"column":0},"end":{"line":245,"column":22}}},"branchMap":{"1":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":2},"end":{"line":43,"column":2}},{"start":{"line":43,"column":2},"end":{"line":43,"column":2}}]},"2":{"line":43,"type":"binary-expr","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":12}},{"start":{"line":43,"column":16},"end":{"line":43,"column":29}},{"start":{"line":43,"column":33},"end":{"line":43,"column":51}}]},"3":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":9},"end":{"line":45,"column":9}},{"start":{"line":45,"column":9},"end":{"line":45,"column":9}}]},"4":{"line":45,"type":"binary-expr","locations":[{"start":{"line":45,"column":13},"end":{"line":45,"column":19}},{"start":{"line":45,"column":23},"end":{"line":45,"column":36}},{"start":{"line":45,"column":40},"end":{"line":45,"column":66}},{"start":{"line":45,"column":70},"end":{"line":45,"column":88}}]},"5":{"line":46,"type":"switch","locations":[{"start":{"line":47,"column":6},"end":{"line":49,"column":13}},{"start":{"line":50,"column":6},"end":{"line":52,"column":13}},{"start":{"line":53,"column":6},"end":{"line":54,"column":31}}]},"6":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":2},"end":{"line":59,"column":2}},{"start":{"line":59,"column":2},"end":{"line":59,"column":2}}]},"7":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":60,"column":4}},{"start":{"line":60,"column":4},"end":{"line":60,"column":4}}]},"8":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":6},"end":{"line":61,"column":6}},{"start":{"line":61,"column":6},"end":{"line":61,"column":6}}]},"9":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":2},"end":{"line":75,"column":2}},{"start":{"line":75,"column":2},"end":{"line":75,"column":2}}]},"10":{"line":79,"type":"binary-expr","locations":[{"start":{"line":79,"column":24},"end":{"line":79,"column":32}},{"start":{"line":79,"column":36},"end":{"line":79,"column":38}}]},"11":{"line":81,"type":"binary-expr","locations":[{"start":{"line":81,"column":10},"end":{"line":81,"column":24}},{"start":{"line":81,"column":29},"end":{"line":81,"column":43}}]},"12":{"line":81,"type":"cond-expr","locations":[{"start":{"line":81,"column":35},"end":{"line":81,"column":38}},{"start":{"line":81,"column":41},"end":{"line":81,"column":43}}]},"13":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":2},"end":{"line":88,"column":2}},{"start":{"line":88,"column":2},"end":{"line":88,"column":2}}]},"14":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":9},"end":{"line":90,"column":9}},{"start":{"line":90,"column":9},"end":{"line":90,"column":9}}]},"15":{"line":90,"type":"binary-expr","locations":[{"start":{"line":90,"column":13},"end":{"line":90,"column":23}},{"start":{"line":90,"column":27},"end":{"line":90,"column":37}}]},"16":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":9},"end":{"line":92,"column":9}},{"start":{"line":92,"column":9},"end":{"line":92,"column":9}}]},"17":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":2},"end":{"line":98,"column":2}},{"start":{"line":98,"column":2},"end":{"line":98,"column":2}}]},"18":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":33},"end":{"line":99,"column":39}},{"start":{"line":99,"column":43},"end":{"line":99,"column":48}}]},"19":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":50},"end":{"line":99,"column":59}},{"start":{"line":99,"column":63},"end":{"line":99,"column":68}}]},"20":{"line":99,"type":"binary-expr","locations":[{"start":{"line":99,"column":70},"end":{"line":99,"column":77}},{"start":{"line":99,"column":81},"end":{"line":99,"column":86}}]},"21":{"line":121,"type":"cond-expr","locations":[{"start":{"line":121,"column":19},"end":{"line":121,"column":24}},{"start":{"line":121,"column":27},"end":{"line":121,"column":31}}]},"22":{"line":136,"type":"if","locations":[{"start":{"line":136,"column":6},"end":{"line":136,"column":6}},{"start":{"line":136,"column":6},"end":{"line":136,"column":6}}]},"23":{"line":136,"type":"binary-expr","locations":[{"start":{"line":136,"column":10},"end":{"line":136,"column":31}},{"start":{"line":136,"column":35},"end":{"line":136,"column":57}}]},"24":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":6},"end":{"line":148,"column":6}},{"start":{"line":148,"column":6},"end":{"line":148,"column":6}}]},"25":{"line":148,"type":"binary-expr","locations":[{"start":{"line":148,"column":10},"end":{"line":148,"column":28}},{"start":{"line":148,"column":32},"end":{"line":148,"column":57}}]},"26":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":13},"end":{"line":150,"column":13}},{"start":{"line":150,"column":13},"end":{"line":150,"column":13}}]},"27":{"line":156,"type":"binary-expr","locations":[{"start":{"line":156,"column":22},"end":{"line":156,"column":39}},{"start":{"line":156,"column":43},"end":{"line":156,"column":59}},{"start":{"line":156,"column":63},"end":{"line":156,"column":81}}]},"28":{"line":158,"type":"cond-expr","locations":[{"start":{"line":158,"column":42},"end":{"line":158,"column":43}},{"start":{"line":158,"column":46},"end":{"line":158,"column":47}}]},"29":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":6},"end":{"line":161,"column":6}},{"start":{"line":161,"column":6},"end":{"line":161,"column":6}}]},"30":{"line":177,"type":"if","locations":[{"start":{"line":177,"column":6},"end":{"line":177,"column":6}},{"start":{"line":177,"column":6},"end":{"line":177,"column":6}}]},"31":{"line":179,"type":"if","locations":[{"start":{"line":179,"column":10},"end":{"line":179,"column":10}},{"start":{"line":179,"column":10},"end":{"line":179,"column":10}}]},"32":{"line":185,"type":"if","locations":[{"start":{"line":185,"column":13},"end":{"line":185,"column":13}},{"start":{"line":185,"column":13},"end":{"line":185,"column":13}}]},"33":{"line":187,"type":"if","locations":[{"start":{"line":187,"column":10},"end":{"line":187,"column":10}},{"start":{"line":187,"column":10},"end":{"line":187,"column":10}}]},"34":{"line":204,"type":"if","locations":[{"start":{"line":204,"column":4},"end":{"line":204,"column":4}},{"start":{"line":204,"column":4},"end":{"line":204,"column":4}}]},"35":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":2},"end":{"line":210,"column":2}},{"start":{"line":210,"column":2},"end":{"line":210,"column":2}}]},"36":{"line":210,"type":"binary-expr","locations":[{"start":{"line":210,"column":6},"end":{"line":210,"column":15}},{"start":{"line":210,"column":19},"end":{"line":210,"column":32}}]},"37":{"line":219,"type":"if","locations":[{"start":{"line":219,"column":2},"end":{"line":219,"column":2}},{"start":{"line":219,"column":2},"end":{"line":219,"column":2}}]},"38":{"line":219,"type":"binary-expr","locations":[{"start":{"line":219,"column":6},"end":{"line":219,"column":24}},{"start":{"line":219,"column":28},"end":{"line":219,"column":34}}]}}},"/Users/alz/dev/git/najax/lib/parse-options.js":{"path":"/Users/alz/dev/git/najax/lib/parse-options.js","s":{"1":1,"2":1,"3":113,"4":113,"5":40,"6":73,"7":113,"8":51,"9":62,"10":7,"11":62,"12":113,"13":113},"b":{"1":[40,73],"2":[51,62],"3":[7,55],"4":[113,63]},"f":{"1":113},"fnMap":{"1":{"name":"parseOptions","line":3,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":64}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},"2":{"start":{"line":3,"column":0},"end":{"line":21,"column":1}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":15}},"4":{"start":{"line":5,"column":2},"end":{"line":9,"column":3}},"5":{"start":{"line":6,"column":4},"end":{"line":6,"column":18}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":23}},"7":{"start":{"line":10,"column":2},"end":{"line":15,"column":3}},"8":{"start":{"line":11,"column":4},"end":{"line":11,"column":26}},"9":{"start":{"line":13,"column":4},"end":{"line":13,"column":55}},"10":{"start":{"line":13,"column":32},"end":{"line":13,"column":55}},"11":{"start":{"line":14,"column":4},"end":{"line":14,"column":27}},"12":{"start":{"line":18,"column":2},"end":{"line":18,"column":40}},"13":{"start":{"line":20,"column":2},"end":{"line":20,"column":13}}},"branchMap":{"1":{"line":5,"type":"if","locations":[{"start":{"line":5,"column":2},"end":{"line":5,"column":2}},{"start":{"line":5,"column":2},"end":{"line":5,"column":2}}]},"2":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":2},"end":{"line":10,"column":2}},{"start":{"line":10,"column":2},"end":{"line":10,"column":2}}]},"3":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":13,"column":4}},{"start":{"line":13,"column":4},"end":{"line":13,"column":4}}]},"4":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":16},"end":{"line":18,"column":27}},{"start":{"line":18,"column":31},"end":{"line":18,"column":40}}]}}}}

@@ -8,3 +8,3 @@ /* najax

var http = require('http')
var querystring = require('querystring')
var querystring = require('qs')
var url = require('url')

@@ -76,5 +76,3 @@ var zlib = require('zlib')

if (o.beforeSend) {
o.beforeSend(o)
}
if (o.beforeSend) o.beforeSend(o)

@@ -125,16 +123,8 @@ options = {

function errorHandler (e) {
// Set data for the fake xhr object
jqXHR.responseText = e instanceof Error ? e.stack : e
if (_.isFunction(o.error)) o.error(jqXHR, 'error', e)
// jqXHR, statusText, error
dfd.reject(jqXHR, 'error', e)
}
var req = (ssl ? https : http).request(options, function (res) {
// Allow getting Response Headers from the XMLHTTPRequest object
dfd.getResponseHeader = jqXHR.getResponseHeader = function (header) {
dfd.getResponseHeader = jqXHR.getResponseHeader = function getResponseHeader (header) {
return res.headers[header.toLowerCase()]
}
dfd.getAllResponseHeaders = jqXHR.getAllResponseHeaders = function () {
dfd.getAllResponseHeaders = jqXHR.getAllResponseHeaders = function getAllResponseHeaders () {
var headers = []

@@ -154,3 +144,3 @@ for (var key in res.headers) {

} catch (e) {
return errorHandler(e)
return onError(e)
}

@@ -160,8 +150,8 @@ }

var statusCode = res.statusCode
var statusText = 'success'
jqXHR.statusText = 'success'
if (statusCode === 204 || options.method === 'HEAD') {
statusText = 'nocontent'
jqXHR.statusText = 'nocontent'
} else if (statusCode === 304) {
statusText = 'notmodified'
jqXHR.statusText = 'notmodified'
}

@@ -177,6 +167,4 @@

if (isSuccess) {
// Set data for the fake xhr object
jqXHR.statusText = statusText
// success, statusText, jqXHR
dfd.resolve(data, statusText, jqXHR)
dfd.resolve(data, jqXHR.statusText, jqXHR)
} else {

@@ -186,4 +174,4 @@ // jqXHR, statusText, error

// HTTP status, such as "Not Found" or "Internal Server Error."
statusText = 'error'
dfd.reject(jqXHR, statusText, http.STATUS_CODES[statusCode])
jqXHR.statusText = 'error'
onError(new Error(http.STATUS_CODES[statusCode]))
}

@@ -199,3 +187,3 @@ }

if (err) {
errorHandler(err)
onError(err)
} else {

@@ -208,3 +196,3 @@ dataHandler(buffer.toString())

if (err) {
errorHandler(err)
onError(err)
} else {

@@ -221,4 +209,11 @@ dataHandler(buffer.toString())

// ERROR
req.on('error', errorHandler)
req.on('error', onError)
function onError (e) {
// Set data for the fake xhr object
if (jqXHR.statusText === 'error') jqXHR.responseText = e.stack
// jqXHR, statusText, error
dfd.reject(jqXHR, jqXHR.statusText, e)
}
// SET TIMEOUT

@@ -228,3 +223,4 @@ if (o.timeout && o.timeout > 0) {

req.abort()
dfd.reject(jqXHR, 'timeout')
jqXHR.statusText = 'timeout'
onError(new Error('timeout'))
})

@@ -247,3 +243,3 @@ }

najax.defaults = function (opts) {
najax.defaults = function defaults (opts) {
return _.extend(defaults, opts)

@@ -253,8 +249,10 @@ }

/* auto rest interface go! */
_.each(['GET', 'POST', 'PUT', 'DELETE'], function (method) {
najax[method.toLowerCase()] = function (uri, options, callback) {
_.each(['GET', 'POST', 'PUT', 'DELETE'], handleMethod)
function handleMethod (method) {
najax[method.toLowerCase()] = function methodHandler (uri, options, callback) {
return najax(_.extend(parseOptions(uri, options, callback), { method: method }))
}
})
}
module.exports = najax
{
"name": "najax",
"description": "jquery ajax-stye http requests in node",
"version": "0.6.0",
"version": "0.7.0",
"homepage": "https://github.com/najaxjs/najax",

@@ -45,3 +45,4 @@ "author": "Alan Clarke <self@alz.so> (alz.so)",

"jquery-deferred": "^0.3.0",
"lodash": "^4.6.1"
"lodash": "^4.6.1",
"qs": "^6.2.0"
},

@@ -48,0 +49,0 @@ "directories": {

@@ -13,26 +13,4 @@ # najax

It features very flexible method overloads to suit various styles, including with jquery style deferreds.
In addition to najax.get, , handles ssl and makes some reasonable assumptions based on inputs and everything can be overridden by passing an options object.
It seamlessly handles ssl and makes some reasonable assumptions based on inputs but as usual everything can be overridden by passing an options object.
## Changelog
### 0.5.0
* Support gzip and deflate.
* End support for Node 0.10.
### 0.3.0
* switched from underscore to lodash
### 0.2.0
**Breaking changes!**
* `success` and `error` callback arguments are now in [jQuery.ajax](https://api.jquery.com/jquery.ajax/) order and format.
* `contentType` must now be the full string, i.e. `application/json`, not just `json`.
* Undocumented `encoder` option deprecated. Any object can already override its own `toString()`.
* CRLF (`\n`) removed from end of POST message body. It did not match HTTP spec.
## Getting Started

@@ -43,3 +21,3 @@ Install the module with: `npm install najax`

var najax = $ = require('najax')
najax('http://www.google.com', callback)
$.get('http://www.google.com', callback)
najax('http://www.google.com', { type: 'POST' }, callback)

@@ -46,0 +24,0 @@ najax({ url: 'http://www.google.com', type: 'POST', success: callback })

@@ -205,2 +205,10 @@ /* globals describe beforeEach it */

it('should support nested urlencoded objects, because you could just content-type=json but yolo', function (done) {
nock('http://www.example.com')
.post('/', 'a=1&b%5Bc%5D=1')
.matchHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8')
.reply(200, 'ok')
najax.post('http://www.example.com', { data: { a: 1, b: { c: 1 } } }, createSuccess(done))
})
it('should pass correct headers for json data', function (done) {

@@ -276,4 +284,4 @@ nock('http://www.example.com')

var opts = { timeout: 1, error: false }
najax.post('http://www.example.com', opts)
.always(function (data, statusText) {
return najax.post('http://www.example.com', opts)
.error(function (data, statusText, e) {
expect(statusText).to.eql('timeout')

@@ -280,0 +288,0 @@ done()

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