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

oput

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oput - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

coverage/coverage-final.json

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

{"/Users/dexter/project/oput/src/index.ts": {"path":"/Users/dexter/project/oput/src/index.ts","statementMap":{"0":{"start":{"line":2,"column":14},"end":{"line":2,"column":123}},"1":{"start":{"line":7,"column":16},"end":{"line":7,"column":43}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"3":{"start":{"line":8,"column":24},"end":{"line":8,"column":59}},"4":{"start":{"line":8,"column":41},"end":{"line":8,"column":58}},"5":{"start":{"line":14,"column":21},"end":{"line":14,"column":63}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":15}},"7":{"start":{"line":15,"column":4},"end":{"line":15,"column":38}},"8":{"start":{"line":15,"column":11},"end":{"line":15,"column":38}},"9":{"start":{"line":18,"column":4},"end":{"line":22,"column":null}},"10":{"start":{"line":19,"column":6},"end":{"line":19,"column":48}},"11":{"start":{"line":20,"column":6},"end":{"line":20,"column":82}},"12":{"start":{"line":21,"column":6},"end":{"line":21,"column":24}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":24,"column":4},"end":{"line":24,"column":17}},"15":{"start":{"line":27,"column":4},"end":{"line":27,"column":67}},"16":{"start":{"line":27,"column":22},"end":{"line":27,"column":67}},"17":{"start":{"line":28,"column":4},"end":{"line":36,"column":7}},"18":{"start":{"line":29,"column":6},"end":{"line":34,"column":8}},"19":{"start":{"line":30,"column":8},"end":{"line":30,"column":28}},"20":{"start":{"line":31,"column":8},"end":{"line":31,"column":25}},"21":{"start":{"line":32,"column":8},"end":{"line":32,"column":null}},"22":{"start":{"line":33,"column":8},"end":{"line":33,"column":22}},"23":{"start":{"line":35,"column":6},"end":{"line":35,"column":24}},"24":{"start":{"line":39,"column":4},"end":{"line":39,"column":32}},"25":{"start":{"line":39,"column":16},"end":{"line":39,"column":32}},"26":{"start":{"line":42,"column":4},"end":{"line":42,"column":43}},"27":{"start":{"line":42,"column":36},"end":{"line":42,"column":43}},"28":{"start":{"line":43,"column":41},"end":{"line":43,"column":45}},"29":{"start":{"line":44,"column":4},"end":{"line":64,"column":null}},"30":{"start":{"line":45,"column":6},"end":{"line":48,"column":null}},"31":{"start":{"line":46,"column":8},"end":{"line":46,"column":34}},"32":{"start":{"line":47,"column":8},"end":{"line":47,"column":61}},"33":{"start":{"line":49,"column":11},"end":{"line":64,"column":null}},"34":{"start":{"line":50,"column":6},"end":{"line":54,"column":null}},"35":{"start":{"line":51,"column":8},"end":{"line":51,"column":45}},"36":{"start":{"line":52,"column":8},"end":{"line":52,"column":78}},"37":{"start":{"line":53,"column":8},"end":{"line":53,"column":null}},"38":{"start":{"line":55,"column":11},"end":{"line":64,"column":null}},"39":{"start":{"line":56,"column":16},"end":{"line":56,"column":71}},"40":{"start":{"line":57,"column":6},"end":{"line":61,"column":null}},"41":{"start":{"line":58,"column":8},"end":{"line":58,"column":26}},"42":{"start":{"line":59,"column":8},"end":{"line":59,"column":95}},"43":{"start":{"line":60,"column":8},"end":{"line":60,"column":null}},"44":{"start":{"line":62,"column":11},"end":{"line":64,"column":null}},"45":{"start":{"line":63,"column":6},"end":{"line":63,"column":50}},"46":{"start":{"line":65,"column":4},"end":{"line":70,"column":null}},"47":{"start":{"line":66,"column":6},"end":{"line":69,"column":29}},"48":{"start":{"line":66,"column":18},"end":{"line":66,"column":62}},"49":{"start":{"line":67,"column":11},"end":{"line":69,"column":29}},"50":{"start":{"line":68,"column":8},"end":{"line":68,"column":34}},"51":{"start":{"line":69,"column":11},"end":{"line":69,"column":29}},"52":{"start":{"line":73,"column":4},"end":{"line":80,"column":null}},"53":{"start":{"line":74,"column":6},"end":{"line":74,"column":63}},"54":{"start":{"line":75,"column":11},"end":{"line":80,"column":null}},"55":{"start":{"line":76,"column":24},"end":{"line":76,"column":84}},"56":{"start":{"line":77,"column":6},"end":{"line":77,"column":86}},"57":{"start":{"line":79,"column":6},"end":{"line":79,"column":42}},"58":{"start":{"line":81,"column":4},"end":{"line":81,"column":17}},"59":{"start":{"line":84,"column":4},"end":{"line":98,"column":null}},"60":{"start":{"line":85,"column":16},"end":{"line":85,"column":34}},"61":{"start":{"line":86,"column":17},"end":{"line":86,"column":25}},"62":{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},"63":{"start":{"line":88,"column":8},"end":{"line":88,"column":64}},"64":{"start":{"line":90,"column":18},"end":{"line":90,"column":36}},"65":{"start":{"line":91,"column":8},"end":{"line":91,"column":27}},"66":{"start":{"line":92,"column":8},"end":{"line":92,"column":24}},"67":{"start":{"line":94,"column":6},"end":{"line":94,"column":41}},"68":{"start":{"line":96,"column":6},"end":{"line":96,"column":41}},"69":{"start":{"line":97,"column":6},"end":{"line":97,"column":25}},"70":{"start":{"line":9,"column":0},"end":{"line":9,"column":21}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":8,"column":14},"end":{"line":8,"column":15}},"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":59}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":34},"end":{"line":8,"column":35}},"loc":{"start":{"line":8,"column":41},"end":{"line":8,"column":58}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":14,"column":2},"end":{"line":14,"column":21}},"loc":{"start":{"line":14,"column":63},"end":{"line":16,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":17,"column":2},"end":{"line":17,"column":8}},"loc":{"start":{"line":17,"column":28},"end":{"line":25,"column":3}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":26,"column":2},"end":{"line":26,"column":6}},"loc":{"start":{"line":26,"column":35},"end":{"line":37,"column":3}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":28,"column":38},"end":{"line":28,"column":39}},"loc":{"start":{"line":28,"column":58},"end":{"line":36,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":29,"column":21},"end":{"line":29,"column":22}},"loc":{"start":{"line":29,"column":30},"end":{"line":34,"column":7}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":38,"column":2},"end":{"line":38,"column":7}},"loc":{"start":{"line":38,"column":7},"end":{"line":40,"column":3}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":41,"column":2},"end":{"line":41,"column":7}},"loc":{"start":{"line":41,"column":7},"end":{"line":71,"column":3}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":72,"column":2},"end":{"line":72,"column":7}},"loc":{"start":{"line":72,"column":25},"end":{"line":82,"column":3}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":83,"column":2},"end":{"line":83,"column":8}},"loc":{"start":{"line":83,"column":21},"end":{"line":99,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":38}},"type":"if","locations":[{"start":{"line":15,"column":4},"end":{"line":15,"column":38}}]},"1":{"loc":{"start":{"line":18,"column":4},"end":{"line":22,"column":null}},"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":22,"column":null}}]},"2":{"loc":{"start":{"line":27,"column":4},"end":{"line":27,"column":67}},"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":67}}]},"3":{"loc":{"start":{"line":39,"column":4},"end":{"line":39,"column":32}},"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":39,"column":32}}]},"4":{"loc":{"start":{"line":42,"column":4},"end":{"line":42,"column":43}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":43}}]},"5":{"loc":{"start":{"line":42,"column":8},"end":{"line":42,"column":34}},"type":"binary-expr","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":20}},{"start":{"line":42,"column":24},"end":{"line":42,"column":34}}]},"6":{"loc":{"start":{"line":44,"column":4},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":64,"column":null}},{"start":{"line":49,"column":11},"end":{"line":64,"column":null}}]},"7":{"loc":{"start":{"line":45,"column":6},"end":{"line":48,"column":null}},"type":"if","locations":[{"start":{"line":45,"column":6},"end":{"line":48,"column":null}}]},"8":{"loc":{"start":{"line":49,"column":11},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":49,"column":11},"end":{"line":64,"column":null}},{"start":{"line":55,"column":11},"end":{"line":64,"column":null}}]},"9":{"loc":{"start":{"line":50,"column":6},"end":{"line":54,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":6},"end":{"line":54,"column":null}}]},"10":{"loc":{"start":{"line":55,"column":11},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":55,"column":11},"end":{"line":64,"column":null}},{"start":{"line":62,"column":11},"end":{"line":64,"column":null}}]},"11":{"loc":{"start":{"line":57,"column":6},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":57,"column":6},"end":{"line":61,"column":null}}]},"12":{"loc":{"start":{"line":62,"column":11},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":62,"column":11},"end":{"line":64,"column":null}}]},"13":{"loc":{"start":{"line":65,"column":4},"end":{"line":70,"column":null}},"type":"if","locations":[{"start":{"line":65,"column":4},"end":{"line":70,"column":null}}]},"14":{"loc":{"start":{"line":66,"column":6},"end":{"line":69,"column":29}},"type":"if","locations":[{"start":{"line":66,"column":6},"end":{"line":69,"column":29}},{"start":{"line":67,"column":11},"end":{"line":69,"column":29}}]},"15":{"loc":{"start":{"line":67,"column":11},"end":{"line":69,"column":29}},"type":"if","locations":[{"start":{"line":67,"column":11},"end":{"line":69,"column":29}},{"start":{"line":69,"column":11},"end":{"line":69,"column":29}}]},"16":{"loc":{"start":{"line":73,"column":4},"end":{"line":80,"column":null}},"type":"if","locations":[{"start":{"line":73,"column":4},"end":{"line":80,"column":null}},{"start":{"line":75,"column":11},"end":{"line":80,"column":null}}]},"17":{"loc":{"start":{"line":75,"column":11},"end":{"line":80,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":11},"end":{"line":80,"column":null}},{"start":{"line":78,"column":11},"end":{"line":80,"column":null}}]},"18":{"loc":{"start":{"line":84,"column":4},"end":{"line":98,"column":null}},"type":"if","locations":[{"start":{"line":84,"column":4},"end":{"line":98,"column":null}},{"start":{"line":95,"column":11},"end":{"line":98,"column":null}}]},"19":{"loc":{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},"type":"if","locations":[{"start":{"line":87,"column":6},"end":{"line":93,"column":null}},{"start":{"line":89,"column":13},"end":{"line":93,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":4,"4":8,"5":6,"6":6,"7":6,"8":5,"9":10,"10":9,"11":9,"12":9,"13":10,"14":10,"15":2,"16":0,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2,"23":2,"24":1,"25":1,"26":17,"27":6,"28":11,"29":11,"30":4,"31":4,"32":4,"33":7,"34":2,"35":2,"36":2,"37":2,"38":5,"39":5,"40":5,"41":4,"42":4,"43":4,"44":0,"45":0,"46":11,"47":10,"48":8,"49":2,"50":2,"51":0,"52":7,"53":0,"54":7,"55":7,"56":7,"57":0,"58":7,"59":7,"60":2,"61":2,"62":2,"63":0,"64":2,"65":2,"66":2,"67":2,"68":5,"69":5,"70":1},"f":{"0":4,"1":8,"2":6,"3":10,"4":2,"5":2,"6":2,"7":1,"8":17,"9":7,"10":7},"b":{"0":[5],"1":[9],"2":[0],"3":[1],"4":[6],"5":[17,17],"6":[4,7],"7":[4],"8":[2,5],"9":[2],"10":[5,0],"11":[4],"12":[0],"13":[10],"14":[8,2],"15":[2,0],"16":[0,7],"17":[7,0],"18":[2,5],"19":[0,2]}}
{"/Users/dexter/project/oput/src/index.ts": {"path":"/Users/dexter/project/oput/src/index.ts","statementMap":{"0":{"start":{"line":2,"column":14},"end":{"line":2,"column":123}},"1":{"start":{"line":7,"column":16},"end":{"line":7,"column":43}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"3":{"start":{"line":8,"column":24},"end":{"line":8,"column":59}},"4":{"start":{"line":8,"column":41},"end":{"line":8,"column":58}},"5":{"start":{"line":14,"column":21},"end":{"line":14,"column":63}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":15}},"7":{"start":{"line":15,"column":4},"end":{"line":15,"column":38}},"8":{"start":{"line":15,"column":11},"end":{"line":15,"column":38}},"9":{"start":{"line":18,"column":28},"end":{"line":18,"column":47}},"10":{"start":{"line":19,"column":4},"end":{"line":25,"column":null}},"11":{"start":{"line":20,"column":6},"end":{"line":20,"column":19}},"12":{"start":{"line":21,"column":6},"end":{"line":21,"column":13}},"13":{"start":{"line":23,"column":6},"end":{"line":23,"column":25}},"14":{"start":{"line":24,"column":6},"end":{"line":24,"column":41}},"15":{"start":{"line":28,"column":4},"end":{"line":32,"column":null}},"16":{"start":{"line":29,"column":6},"end":{"line":29,"column":48}},"17":{"start":{"line":30,"column":6},"end":{"line":30,"column":82}},"18":{"start":{"line":31,"column":6},"end":{"line":31,"column":24}},"19":{"start":{"line":33,"column":4},"end":{"line":33,"column":18}},"20":{"start":{"line":34,"column":4},"end":{"line":34,"column":17}},"21":{"start":{"line":37,"column":4},"end":{"line":37,"column":67}},"22":{"start":{"line":37,"column":22},"end":{"line":37,"column":67}},"23":{"start":{"line":38,"column":4},"end":{"line":46,"column":7}},"24":{"start":{"line":39,"column":6},"end":{"line":44,"column":8}},"25":{"start":{"line":40,"column":8},"end":{"line":40,"column":28}},"26":{"start":{"line":41,"column":8},"end":{"line":41,"column":25}},"27":{"start":{"line":42,"column":8},"end":{"line":42,"column":26}},"28":{"start":{"line":43,"column":8},"end":{"line":43,"column":22}},"29":{"start":{"line":45,"column":6},"end":{"line":45,"column":24}},"30":{"start":{"line":49,"column":4},"end":{"line":49,"column":32}},"31":{"start":{"line":49,"column":16},"end":{"line":49,"column":32}},"32":{"start":{"line":52,"column":4},"end":{"line":52,"column":43}},"33":{"start":{"line":52,"column":36},"end":{"line":52,"column":43}},"34":{"start":{"line":53,"column":41},"end":{"line":53,"column":45}},"35":{"start":{"line":54,"column":4},"end":{"line":74,"column":null}},"36":{"start":{"line":55,"column":6},"end":{"line":58,"column":null}},"37":{"start":{"line":56,"column":8},"end":{"line":56,"column":34}},"38":{"start":{"line":57,"column":8},"end":{"line":57,"column":61}},"39":{"start":{"line":59,"column":11},"end":{"line":74,"column":null}},"40":{"start":{"line":60,"column":6},"end":{"line":64,"column":null}},"41":{"start":{"line":61,"column":8},"end":{"line":61,"column":45}},"42":{"start":{"line":62,"column":8},"end":{"line":62,"column":78}},"43":{"start":{"line":63,"column":8},"end":{"line":63,"column":32}},"44":{"start":{"line":65,"column":11},"end":{"line":74,"column":null}},"45":{"start":{"line":66,"column":16},"end":{"line":66,"column":71}},"46":{"start":{"line":67,"column":6},"end":{"line":71,"column":null}},"47":{"start":{"line":68,"column":8},"end":{"line":68,"column":26}},"48":{"start":{"line":69,"column":8},"end":{"line":69,"column":95}},"49":{"start":{"line":70,"column":8},"end":{"line":70,"column":32}},"50":{"start":{"line":72,"column":11},"end":{"line":74,"column":null}},"51":{"start":{"line":73,"column":6},"end":{"line":73,"column":50}},"52":{"start":{"line":75,"column":4},"end":{"line":80,"column":null}},"53":{"start":{"line":76,"column":6},"end":{"line":79,"column":29}},"54":{"start":{"line":76,"column":18},"end":{"line":76,"column":62}},"55":{"start":{"line":77,"column":11},"end":{"line":79,"column":29}},"56":{"start":{"line":78,"column":8},"end":{"line":78,"column":34}},"57":{"start":{"line":79,"column":11},"end":{"line":79,"column":29}},"58":{"start":{"line":83,"column":4},"end":{"line":90,"column":null}},"59":{"start":{"line":84,"column":6},"end":{"line":84,"column":63}},"60":{"start":{"line":85,"column":11},"end":{"line":90,"column":null}},"61":{"start":{"line":86,"column":24},"end":{"line":86,"column":84}},"62":{"start":{"line":87,"column":6},"end":{"line":87,"column":86}},"63":{"start":{"line":89,"column":6},"end":{"line":89,"column":42}},"64":{"start":{"line":91,"column":4},"end":{"line":91,"column":17}},"65":{"start":{"line":94,"column":4},"end":{"line":108,"column":null}},"66":{"start":{"line":95,"column":16},"end":{"line":95,"column":34}},"67":{"start":{"line":96,"column":17},"end":{"line":96,"column":25}},"68":{"start":{"line":97,"column":6},"end":{"line":103,"column":null}},"69":{"start":{"line":98,"column":8},"end":{"line":98,"column":64}},"70":{"start":{"line":100,"column":18},"end":{"line":100,"column":36}},"71":{"start":{"line":101,"column":8},"end":{"line":101,"column":27}},"72":{"start":{"line":102,"column":8},"end":{"line":102,"column":24}},"73":{"start":{"line":104,"column":6},"end":{"line":104,"column":41}},"74":{"start":{"line":106,"column":6},"end":{"line":106,"column":41}},"75":{"start":{"line":107,"column":6},"end":{"line":107,"column":25}},"76":{"start":{"line":9,"column":0},"end":{"line":9,"column":21}}},"fnMap":{"0":{"name":"(anonymous_7)","decl":{"start":{"line":8,"column":14},"end":{"line":8,"column":15}},"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":59}}},"1":{"name":"(anonymous_8)","decl":{"start":{"line":8,"column":34},"end":{"line":8,"column":35}},"loc":{"start":{"line":8,"column":41},"end":{"line":8,"column":58}}},"2":{"name":"(anonymous_9)","decl":{"start":{"line":14,"column":2},"end":{"line":14,"column":21}},"loc":{"start":{"line":14,"column":63},"end":{"line":16,"column":3}}},"3":{"name":"(anonymous_10)","decl":{"start":{"line":17,"column":8},"end":{"line":17,"column":22}},"loc":{"start":{"line":17,"column":83},"end":{"line":26,"column":4}}},"4":{"name":"(anonymous_12)","decl":{"start":{"line":27,"column":2},"end":{"line":27,"column":8}},"loc":{"start":{"line":27,"column":28},"end":{"line":35,"column":3}}},"5":{"name":"(anonymous_13)","decl":{"start":{"line":36,"column":2},"end":{"line":36,"column":6}},"loc":{"start":{"line":36,"column":35},"end":{"line":47,"column":3}}},"6":{"name":"(anonymous_14)","decl":{"start":{"line":38,"column":38},"end":{"line":38,"column":39}},"loc":{"start":{"line":38,"column":58},"end":{"line":46,"column":5}}},"7":{"name":"(anonymous_15)","decl":{"start":{"line":39,"column":21},"end":{"line":39,"column":22}},"loc":{"start":{"line":39,"column":30},"end":{"line":44,"column":7}}},"8":{"name":"(anonymous_16)","decl":{"start":{"line":48,"column":2},"end":{"line":48,"column":7}},"loc":{"start":{"line":48,"column":7},"end":{"line":50,"column":3}}},"9":{"name":"(anonymous_17)","decl":{"start":{"line":51,"column":2},"end":{"line":51,"column":7}},"loc":{"start":{"line":51,"column":7},"end":{"line":81,"column":3}}},"10":{"name":"(anonymous_18)","decl":{"start":{"line":82,"column":2},"end":{"line":82,"column":7}},"loc":{"start":{"line":82,"column":25},"end":{"line":92,"column":3}}},"11":{"name":"(anonymous_19)","decl":{"start":{"line":93,"column":2},"end":{"line":93,"column":8}},"loc":{"start":{"line":93,"column":21},"end":{"line":109,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":38}},"type":"if","locations":[{"start":{"line":15,"column":4},"end":{"line":15,"column":38}}]},"1":{"loc":{"start":{"line":19,"column":4},"end":{"line":25,"column":null}},"type":"if","locations":[{"start":{"line":19,"column":4},"end":{"line":25,"column":null}},{"start":{"line":22,"column":11},"end":{"line":25,"column":null}}]},"2":{"loc":{"start":{"line":28,"column":4},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":32,"column":null}}]},"3":{"loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":67}},"type":"if","locations":[{"start":{"line":37,"column":4},"end":{"line":37,"column":67}}]},"4":{"loc":{"start":{"line":49,"column":4},"end":{"line":49,"column":32}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":49,"column":32}}]},"5":{"loc":{"start":{"line":52,"column":4},"end":{"line":52,"column":43}},"type":"if","locations":[{"start":{"line":52,"column":4},"end":{"line":52,"column":43}}]},"6":{"loc":{"start":{"line":52,"column":8},"end":{"line":52,"column":34}},"type":"binary-expr","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":20}},{"start":{"line":52,"column":24},"end":{"line":52,"column":34}}]},"7":{"loc":{"start":{"line":54,"column":4},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":74,"column":null}},{"start":{"line":59,"column":11},"end":{"line":74,"column":null}}]},"8":{"loc":{"start":{"line":55,"column":6},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":55,"column":6},"end":{"line":58,"column":null}}]},"9":{"loc":{"start":{"line":59,"column":11},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":59,"column":11},"end":{"line":74,"column":null}},{"start":{"line":65,"column":11},"end":{"line":74,"column":null}}]},"10":{"loc":{"start":{"line":60,"column":6},"end":{"line":64,"column":null}},"type":"if","locations":[{"start":{"line":60,"column":6},"end":{"line":64,"column":null}}]},"11":{"loc":{"start":{"line":65,"column":11},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":65,"column":11},"end":{"line":74,"column":null}},{"start":{"line":72,"column":11},"end":{"line":74,"column":null}}]},"12":{"loc":{"start":{"line":67,"column":6},"end":{"line":71,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":6},"end":{"line":71,"column":null}}]},"13":{"loc":{"start":{"line":72,"column":11},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":72,"column":11},"end":{"line":74,"column":null}}]},"14":{"loc":{"start":{"line":75,"column":4},"end":{"line":80,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":80,"column":null}}]},"15":{"loc":{"start":{"line":76,"column":6},"end":{"line":79,"column":29}},"type":"if","locations":[{"start":{"line":76,"column":6},"end":{"line":79,"column":29}},{"start":{"line":77,"column":11},"end":{"line":79,"column":29}}]},"16":{"loc":{"start":{"line":77,"column":11},"end":{"line":79,"column":29}},"type":"if","locations":[{"start":{"line":77,"column":11},"end":{"line":79,"column":29}},{"start":{"line":79,"column":11},"end":{"line":79,"column":29}}]},"17":{"loc":{"start":{"line":83,"column":4},"end":{"line":90,"column":null}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":90,"column":null}},{"start":{"line":85,"column":11},"end":{"line":90,"column":null}}]},"18":{"loc":{"start":{"line":85,"column":11},"end":{"line":90,"column":null}},"type":"if","locations":[{"start":{"line":85,"column":11},"end":{"line":90,"column":null}},{"start":{"line":88,"column":11},"end":{"line":90,"column":null}}]},"19":{"loc":{"start":{"line":94,"column":4},"end":{"line":108,"column":null}},"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":108,"column":null}},{"start":{"line":105,"column":11},"end":{"line":108,"column":null}}]},"20":{"loc":{"start":{"line":97,"column":6},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":97,"column":6},"end":{"line":103,"column":null}},{"start":{"line":99,"column":13},"end":{"line":103,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":4,"4":8,"5":6,"6":6,"7":6,"8":5,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":10,"16":9,"17":9,"18":9,"19":10,"20":10,"21":2,"22":0,"23":2,"24":2,"25":2,"26":2,"27":2,"28":2,"29":2,"30":1,"31":1,"32":17,"33":6,"34":11,"35":11,"36":4,"37":4,"38":4,"39":7,"40":2,"41":2,"42":2,"43":2,"44":5,"45":5,"46":5,"47":4,"48":4,"49":4,"50":0,"51":0,"52":11,"53":10,"54":8,"55":2,"56":2,"57":0,"58":7,"59":0,"60":7,"61":7,"62":7,"63":0,"64":7,"65":7,"66":2,"67":2,"68":2,"69":0,"70":2,"71":2,"72":2,"73":2,"74":5,"75":5,"76":1},"f":{"0":4,"1":8,"2":6,"3":0,"4":10,"5":2,"6":2,"7":2,"8":1,"9":17,"10":7,"11":7},"b":{"0":[5],"1":[0,0],"2":[9],"3":[0],"4":[1],"5":[6],"6":[17,17],"7":[4,7],"8":[4],"9":[2,5],"10":[2],"11":[5,0],"12":[4],"13":[0],"14":[10],"15":[8,2],"16":[2,0],"17":[0,7],"18":[7,0],"19":[2,5],"20":[0,2]}}
}

@@ -11,2 +11,3 @@ declare type InputTypes = Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array | ArrayBuffer;

constructor(g?: Generator<NeedTypes, void, InputTypes> | undefined);
fillFromReader<T extends InputTypes>(source: ReadableStreamDefaultReader<T>): Promise<void>;
demand(n: NeedTypes | void): void;

@@ -13,0 +14,0 @@ read<T extends NeedTypes>(need: T): Promise<ReturnType<T>>;

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

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const Types = [[Uint8Array, Int8Array], [Uint16Array, Int16Array], [Uint32Array, Int32Array, Float32Array], [Float64Array]];

@@ -11,2 +20,16 @@ const OPutMap = new Map();

}
fillFromReader(source) {
return __awaiter(this, void 0, void 0, function* () {
const { done, value } = yield source.read();
if (done) {
this.close();
return;
}
else {
this.write(value);
return this.fillFromReader(source);
}
});
}
;
demand(n) {

@@ -13,0 +36,0 @@ if (this.consumed) {

{
"name": "oput",
"version": "1.0.3",
"version": "1.0.4",
"description": "0 put do",

@@ -26,4 +26,5 @@ "main": "src/index.ts",

"jest": {
"preset": "ts-jest"
"preset": "ts-jest",
"testEnvironment": "jsdom"
}
}

@@ -17,2 +17,12 @@

}
async fillFromReader<T extends InputTypes>(source: ReadableStreamDefaultReader<T>): Promise<void> {
const { done, value } = await source.read();
if (done) {
this.close();
return;
} else {
this.write(value!);
return this.fillFromReader(source);
}
};
demand(n: NeedTypes | void) {

@@ -33,3 +43,3 @@ if (this.consumed) {

delete this.need;
console.log(data)
console.log(data);
resolve(data);

@@ -55,3 +65,3 @@ };

new Uint8Array(this.need).set(this.buffer.subarray(0, this.consumed));
returnValue = this.need
returnValue = this.need;
}

@@ -63,3 +73,3 @@ } else if (OPutMap.has(this.need.constructor)) {

new Uint8Array(this.need.buffer, this.need.byteOffset).set(this.buffer.subarray(0, n));
returnValue = this.need
returnValue = this.need;
}

@@ -66,0 +76,0 @@ } else if (this.g) {

@@ -78,2 +78,22 @@ import OPut from '../src/index';

});
});
});
// test('fillFromReader', () => {
// const rs = new ReadableStream({
// start(controller) {
// controller.enqueue(new Uint8Array([1, 0, 2, 0]));
// controller.enqueue(new Uint8Array([5, 6, 7, 8]));
// controller.close();
// }
// });
// function* reader(): Generator<Uint16Array, void, Uint16Array> {
// let b = new Uint16Array(2);
// yield b;
// expect(b[0]).toBe(1);
// b = new Uint16Array(3);
// yield b;
// expect(b[0]).toBe(2);
// }
// const oput = new OPut(reader());
// oput.fillFromReader(rs.getReader());
// });

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