@vorlefan/toolkit
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,3 +0,3 @@ | ||
{"D:\\Code\\vorlefan\\toolkit\\src\\nestjs\\inputTransformer.ts": {"path":"D:\\Code\\vorlefan\\toolkit\\src\\nestjs\\inputTransformer.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":29}},"3":{"start":{"line":8,"column":12},"end":{"line":8,"column":55}},"4":{"start":{"line":9,"column":12},"end":{"line":9,"column":42}},"5":{"start":{"line":10,"column":12},"end":{"line":10,"column":45}},"6":{"start":{"line":23,"column":4},"end":{"line":25,"column":null}},"7":{"start":{"line":24,"column":6},"end":{"line":24,"column":53}},"8":{"start":{"line":26,"column":4},"end":{"line":28,"column":null}},"9":{"start":{"line":27,"column":6},"end":{"line":27,"column":43}},"10":{"start":{"line":29,"column":4},"end":{"line":31,"column":null}},"11":{"start":{"line":30,"column":6},"end":{"line":30,"column":25}},"12":{"start":{"line":32,"column":4},"end":{"line":34,"column":null}},"13":{"start":{"line":33,"column":6},"end":{"line":33,"column":49}},"14":{"start":{"line":36,"column":26},"end":{"line":36,"column":55}},"15":{"start":{"line":37,"column":4},"end":{"line":37,"column":47}},"16":{"start":{"line":44,"column":4},"end":{"line":46,"column":null}},"17":{"start":{"line":45,"column":6},"end":{"line":45,"column":51}},"18":{"start":{"line":48,"column":26},"end":{"line":48,"column":28}},"19":{"start":{"line":50,"column":4},"end":{"line":61,"column":null}},"20":{"start":{"line":51,"column":22},"end":{"line":51,"column":56}},"21":{"start":{"line":52,"column":24},"end":{"line":52,"column":54}},"22":{"start":{"line":54,"column":6},"end":{"line":60,"column":null}},"23":{"start":{"line":55,"column":23},"end":{"line":55,"column":71}},"24":{"start":{"line":56,"column":8},"end":{"line":56,"column":43}},"25":{"start":{"line":59,"column":8},"end":{"line":59,"column":49}},"26":{"start":{"line":63,"column":4},"end":{"line":67,"column":6}},"27":{"start":{"line":71,"column":18},"end":{"line":71,"column":57}},"28":{"start":{"line":72,"column":4},"end":{"line":72,"column":35}},"29":{"start":{"line":80,"column":19},"end":{"line":92,"column":2}},"30":{"start":{"line":94,"column":4},"end":{"line":120,"column":null}},"31":{"start":{"line":95,"column":23},"end":{"line":99,"column":8}},"32":{"start":{"line":101,"column":31},"end":{"line":101,"column":72}},"33":{"start":{"line":102,"column":6},"end":{"line":102,"column":36}},"34":{"start":{"line":104,"column":21},"end":{"line":104,"column":43}},"35":{"start":{"line":106,"column":8},"end":{"line":106,"column":61}},"36":{"start":{"line":108,"column":6},"end":{"line":119,"column":null}},"37":{"start":{"line":110,"column":22},"end":{"line":110,"column":52}},"38":{"start":{"line":111,"column":8},"end":{"line":113,"column":10}},"39":{"start":{"line":114,"column":8},"end":{"line":114,"column":32}},"40":{"start":{"line":115,"column":8},"end":{"line":115,"column":74}},"41":{"start":{"line":117,"column":8},"end":{"line":117,"column":57}},"42":{"start":{"line":118,"column":8},"end":{"line":118,"column":20}},"43":{"start":{"line":124,"column":4},"end":{"line":124,"column":61}},"44":{"start":{"line":124,"column":36},"end":{"line":124,"column":59}},"45":{"start":{"line":6,"column":0},"end":{"line":6,"column":13}},"46":{"start":{"line":133,"column":85},"end":{"line":133,"column":39610}},"47":{"start":{"line":133,"column":89},"end":{"line":133,"column":39599}},"48":{"start":{"line":133,"column":39725},"end":{"line":133,"column":39731}},"49":{"start":{"line":133,"column":39846},"end":{"line":133,"column":39852}},"50":{"start":{"line":133,"column":39971},"end":{"line":133,"column":39977}},"51":{"start":{"line":133,"column":40121},"end":{"line":133,"column":40127}}},"fnMap":{"0":{"name":"(anonymous_13)","decl":{"start":{"line":12,"column":2},"end":{"line":12,"column":14}},"loc":{"start":{"line":22,"column":3},"end":{"line":38,"column":3}}},"1":{"name":"(anonymous_14)","decl":{"start":{"line":40,"column":15},"end":{"line":40,"column":30}},"loc":{"start":{"line":42,"column":21},"end":{"line":68,"column":null}}},"2":{"name":"(anonymous_16)","decl":{"start":{"line":70,"column":10},"end":{"line":70,"column":26}},"loc":{"start":{"line":70,"column":42},"end":{"line":73,"column":3}}},"3":{"name":"(anonymous_17)","decl":{"start":{"line":75,"column":16},"end":{"line":75,"column":33}},"loc":{"start":{"line":78,"column":18},"end":{"line":121,"column":null}}},"4":{"name":"(anonymous_19)","decl":{"start":{"line":123,"column":10},"end":{"line":123,"column":15}},"loc":{"start":{"line":123,"column":26},"end":{"line":125,"column":3}}},"5":{"name":"(anonymous_20)","decl":{"start":{"line":124,"column":23},"end":{"line":124,"column":24}},"loc":{"start":{"line":124,"column":36},"end":{"line":124,"column":59}}},"6":{"name":"oo_cm","decl":{"start":{"line":133,"column":77},"end":{"line":133,"column":82}},"loc":{"start":{"line":133,"column":82},"end":{"line":133,"column":39611}}}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":25}},"type":"default-arg","locations":[{"start":{"line":15,"column":12},"end":{"line":15,"column":25}}]},"1":{"loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":28}},"type":"default-arg","locations":[{"start":{"line":16,"column":24},"end":{"line":16,"column":28}}]},"2":{"loc":{"start":{"line":23,"column":4},"end":{"line":25,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":4},"end":{"line":25,"column":null}}]},"3":{"loc":{"start":{"line":26,"column":4},"end":{"line":28,"column":null}},"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":28,"column":null}}]},"4":{"loc":{"start":{"line":29,"column":4},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":4},"end":{"line":31,"column":null}}]},"5":{"loc":{"start":{"line":32,"column":4},"end":{"line":34,"column":null}},"type":"if","locations":[{"start":{"line":32,"column":4},"end":{"line":34,"column":null}}]},"6":{"loc":{"start":{"line":44,"column":4},"end":{"line":46,"column":null}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":46,"column":null}}]},"7":{"loc":{"start":{"line":54,"column":6},"end":{"line":60,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":6},"end":{"line":60,"column":null}}]},"8":{"loc":{"start":{"line":72,"column":11},"end":{"line":72,"column":34}},"type":"cond-expr","locations":[{"start":{"line":72,"column":19},"end":{"line":72,"column":27}},{"start":{"line":72,"column":30},"end":{"line":72,"column":34}}]},"9":{"loc":{"start":{"line":78,"column":4},"end":{"line":78,"column":18}},"type":"default-arg","locations":[{"start":{"line":78,"column":17},"end":{"line":78,"column":18}}]},"10":{"loc":{"start":{"line":101,"column":31},"end":{"line":101,"column":72}},"type":"cond-expr","locations":[{"start":{"line":101,"column":63},"end":{"line":101,"column":65}},{"start":{"line":101,"column":63},"end":{"line":101,"column":72}}]},"11":{"loc":{"start":{"line":101,"column":31},"end":{"line":101,"column":65}},"type":"binary-expr","locations":[{"start":{"line":101,"column":31},"end":{"line":101,"column":65}},{"start":{"line":101,"column":63},"end":{"line":101,"column":65}}]},"12":{"loc":{"start":{"line":102,"column":13},"end":{"line":102,"column":35}},"type":"binary-expr","locations":[{"start":{"line":102,"column":13},"end":{"line":102,"column":29}},{"start":{"line":102,"column":33},"end":{"line":102,"column":35}}]},"13":{"loc":{"start":{"line":104,"column":21},"end":{"line":104,"column":43}},"type":"cond-expr","locations":[{"start":{"line":104,"column":35},"end":{"line":104,"column":37}},{"start":{"line":104,"column":35},"end":{"line":104,"column":43}}]},"14":{"loc":{"start":{"line":104,"column":21},"end":{"line":104,"column":37}},"type":"binary-expr","locations":[{"start":{"line":104,"column":21},"end":{"line":104,"column":37}},{"start":{"line":104,"column":35},"end":{"line":104,"column":37}}]},"15":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":61}},"type":"binary-expr","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":44}},{"start":{"line":106,"column":48},"end":{"line":106,"column":61}}]},"16":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":44}},"type":"cond-expr","locations":[{"start":{"line":106,"column":35},"end":{"line":106,"column":37}},{"start":{"line":106,"column":35},"end":{"line":106,"column":44}}]},"17":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":37}},"type":"binary-expr","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":37}},{"start":{"line":106,"column":35},"end":{"line":106,"column":37}}]},"18":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":35}},"type":"cond-expr","locations":[{"start":{"line":106,"column":28},"end":{"line":106,"column":30}},{"start":{"line":106,"column":28},"end":{"line":106,"column":35}}]},"19":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":30}},"type":"binary-expr","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":30}},{"start":{"line":106,"column":28},"end":{"line":106,"column":30}}]},"20":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":28}},"type":"cond-expr","locations":[{"start":{"line":106,"column":22},"end":{"line":106,"column":24}},{"start":{"line":106,"column":22},"end":{"line":106,"column":28}}]},"21":{"loc":{"start":{"line":106,"column":8},"end":{"line":106,"column":24}},"type":"binary-expr","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":24}},{"start":{"line":106,"column":22},"end":{"line":106,"column":24}}]},"22":{"loc":{"start":{"line":108,"column":6},"end":{"line":119,"column":null}},"type":"if","locations":[{"start":{"line":108,"column":6},"end":{"line":119,"column":null}},{"start":{"line":116,"column":13},"end":{"line":119,"column":null}}]},"23":{"loc":{"start":{"line":108,"column":10},"end":{"line":108,"column":42}},"type":"binary-expr","locations":[{"start":{"line":108,"column":10},"end":{"line":108,"column":24}},{"start":{"line":108,"column":28},"end":{"line":108,"column":42}}]},"24":{"loc":{"start":{"line":133,"column":96},"end":{"line":133,"column":39598}},"type":"binary-expr","locations":[{"start":{"line":133,"column":96},"end":{"line":133,"column":133}},{"start":{"line":133,"column":137},"end":{"line":133,"column":39598}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":0,"8":1,"9":0,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":1,"44":1,"45":1,"46":0,"47":0,"48":1,"49":1,"50":1,"51":1},"f":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":0},"b":{"0":[1],"1":[1],"2":[0],"3":[0],"4":[1],"5":[1],"6":[1],"7":[1],"8":[1,0],"9":[1],"10":[0,1],"11":[1,1],"12":[1,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0]}} | ||
{"D:\\Code\\vorlefan\\toolkit\\src\\nestjs\\inputTransformer.ts": {"path":"D:\\Code\\vorlefan\\toolkit\\src\\nestjs\\inputTransformer.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":29}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":43}},"4":{"start":{"line":9,"column":12},"end":{"line":9,"column":55}},"5":{"start":{"line":10,"column":12},"end":{"line":10,"column":42}},"6":{"start":{"line":11,"column":12},"end":{"line":11,"column":45}},"7":{"start":{"line":12,"column":12},"end":{"line":12,"column":47}},"8":{"start":{"line":25,"column":4},"end":{"line":27,"column":null}},"9":{"start":{"line":26,"column":6},"end":{"line":26,"column":53}},"10":{"start":{"line":28,"column":4},"end":{"line":30,"column":null}},"11":{"start":{"line":29,"column":6},"end":{"line":29,"column":43}},"12":{"start":{"line":31,"column":4},"end":{"line":33,"column":null}},"13":{"start":{"line":32,"column":6},"end":{"line":32,"column":25}},"14":{"start":{"line":34,"column":4},"end":{"line":36,"column":null}},"15":{"start":{"line":35,"column":6},"end":{"line":35,"column":49}},"16":{"start":{"line":38,"column":26},"end":{"line":38,"column":55}},"17":{"start":{"line":39,"column":4},"end":{"line":39,"column":47}},"18":{"start":{"line":43,"column":4},"end":{"line":43,"column":38}},"19":{"start":{"line":44,"column":22},"end":{"line":44,"column":44}},"20":{"start":{"line":45,"column":4},"end":{"line":47,"column":null}},"21":{"start":{"line":46,"column":6},"end":{"line":46,"column":57}},"22":{"start":{"line":48,"column":18},"end":{"line":48,"column":68}},"23":{"start":{"line":50,"column":23},"end":{"line":50,"column":64}},"24":{"start":{"line":50,"column":43},"end":{"line":50,"column":63}},"25":{"start":{"line":52,"column":4},"end":{"line":54,"column":null}},"26":{"start":{"line":53,"column":6},"end":{"line":53,"column":46}},"27":{"start":{"line":56,"column":4},"end":{"line":58,"column":null}},"28":{"start":{"line":57,"column":6},"end":{"line":57,"column":51}},"29":{"start":{"line":60,"column":26},"end":{"line":60,"column":28}},"30":{"start":{"line":61,"column":24},"end":{"line":61,"column":127}},"31":{"start":{"line":63,"column":4},"end":{"line":75,"column":null}},"32":{"start":{"line":64,"column":22},"end":{"line":64,"column":56}},"33":{"start":{"line":65,"column":24},"end":{"line":65,"column":54}},"34":{"start":{"line":67,"column":6},"end":{"line":74,"column":null}},"35":{"start":{"line":68,"column":28},"end":{"line":68,"column":119}},"36":{"start":{"line":69,"column":23},"end":{"line":69,"column":71}},"37":{"start":{"line":70,"column":8},"end":{"line":70,"column":43}},"38":{"start":{"line":73,"column":8},"end":{"line":73,"column":49}},"39":{"start":{"line":77,"column":4},"end":{"line":79,"column":79}},"40":{"start":{"line":86,"column":4},"end":{"line":88,"column":null}},"41":{"start":{"line":87,"column":6},"end":{"line":87,"column":51}},"42":{"start":{"line":90,"column":26},"end":{"line":90,"column":28}},"43":{"start":{"line":91,"column":24},"end":{"line":91,"column":128}},"44":{"start":{"line":93,"column":4},"end":{"line":105,"column":null}},"45":{"start":{"line":94,"column":22},"end":{"line":94,"column":56}},"46":{"start":{"line":95,"column":24},"end":{"line":95,"column":54}},"47":{"start":{"line":97,"column":6},"end":{"line":104,"column":null}},"48":{"start":{"line":98,"column":28},"end":{"line":98,"column":119}},"49":{"start":{"line":99,"column":23},"end":{"line":99,"column":71}},"50":{"start":{"line":100,"column":8},"end":{"line":100,"column":43}},"51":{"start":{"line":103,"column":8},"end":{"line":103,"column":49}},"52":{"start":{"line":107,"column":4},"end":{"line":111,"column":6}},"53":{"start":{"line":115,"column":18},"end":{"line":115,"column":57}},"54":{"start":{"line":116,"column":4},"end":{"line":116,"column":35}},"55":{"start":{"line":124,"column":19},"end":{"line":136,"column":2}},"56":{"start":{"line":138,"column":4},"end":{"line":175,"column":null}},"57":{"start":{"line":139,"column":23},"end":{"line":143,"column":8}},"58":{"start":{"line":145,"column":31},"end":{"line":145,"column":72}},"59":{"start":{"line":148,"column":24},"end":{"line":149,"column":null}},"60":{"start":{"line":152,"column":6},"end":{"line":157,"column":null}},"61":{"start":{"line":153,"column":8},"end":{"line":153,"column":35}},"62":{"start":{"line":156,"column":8},"end":{"line":156,"column":46}},"63":{"start":{"line":159,"column":21},"end":{"line":159,"column":43}},"64":{"start":{"line":161,"column":8},"end":{"line":161,"column":61}},"65":{"start":{"line":163,"column":6},"end":{"line":174,"column":null}},"66":{"start":{"line":165,"column":22},"end":{"line":165,"column":52}},"67":{"start":{"line":166,"column":8},"end":{"line":168,"column":10}},"68":{"start":{"line":169,"column":8},"end":{"line":169,"column":32}},"69":{"start":{"line":170,"column":8},"end":{"line":170,"column":74}},"70":{"start":{"line":172,"column":8},"end":{"line":172,"column":57}},"71":{"start":{"line":173,"column":8},"end":{"line":173,"column":20}},"72":{"start":{"line":179,"column":4},"end":{"line":179,"column":61}},"73":{"start":{"line":179,"column":36},"end":{"line":179,"column":59}},"74":{"start":{"line":7,"column":0},"end":{"line":7,"column":13}},"75":{"start":{"line":188,"column":85},"end":{"line":188,"column":39610}},"76":{"start":{"line":188,"column":89},"end":{"line":188,"column":39599}},"77":{"start":{"line":188,"column":39725},"end":{"line":188,"column":39731}},"78":{"start":{"line":188,"column":39846},"end":{"line":188,"column":39852}},"79":{"start":{"line":188,"column":39971},"end":{"line":188,"column":39977}},"80":{"start":{"line":188,"column":40121},"end":{"line":188,"column":40127}}},"fnMap":{"0":{"name":"(anonymous_13)","decl":{"start":{"line":14,"column":2},"end":{"line":14,"column":14}},"loc":{"start":{"line":24,"column":3},"end":{"line":40,"column":3}}},"1":{"name":"(anonymous_14)","decl":{"start":{"line":42,"column":15},"end":{"line":42,"column":23}},"loc":{"start":{"line":42,"column":60},"end":{"line":80,"column":null}}},"2":{"name":"(anonymous_16)","decl":{"start":{"line":50,"column":36},"end":{"line":50,"column":37}},"loc":{"start":{"line":50,"column":43},"end":{"line":50,"column":63}}},"3":{"name":"(anonymous_17)","decl":{"start":{"line":82,"column":15},"end":{"line":82,"column":30}},"loc":{"start":{"line":84,"column":21},"end":{"line":112,"column":null}}},"4":{"name":"(anonymous_19)","decl":{"start":{"line":114,"column":10},"end":{"line":114,"column":26}},"loc":{"start":{"line":114,"column":42},"end":{"line":117,"column":3}}},"5":{"name":"(anonymous_20)","decl":{"start":{"line":119,"column":16},"end":{"line":119,"column":33}},"loc":{"start":{"line":122,"column":18},"end":{"line":176,"column":null}}},"6":{"name":"(anonymous_22)","decl":{"start":{"line":178,"column":10},"end":{"line":178,"column":15}},"loc":{"start":{"line":178,"column":26},"end":{"line":180,"column":3}}},"7":{"name":"(anonymous_23)","decl":{"start":{"line":179,"column":23},"end":{"line":179,"column":24}},"loc":{"start":{"line":179,"column":36},"end":{"line":179,"column":59}}},"8":{"name":"oo_cm","decl":{"start":{"line":188,"column":77},"end":{"line":188,"column":82}},"loc":{"start":{"line":188,"column":82},"end":{"line":188,"column":39611}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":4},"end":{"line":17,"column":25}},"type":"default-arg","locations":[{"start":{"line":17,"column":12},"end":{"line":17,"column":25}}]},"1":{"loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":28}},"type":"default-arg","locations":[{"start":{"line":18,"column":24},"end":{"line":18,"column":28}}]},"2":{"loc":{"start":{"line":25,"column":4},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":25,"column":4},"end":{"line":27,"column":null}}]},"3":{"loc":{"start":{"line":28,"column":4},"end":{"line":30,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":30,"column":null}}]},"4":{"loc":{"start":{"line":31,"column":4},"end":{"line":33,"column":null}},"type":"if","locations":[{"start":{"line":31,"column":4},"end":{"line":33,"column":null}}]},"5":{"loc":{"start":{"line":34,"column":4},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":36,"column":null}}]},"6":{"loc":{"start":{"line":45,"column":4},"end":{"line":47,"column":null}},"type":"if","locations":[{"start":{"line":45,"column":4},"end":{"line":47,"column":null}}]},"7":{"loc":{"start":{"line":45,"column":9},"end":{"line":45,"column":29}},"type":"cond-expr","locations":[{"start":{"line":45,"column":18},"end":{"line":45,"column":20}},{"start":{"line":45,"column":9},"end":{"line":45,"column":29}}]},"8":{"loc":{"start":{"line":45,"column":9},"end":{"line":45,"column":20}},"type":"binary-expr","locations":[{"start":{"line":45,"column":9},"end":{"line":45,"column":20}},{"start":{"line":45,"column":9},"end":{"line":45,"column":20}}]},"9":{"loc":{"start":{"line":52,"column":4},"end":{"line":54,"column":null}},"type":"if","locations":[{"start":{"line":52,"column":4},"end":{"line":54,"column":null}}]},"10":{"loc":{"start":{"line":56,"column":4},"end":{"line":58,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":58,"column":null}}]},"11":{"loc":{"start":{"line":67,"column":6},"end":{"line":74,"column":null}},"type":"if","locations":[{"start":{"line":67,"column":6},"end":{"line":74,"column":null}}]},"12":{"loc":{"start":{"line":86,"column":4},"end":{"line":88,"column":null}},"type":"if","locations":[{"start":{"line":86,"column":4},"end":{"line":88,"column":null}}]},"13":{"loc":{"start":{"line":97,"column":6},"end":{"line":104,"column":null}},"type":"if","locations":[{"start":{"line":97,"column":6},"end":{"line":104,"column":null}}]},"14":{"loc":{"start":{"line":116,"column":11},"end":{"line":116,"column":34}},"type":"cond-expr","locations":[{"start":{"line":116,"column":19},"end":{"line":116,"column":27}},{"start":{"line":116,"column":30},"end":{"line":116,"column":34}}]},"15":{"loc":{"start":{"line":122,"column":4},"end":{"line":122,"column":18}},"type":"default-arg","locations":[{"start":{"line":122,"column":17},"end":{"line":122,"column":18}}]},"16":{"loc":{"start":{"line":145,"column":31},"end":{"line":145,"column":72}},"type":"cond-expr","locations":[{"start":{"line":145,"column":63},"end":{"line":145,"column":65}},{"start":{"line":145,"column":63},"end":{"line":145,"column":72}}]},"17":{"loc":{"start":{"line":145,"column":31},"end":{"line":145,"column":65}},"type":"binary-expr","locations":[{"start":{"line":145,"column":31},"end":{"line":145,"column":65}},{"start":{"line":145,"column":63},"end":{"line":145,"column":65}}]},"18":{"loc":{"start":{"line":148,"column":24},"end":{"line":149,"column":null}},"type":"cond-expr","locations":[{"start":{"line":148,"column":40},"end":{"line":148,"column":42}},{"start":{"line":148,"column":24},"end":{"line":149,"column":null}}]},"19":{"loc":{"start":{"line":148,"column":24},"end":{"line":148,"column":42}},"type":"binary-expr","locations":[{"start":{"line":148,"column":24},"end":{"line":148,"column":42}},{"start":{"line":148,"column":24},"end":{"line":148,"column":42}}]},"20":{"loc":{"start":{"line":152,"column":6},"end":{"line":157,"column":null}},"type":"if","locations":[{"start":{"line":152,"column":6},"end":{"line":157,"column":null}},{"start":{"line":154,"column":13},"end":{"line":157,"column":null}}]},"21":{"loc":{"start":{"line":152,"column":10},"end":{"line":152,"column":35}},"type":"binary-expr","locations":[{"start":{"line":152,"column":10},"end":{"line":152,"column":19}},{"start":{"line":152,"column":23},"end":{"line":152,"column":35}}]},"22":{"loc":{"start":{"line":156,"column":15},"end":{"line":156,"column":45}},"type":"binary-expr","locations":[{"start":{"line":156,"column":15},"end":{"line":156,"column":39}},{"start":{"line":156,"column":43},"end":{"line":156,"column":45}}]},"23":{"loc":{"start":{"line":156,"column":15},"end":{"line":156,"column":39}},"type":"cond-expr","locations":[{"start":{"line":156,"column":31},"end":{"line":156,"column":33}},{"start":{"line":156,"column":15},"end":{"line":156,"column":39}}]},"24":{"loc":{"start":{"line":156,"column":15},"end":{"line":156,"column":33}},"type":"binary-expr","locations":[{"start":{"line":156,"column":15},"end":{"line":156,"column":33}},{"start":{"line":156,"column":15},"end":{"line":156,"column":33}}]},"25":{"loc":{"start":{"line":159,"column":21},"end":{"line":159,"column":43}},"type":"cond-expr","locations":[{"start":{"line":159,"column":35},"end":{"line":159,"column":37}},{"start":{"line":159,"column":35},"end":{"line":159,"column":43}}]},"26":{"loc":{"start":{"line":159,"column":21},"end":{"line":159,"column":37}},"type":"binary-expr","locations":[{"start":{"line":159,"column":21},"end":{"line":159,"column":37}},{"start":{"line":159,"column":35},"end":{"line":159,"column":37}}]},"27":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":61}},"type":"binary-expr","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":44}},{"start":{"line":161,"column":48},"end":{"line":161,"column":61}}]},"28":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":44}},"type":"cond-expr","locations":[{"start":{"line":161,"column":35},"end":{"line":161,"column":37}},{"start":{"line":161,"column":35},"end":{"line":161,"column":44}}]},"29":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":37}},"type":"binary-expr","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":37}},{"start":{"line":161,"column":35},"end":{"line":161,"column":37}}]},"30":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":35}},"type":"cond-expr","locations":[{"start":{"line":161,"column":28},"end":{"line":161,"column":30}},{"start":{"line":161,"column":28},"end":{"line":161,"column":35}}]},"31":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":30}},"type":"binary-expr","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":30}},{"start":{"line":161,"column":28},"end":{"line":161,"column":30}}]},"32":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":28}},"type":"cond-expr","locations":[{"start":{"line":161,"column":22},"end":{"line":161,"column":24}},{"start":{"line":161,"column":22},"end":{"line":161,"column":28}}]},"33":{"loc":{"start":{"line":161,"column":8},"end":{"line":161,"column":24}},"type":"binary-expr","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":24}},{"start":{"line":161,"column":22},"end":{"line":161,"column":24}}]},"34":{"loc":{"start":{"line":163,"column":6},"end":{"line":174,"column":null}},"type":"if","locations":[{"start":{"line":163,"column":6},"end":{"line":174,"column":null}},{"start":{"line":171,"column":13},"end":{"line":174,"column":null}}]},"35":{"loc":{"start":{"line":163,"column":10},"end":{"line":163,"column":42}},"type":"binary-expr","locations":[{"start":{"line":163,"column":10},"end":{"line":163,"column":24}},{"start":{"line":163,"column":28},"end":{"line":163,"column":42}}]},"36":{"loc":{"start":{"line":188,"column":96},"end":{"line":188,"column":39598}},"type":"binary-expr","locations":[{"start":{"line":188,"column":96},"end":{"line":188,"column":133}},{"start":{"line":188,"column":137},"end":{"line":188,"column":39598}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":0,"10":1,"11":0,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":1,"58":1,"59":1,"60":1,"61":0,"62":1,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":1,"73":1,"74":1,"75":2,"76":2,"77":1,"78":1,"79":1,"80":1},"f":{"0":1,"1":0,"2":0,"3":1,"4":1,"5":1,"6":1,"7":1,"8":2},"b":{"0":[1],"1":[1],"2":[0],"3":[0],"4":[1],"5":[1],"6":[0],"7":[0,0],"8":[0,0],"9":[0],"10":[0],"11":[0],"12":[1],"13":[1],"14":[1,0],"15":[1],"16":[0,1],"17":[1,1],"18":[0,1],"19":[1,1],"20":[0,1],"21":[1,0],"22":[1,0],"23":[0,1],"24":[1,1],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[2,1]}} | ||
,"D:\\Code\\vorlefan\\toolkit\\test\\const.ts": {"path":"D:\\Code\\vorlefan\\toolkit\\test\\const.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}},"2":{"start":{"line":4,"column":13},"end":{"line":4,"column":61}}},"fnMap":{},"branchMap":{"0":{"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":60}},"type":"cond-expr","locations":[{"start":{"line":4,"column":38},"end":{"line":4,"column":40}},{"start":{"line":4,"column":38},"end":{"line":4,"column":60}}]},"1":{"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":40}},"type":"binary-expr","locations":[{"start":{"line":4,"column":26},"end":{"line":4,"column":40}},{"start":{"line":4,"column":38},"end":{"line":4,"column":40}}]},"2":{"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":38}},"type":"cond-expr","locations":[{"start":{"line":4,"column":33},"end":{"line":4,"column":35}},{"start":{"line":4,"column":26},"end":{"line":4,"column":38}}]},"3":{"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":35}},"type":"binary-expr","locations":[{"start":{"line":4,"column":26},"end":{"line":4,"column":35}},{"start":{"line":4,"column":26},"end":{"line":4,"column":35}}]}},"s":{"0":2,"1":2,"2":2},"f":{},"b":{"0":[0,2],"1":[2,2],"2":[0,2],"3":[2,2]}} | ||
} |
import { FileInfo } from "../utils/scanFiles"; | ||
import { PathRoute } from "@vorlefan/path"; | ||
export declare class InputTransformer { | ||
@@ -7,2 +8,3 @@ private openai; | ||
protected delayBetweenCalls: number; | ||
protected route: PathRoute; | ||
constructor({ apiKey, outputFilename, model, delayBetweenCalls, }: { | ||
@@ -14,2 +16,3 @@ apiKey: string; | ||
}); | ||
generate(nestjsDir: string, outputDir: string): Promise<void>; | ||
transformInputs(inputs: Map<string, FileInfo>, outputDir: string): Promise<void>; | ||
@@ -16,0 +19,0 @@ private extractClassName; |
@@ -39,2 +39,3 @@ "use strict"; | ||
const path = __importStar(require("path")); | ||
const path_1 = require("@vorlefan/path"); | ||
class InputTransformer { | ||
@@ -46,2 +47,3 @@ constructor({ apiKey, outputFilename, model = "gpt-4o-mini", delayBetweenCalls = 1000, // delay in milliseconds | ||
this.delayBetweenCalls = 1000; // default to 1 second | ||
this.route = new path_1.PathRoute(); | ||
if (!apiKey) { | ||
@@ -62,2 +64,35 @@ throw new Error("OpenAI API key is required."); | ||
} | ||
generate(nestjsDir, outputDir) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
this.route.add("root", nestjsDir); | ||
const rootRoute = this.route.get("root"); | ||
if (!(rootRoute === null || rootRoute === void 0 ? void 0 : rootRoute.routePath)) { | ||
throw new Error("Error in finding the nestjs dir"); | ||
} | ||
const files = yield this.route.allFilepaths(rootRoute.routePath); | ||
const inputFiles = files.filter((d) => d.includes(".input")); | ||
if (inputFiles.length === 0) { | ||
throw new Error("No input files found"); | ||
} | ||
if (!fs.existsSync(outputDir)) { | ||
fs.mkdirSync(outputDir, { recursive: true }); | ||
} | ||
let combinedContent = ""; | ||
console.log("[InputTransformer]", "total to generate", inputFiles); | ||
for (const filepath of inputFiles) { | ||
const content = fs.readFileSync(filepath, "utf-8"); | ||
const className = this.extractClassName(content); | ||
if (className) { | ||
console.log("[InputTransformer]", filepath, className); | ||
const schema = yield this.generateZodSchema(content, className); | ||
combinedContent += schema + "\n\n"; | ||
// Wait between API calls to avoid rate limits | ||
yield this.sleep(this.delayBetweenCalls); | ||
} | ||
} | ||
yield this.route | ||
.io() | ||
.write(path.join(outputDir, this.outputFilename), combinedContent, true); | ||
}); | ||
} | ||
transformInputs(inputs, outputDir) { | ||
@@ -69,2 +104,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
let combinedContent = ""; | ||
console.log("[InputTransformer]", "total to generate", inputs.size); | ||
for (const [filepath, fileInfo] of inputs) { | ||
@@ -74,2 +110,3 @@ const content = fs.readFileSync(filepath, "utf-8"); | ||
if (className) { | ||
console.log("[InputTransformer]", filepath, className); | ||
const schema = yield this.generateZodSchema(content, className); | ||
@@ -92,3 +129,3 @@ combinedContent += schema + "\n\n"; | ||
const prompt = ` | ||
Convert the following TypeScript InputType class into a Zod schema. | ||
Convert the following TypeScript InputType class into an equivalent Zod schema. Return only the TypeScript code for the schema without any explanations, comments, or markdown formatting. | ||
@@ -100,3 +137,3 @@ TypeScript Class: | ||
Zod Schema should be in the format: | ||
Provide the Zod schema in the following format: | ||
@@ -113,3 +150,11 @@ export const ${className}Schema = z.object({ /* fields */ }); | ||
const assistantMessage = (_a = response.data.choices[0].message) === null || _a === void 0 ? void 0 : _a.content; | ||
return assistantMessage || ""; | ||
// Extract code block from the assistant's message | ||
const codeMatch = assistantMessage === null || assistantMessage === void 0 ? void 0 : assistantMessage.match(/export\s+const\s+${className}Schema[\s\S]*?;\nexport\s+type\s+${className}SchemaContext[\s\S]*?;/); | ||
if (codeMatch && codeMatch[0]) { | ||
return codeMatch[0].trim(); | ||
} | ||
else { | ||
// If code block not found, return the assistant's message directly | ||
return (assistantMessage === null || assistantMessage === void 0 ? void 0 : assistantMessage.trim()) || ""; | ||
} | ||
} | ||
@@ -116,0 +161,0 @@ catch (error) { |
{ | ||
"name": "@vorlefan/toolkit", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A general-purpose toolkit for Node.js applications.", | ||
@@ -27,2 +27,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@vorlefan/path": "^1.8.35", | ||
"commander": "^8.0.0", | ||
@@ -29,0 +30,0 @@ "openai": "^3.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
87094
985
4
+ Added@vorlefan/path@^1.8.35
+ Added@vorlefan/path@1.8.35(transitive)