Comparing version 1.0.5 to 1.0.6
@@ -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":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]}} | ||
{"/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":47}},"17":{"start":{"line":30,"column":6},"end":{"line":30,"column":80}},"18":{"start":{"line":31,"column":6},"end":{"line":31,"column":24}},"19":{"start":{"line":35,"column":4},"end":{"line":35,"column":32}},"20":{"start":{"line":35,"column":17},"end":{"line":35,"column":32}},"21":{"start":{"line":36,"column":4},"end":{"line":36,"column":18}},"22":{"start":{"line":37,"column":4},"end":{"line":37,"column":24}},"23":{"start":{"line":40,"column":4},"end":{"line":48,"column":7}},"24":{"start":{"line":41,"column":6},"end":{"line":41,"column":68}},"25":{"start":{"line":41,"column":24},"end":{"line":41,"column":68}},"26":{"start":{"line":42,"column":6},"end":{"line":46,"column":8}},"27":{"start":{"line":43,"column":8},"end":{"line":43,"column":28}},"28":{"start":{"line":44,"column":8},"end":{"line":44,"column":25}},"29":{"start":{"line":45,"column":8},"end":{"line":45,"column":22}},"30":{"start":{"line":47,"column":6},"end":{"line":47,"column":30}},"31":{"start":{"line":51,"column":4},"end":{"line":51,"column":32}},"32":{"start":{"line":51,"column":16},"end":{"line":51,"column":32}},"33":{"start":{"line":55,"column":4},"end":{"line":55,"column":43}},"34":{"start":{"line":55,"column":36},"end":{"line":55,"column":43}},"35":{"start":{"line":56,"column":41},"end":{"line":56,"column":45}},"36":{"start":{"line":57,"column":19},"end":{"line":57,"column":54}},"37":{"start":{"line":58,"column":12},"end":{"line":58,"column":13}},"38":{"start":{"line":59,"column":4},"end":{"line":76,"column":null}},"39":{"start":{"line":60,"column":6},"end":{"line":60,"column":20}},"40":{"start":{"line":61,"column":6},"end":{"line":61,"column":36}},"41":{"start":{"line":61,"column":29},"end":{"line":61,"column":36}},"42":{"start":{"line":62,"column":6},"end":{"line":62,"column":42}},"43":{"start":{"line":63,"column":11},"end":{"line":76,"column":null}},"44":{"start":{"line":64,"column":6},"end":{"line":64,"column":31}},"45":{"start":{"line":65,"column":6},"end":{"line":65,"column":36}},"46":{"start":{"line":65,"column":29},"end":{"line":65,"column":36}},"47":{"start":{"line":66,"column":6},"end":{"line":66,"column":59}},"48":{"start":{"line":67,"column":6},"end":{"line":67,"column":30}},"49":{"start":{"line":68,"column":11},"end":{"line":76,"column":null}},"50":{"start":{"line":69,"column":6},"end":{"line":69,"column":66}},"51":{"start":{"line":70,"column":6},"end":{"line":70,"column":36}},"52":{"start":{"line":70,"column":29},"end":{"line":70,"column":36}},"53":{"start":{"line":71,"column":6},"end":{"line":71,"column":88}},"54":{"start":{"line":72,"column":6},"end":{"line":72,"column":30}},"55":{"start":{"line":73,"column":11},"end":{"line":76,"column":null}},"56":{"start":{"line":74,"column":6},"end":{"line":74,"column":50}},"57":{"start":{"line":75,"column":6},"end":{"line":75,"column":13}},"58":{"start":{"line":77,"column":4},"end":{"line":77,"column":23}},"59":{"start":{"line":78,"column":4},"end":{"line":80,"column":32}},"60":{"start":{"line":78,"column":16},"end":{"line":78,"column":67}},"61":{"start":{"line":79,"column":9},"end":{"line":80,"column":32}},"62":{"start":{"line":80,"column":6},"end":{"line":80,"column":32}},"63":{"start":{"line":81,"column":4},"end":{"line":81,"column":23}},"64":{"start":{"line":84,"column":4},"end":{"line":91,"column":null}},"65":{"start":{"line":85,"column":6},"end":{"line":85,"column":63}},"66":{"start":{"line":86,"column":11},"end":{"line":91,"column":null}},"67":{"start":{"line":87,"column":24},"end":{"line":87,"column":84}},"68":{"start":{"line":88,"column":6},"end":{"line":88,"column":86}},"69":{"start":{"line":90,"column":6},"end":{"line":90,"column":42}},"70":{"start":{"line":92,"column":4},"end":{"line":92,"column":17}},"71":{"start":{"line":95,"column":4},"end":{"line":109,"column":null}},"72":{"start":{"line":96,"column":16},"end":{"line":96,"column":34}},"73":{"start":{"line":97,"column":17},"end":{"line":97,"column":25}},"74":{"start":{"line":98,"column":6},"end":{"line":104,"column":null}},"75":{"start":{"line":99,"column":8},"end":{"line":99,"column":85}},"76":{"start":{"line":101,"column":18},"end":{"line":101,"column":36}},"77":{"start":{"line":102,"column":8},"end":{"line":102,"column":27}},"78":{"start":{"line":103,"column":8},"end":{"line":103,"column":24}},"79":{"start":{"line":105,"column":6},"end":{"line":105,"column":41}},"80":{"start":{"line":107,"column":6},"end":{"line":107,"column":41}},"81":{"start":{"line":108,"column":6},"end":{"line":108,"column":25}},"82":{"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":9}},"loc":{"start":{"line":27,"column":9},"end":{"line":33,"column":3}}},"5":{"name":"(anonymous_13)","decl":{"start":{"line":34,"column":2},"end":{"line":34,"column":8}},"loc":{"start":{"line":34,"column":47},"end":{"line":38,"column":3}}},"6":{"name":"(anonymous_14)","decl":{"start":{"line":39,"column":2},"end":{"line":39,"column":6}},"loc":{"start":{"line":39,"column":35},"end":{"line":49,"column":3}}},"7":{"name":"(anonymous_15)","decl":{"start":{"line":40,"column":38},"end":{"line":40,"column":39}},"loc":{"start":{"line":40,"column":58},"end":{"line":48,"column":5}}},"8":{"name":"(anonymous_16)","decl":{"start":{"line":42,"column":21},"end":{"line":42,"column":22}},"loc":{"start":{"line":42,"column":30},"end":{"line":46,"column":7}}},"9":{"name":"(anonymous_17)","decl":{"start":{"line":50,"column":2},"end":{"line":50,"column":7}},"loc":{"start":{"line":50,"column":7},"end":{"line":52,"column":3}}},"10":{"name":"(anonymous_18)","decl":{"start":{"line":54,"column":2},"end":{"line":54,"column":7}},"loc":{"start":{"line":54,"column":7},"end":{"line":82,"column":3}}},"11":{"name":"(anonymous_19)","decl":{"start":{"line":83,"column":2},"end":{"line":83,"column":7}},"loc":{"start":{"line":83,"column":25},"end":{"line":93,"column":3}}},"12":{"name":"(anonymous_20)","decl":{"start":{"line":94,"column":2},"end":{"line":94,"column":8}},"loc":{"start":{"line":94,"column":21},"end":{"line":110,"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":28,"column":8},"end":{"line":28,"column":36}},"type":"binary-expr","locations":[{"start":{"line":28,"column":8},"end":{"line":28,"column":19}},{"start":{"line":28,"column":23},"end":{"line":28,"column":36}}]},"4":{"loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":32}},"type":"if","locations":[{"start":{"line":35,"column":4},"end":{"line":35,"column":32}}]},"5":{"loc":{"start":{"line":41,"column":6},"end":{"line":41,"column":68}},"type":"if","locations":[{"start":{"line":41,"column":6},"end":{"line":41,"column":68}}]},"6":{"loc":{"start":{"line":51,"column":4},"end":{"line":51,"column":32}},"type":"if","locations":[{"start":{"line":51,"column":4},"end":{"line":51,"column":32}}]},"7":{"loc":{"start":{"line":55,"column":4},"end":{"line":55,"column":43}},"type":"if","locations":[{"start":{"line":55,"column":4},"end":{"line":55,"column":43}}]},"8":{"loc":{"start":{"line":55,"column":8},"end":{"line":55,"column":34}},"type":"binary-expr","locations":[{"start":{"line":55,"column":8},"end":{"line":55,"column":20}},{"start":{"line":55,"column":24},"end":{"line":55,"column":34}}]},"9":{"loc":{"start":{"line":59,"column":4},"end":{"line":76,"column":null}},"type":"if","locations":[{"start":{"line":59,"column":4},"end":{"line":76,"column":null}},{"start":{"line":63,"column":11},"end":{"line":76,"column":null}}]},"10":{"loc":{"start":{"line":61,"column":6},"end":{"line":61,"column":36}},"type":"if","locations":[{"start":{"line":61,"column":6},"end":{"line":61,"column":36}}]},"11":{"loc":{"start":{"line":63,"column":11},"end":{"line":76,"column":null}},"type":"if","locations":[{"start":{"line":63,"column":11},"end":{"line":76,"column":null}},{"start":{"line":68,"column":11},"end":{"line":76,"column":null}}]},"12":{"loc":{"start":{"line":65,"column":6},"end":{"line":65,"column":36}},"type":"if","locations":[{"start":{"line":65,"column":6},"end":{"line":65,"column":36}}]},"13":{"loc":{"start":{"line":68,"column":11},"end":{"line":76,"column":null}},"type":"if","locations":[{"start":{"line":68,"column":11},"end":{"line":76,"column":null}},{"start":{"line":73,"column":11},"end":{"line":76,"column":null}}]},"14":{"loc":{"start":{"line":70,"column":6},"end":{"line":70,"column":36}},"type":"if","locations":[{"start":{"line":70,"column":6},"end":{"line":70,"column":36}}]},"15":{"loc":{"start":{"line":73,"column":11},"end":{"line":76,"column":null}},"type":"if","locations":[{"start":{"line":73,"column":11},"end":{"line":76,"column":null}}]},"16":{"loc":{"start":{"line":78,"column":4},"end":{"line":80,"column":32}},"type":"if","locations":[{"start":{"line":78,"column":4},"end":{"line":80,"column":32}},{"start":{"line":79,"column":9},"end":{"line":80,"column":32}}]},"17":{"loc":{"start":{"line":79,"column":9},"end":{"line":80,"column":32}},"type":"if","locations":[{"start":{"line":79,"column":9},"end":{"line":80,"column":32}}]},"18":{"loc":{"start":{"line":84,"column":4},"end":{"line":91,"column":null}},"type":"if","locations":[{"start":{"line":84,"column":4},"end":{"line":91,"column":null}},{"start":{"line":86,"column":11},"end":{"line":91,"column":null}}]},"19":{"loc":{"start":{"line":86,"column":11},"end":{"line":91,"column":null}},"type":"if","locations":[{"start":{"line":86,"column":11},"end":{"line":91,"column":null}},{"start":{"line":89,"column":11},"end":{"line":91,"column":null}}]},"20":{"loc":{"start":{"line":95,"column":4},"end":{"line":109,"column":null}},"type":"if","locations":[{"start":{"line":95,"column":4},"end":{"line":109,"column":null}},{"start":{"line":106,"column":11},"end":{"line":109,"column":null}}]},"21":{"loc":{"start":{"line":98,"column":6},"end":{"line":104,"column":null}},"type":"if","locations":[{"start":{"line":98,"column":6},"end":{"line":104,"column":null}},{"start":{"line":100,"column":13},"end":{"line":104,"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":10,"22":10,"23":2,"24":2,"25":0,"26":2,"27":2,"28":2,"29":2,"30":2,"31":1,"32":1,"33":17,"34":6,"35":11,"36":11,"37":11,"38":11,"39":4,"40":4,"41":0,"42":4,"43":7,"44":2,"45":2,"46":0,"47":2,"48":2,"49":5,"50":5,"51":5,"52":1,"53":4,"54":4,"55":0,"56":0,"57":0,"58":10,"59":10,"60":8,"61":2,"62":2,"63":10,"64":7,"65":0,"66":7,"67":7,"68":7,"69":0,"70":7,"71":7,"72":2,"73":2,"74":2,"75":0,"76":2,"77":2,"78":2,"79":2,"80":5,"81":5,"82":1},"f":{"0":4,"1":8,"2":6,"3":0,"4":10,"5":10,"6":2,"7":2,"8":2,"9":1,"10":17,"11":7,"12":7},"b":{"0":[5],"1":[0,0],"2":[9],"3":[10,10],"4":[10],"5":[0],"6":[1],"7":[6],"8":[17,17],"9":[4,7],"10":[0],"11":[2,5],"12":[0],"13":[5,0],"14":[1],"15":[0],"16":[8,2],"17":[2],"18":[0,7],"19":[7,0],"20":[2,5],"21":[0,2]}} | ||
} |
@@ -12,6 +12,7 @@ declare type InputTypes = Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array | ArrayBuffer; | ||
fillFromReader<T extends InputTypes>(source: ReadableStreamDefaultReader<T>): Promise<void>; | ||
demand(n: NeedTypes | void): void; | ||
consume(): void; | ||
demand(n: NeedTypes | void, consume?: boolean): void | InputTypes | null | undefined; | ||
read<T extends NeedTypes>(need: T): Promise<ReturnType<T>>; | ||
close(): void; | ||
flush(): void; | ||
flush(): InputTypes | null | undefined | void; | ||
write(value: InputTypes): void; | ||
@@ -18,0 +19,0 @@ malloc(size: number): Uint8Array; |
@@ -34,4 +34,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
; | ||
demand(n) { | ||
if (this.consumed) { | ||
consume() { | ||
if (this.buffer && this.consumed) { | ||
this.buffer.copyWithin(0, this.consumed); | ||
@@ -41,4 +41,8 @@ this.buffer = this.buffer.subarray(0, this.buffer.length - this.consumed); | ||
} | ||
} | ||
demand(n, consume) { | ||
if (consume) | ||
this.consume(); | ||
this.need = n; | ||
this.flush(); | ||
return this.flush(); | ||
} | ||
@@ -52,6 +56,5 @@ read(need) { | ||
delete this.need; | ||
console.log(data); | ||
resolve(data); | ||
}; | ||
this.demand(need); | ||
this.demand(need, true); | ||
}); | ||
@@ -67,34 +70,34 @@ } | ||
let returnValue = null; | ||
const unread = this.buffer.subarray(this.consumed); | ||
let n = 0; | ||
if (typeof this.need === 'number') { | ||
if (this.buffer.length >= this.need) { | ||
this.consumed = this.need; | ||
returnValue = this.buffer.subarray(0, this.consumed); | ||
} | ||
n = this.need; | ||
if (unread.length < n) | ||
return; | ||
returnValue = unread.subarray(0, n); | ||
} | ||
else if (this.need instanceof ArrayBuffer) { | ||
if (this.buffer.length >= this.need.byteLength) { | ||
this.consumed = this.need.byteLength; | ||
new Uint8Array(this.need).set(this.buffer.subarray(0, this.consumed)); | ||
returnValue = this.need; | ||
} | ||
n = this.need.byteLength; | ||
if (unread.length < n) | ||
return; | ||
new Uint8Array(this.need).set(unread.subarray(0, n)); | ||
returnValue = this.need; | ||
} | ||
else if (OPutMap.has(this.need.constructor)) { | ||
const n = this.need.length << OPutMap.get(this.need.constructor); | ||
if (this.buffer.length >= n) { | ||
this.consumed = n; | ||
new Uint8Array(this.need.buffer, this.need.byteOffset).set(this.buffer.subarray(0, n)); | ||
returnValue = this.need; | ||
} | ||
n = this.need.length << OPutMap.get(this.need.constructor); | ||
if (unread.length < n) | ||
return; | ||
new Uint8Array(this.need.buffer, this.need.byteOffset).set(unread.subarray(0, n)); | ||
returnValue = this.need; | ||
} | ||
else if (this.g) { | ||
this.g.throw(new Error('Unsupported type')); | ||
return; | ||
} | ||
if (returnValue) { | ||
if (this.g) | ||
this.demand(this.g.next(returnValue).value); | ||
else if (this.resolve) | ||
this.resolve(returnValue); | ||
else | ||
this.consumed = 0; | ||
} | ||
this.consumed += n; | ||
if (this.g) | ||
this.demand(this.g.next(returnValue).value, true); | ||
else if (this.resolve) | ||
this.resolve(returnValue); | ||
return returnValue; | ||
} | ||
@@ -118,4 +121,4 @@ write(value) { | ||
const nl = l + size; | ||
if (nl <= this.buffer.byteLength) { | ||
this.buffer = new Uint8Array(this.buffer.buffer, 0, nl); | ||
if (nl <= this.buffer.byteLength - this.buffer.byteOffset) { | ||
this.buffer = new Uint8Array(this.buffer.buffer, this.buffer.byteOffset, nl); | ||
} | ||
@@ -122,0 +125,0 @@ else { |
{ | ||
"name": "oput", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "0 put do", | ||
@@ -5,0 +5,0 @@ "main": "src/index.ts", |
@@ -27,3 +27,10 @@ # 0 put do 零存整取库 | ||
``` | ||
### 可以在pipeTo中使用 | ||
```ts | ||
import OPut from 'oput' | ||
const oput = new OPut(reader) | ||
readableStream.pipeTo(new WritableStream(oput)) | ||
``` | ||
消费端负责从OPut中读取数据。根据实际需要可以选择两种读取模式。 | ||
@@ -64,2 +71,3 @@ | ||
}) | ||
``` | ||
``` | ||
@@ -27,10 +27,13 @@ | ||
}; | ||
demand(n: NeedTypes | void) { | ||
if (this.consumed) { | ||
this.buffer!.copyWithin(0, this.consumed); | ||
this.buffer = this.buffer!.subarray(0, this.buffer!.length - this.consumed); | ||
consume() { | ||
if (this.buffer && this.consumed) { | ||
this.buffer.copyWithin(0, this.consumed); | ||
this.buffer = this.buffer.subarray(0, this.buffer.length - this.consumed); | ||
this.consumed = 0; | ||
} | ||
} | ||
demand(n: NeedTypes | void, consume?: boolean) { | ||
if (consume) this.consume(); | ||
this.need = n; | ||
this.flush(); | ||
return this.flush(); | ||
} | ||
@@ -43,6 +46,5 @@ read<T extends NeedTypes>(need: T) { | ||
delete this.need; | ||
console.log(data); | ||
resolve(data); | ||
}; | ||
this.demand(need); | ||
this.demand(need, true); | ||
}); | ||
@@ -53,32 +55,31 @@ } | ||
} | ||
flush() { | ||
flush(): InputTypes | null | undefined | void { | ||
if (!this.buffer || !this.need) return; | ||
let returnValue: InputTypes | null = null; | ||
const unread = this.buffer.subarray(this.consumed); | ||
let n = 0; | ||
if (typeof this.need === 'number') { | ||
if (this.buffer.length >= this.need) { | ||
this.consumed = this.need; | ||
returnValue = this.buffer.subarray(0, this.consumed); | ||
} | ||
n = this.need; | ||
if (unread.length < n) return; | ||
returnValue = unread.subarray(0, n); | ||
} else if (this.need instanceof ArrayBuffer) { | ||
if (this.buffer.length >= this.need.byteLength) { | ||
this.consumed = this.need.byteLength; | ||
new Uint8Array(this.need).set(this.buffer.subarray(0, this.consumed)); | ||
returnValue = this.need; | ||
} | ||
n = this.need.byteLength; | ||
if (unread.length < n) return; | ||
new Uint8Array(this.need).set(unread.subarray(0, n)); | ||
returnValue = this.need; | ||
} else if (OPutMap.has(this.need.constructor)) { | ||
const n = this.need.length << OPutMap.get(this.need.constructor)!; | ||
if (this.buffer.length >= n) { | ||
this.consumed = n; | ||
new Uint8Array(this.need.buffer, this.need.byteOffset).set(this.buffer.subarray(0, n)); | ||
returnValue = this.need; | ||
} | ||
n = this.need.length << OPutMap.get(this.need.constructor)!; | ||
if (unread.length < n) return; | ||
new Uint8Array(this.need.buffer, this.need.byteOffset).set(unread.subarray(0, n)); | ||
returnValue = this.need; | ||
} else if (this.g) { | ||
this.g.throw(new Error('Unsupported type')); | ||
return; | ||
} | ||
if (returnValue) { | ||
if (this.g) this.demand(this.g.next(returnValue).value); | ||
else if (this.resolve) | ||
this.resolve(returnValue); | ||
else this.consumed = 0; | ||
} | ||
this.consumed += n; | ||
if (this.g) this.demand(this.g.next(returnValue!).value, true); | ||
else if (this.resolve) | ||
this.resolve(returnValue); | ||
return returnValue; | ||
} | ||
@@ -100,4 +101,4 @@ write(value: InputTypes): void { | ||
const nl = l + size; | ||
if (nl <= this.buffer.byteLength) { | ||
this.buffer = new Uint8Array(this.buffer.buffer, 0, nl); | ||
if (nl <= this.buffer.byteLength - this.buffer.byteOffset) { | ||
this.buffer = new Uint8Array(this.buffer.buffer, this.buffer.byteOffset, nl); | ||
} else { | ||
@@ -104,0 +105,0 @@ const n = new Uint8Array(nl); |
@@ -80,2 +80,19 @@ import OPut from '../src/index'; | ||
// test('pipe', () => { | ||
// function* reader(): Generator<Uint8Array, void, Uint8Array> { | ||
// let b = new Uint8Array(3); | ||
// yield b; | ||
// expect(b[0]).toBe(1); | ||
// b = new Uint8Array(5); | ||
// yield b; | ||
// expect(b[1]).toBe(2); | ||
// } | ||
// const oput = new OPut(reader()); | ||
// new ReadableStream({ | ||
// start(controller) { | ||
// controller.enqueue(new Uint32Array([1, 2])); | ||
// } | ||
// }).pipeTo(new WritableStream(oput)); | ||
// }); | ||
// test('fillFromReader', () => { | ||
@@ -82,0 +99,0 @@ // const rs = new ReadableStream({ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213580
1056
72