Comparing version 2.0.2 to 2.1.0
@@ -1,1 +0,1 @@ | ||
{"/Users/Chris/Workspace/koa/koa-jade/example/app.js":{"path":"/Users/Chris/Workspace/koa/koa-jade/example/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":11,"11":11,"12":1,"13":5,"14":1,"15":1,"16":1,"17":2,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1},"b":{},"f":{"1":11,"2":5,"3":1,"4":2,"5":1,"6":1,"7":1},"fnMap":{"1":{"name":"(anonymous_1)","line":24,"loc":{"start":{"line":24,"column":8},"end":{"line":24,"column":25}}},"2":{"name":"(anonymous_2)","line":29,"loc":{"start":{"line":29,"column":24},"end":{"line":29,"column":37}}},"3":{"name":"(anonymous_3)","line":35,"loc":{"start":{"line":35,"column":28},"end":{"line":35,"column":41}}},"4":{"name":"(anonymous_4)","line":39,"loc":{"start":{"line":39,"column":27},"end":{"line":39,"column":40}}},"5":{"name":"(anonymous_5)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":46}}},"6":{"name":"(anonymous_6)","line":47,"loc":{"start":{"line":47,"column":32},"end":{"line":47,"column":45}}},"7":{"name":"(anonymous_7)","line":51,"loc":{"start":{"line":51,"column":30},"end":{"line":51,"column":43}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":33}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":15}},"6":{"start":{"line":7,"column":0},"end":{"line":18,"column":2}},"7":{"start":{"line":20,"column":0},"end":{"line":20,"column":44}},"8":{"start":{"line":22,"column":0},"end":{"line":22,"column":24}},"9":{"start":{"line":24,"column":0},"end":{"line":27,"column":2}},"10":{"start":{"line":25,"column":2},"end":{"line":25,"column":57}},"11":{"start":{"line":26,"column":2},"end":{"line":26,"column":12}},"12":{"start":{"line":29,"column":0},"end":{"line":33,"column":3}},"13":{"start":{"line":30,"column":2},"end":{"line":32,"column":4}},"14":{"start":{"line":35,"column":0},"end":{"line":37,"column":3}},"15":{"start":{"line":36,"column":2},"end":{"line":36,"column":21}},"16":{"start":{"line":39,"column":0},"end":{"line":41,"column":3}},"17":{"start":{"line":40,"column":2},"end":{"line":40,"column":20}},"18":{"start":{"line":43,"column":0},"end":{"line":45,"column":3}},"19":{"start":{"line":44,"column":2},"end":{"line":44,"column":26}},"20":{"start":{"line":47,"column":0},"end":{"line":49,"column":3}},"21":{"start":{"line":48,"column":2},"end":{"line":48,"column":20}},"22":{"start":{"line":51,"column":0},"end":{"line":53,"column":3}},"23":{"start":{"line":52,"column":2},"end":{"line":52,"column":23}},"24":{"start":{"line":55,"column":0},"end":{"line":55,"column":20}}},"branchMap":{}},"/Users/Chris/Workspace/koa/koa-jade/index.js":{"path":"/Users/Chris/Workspace/koa/koa-jade/index.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":2,"12":1,"13":1,"14":1,"15":0,"16":1,"17":1,"18":1,"19":0,"20":1,"21":2,"22":2,"23":2,"24":1,"25":1,"26":1,"27":1,"28":1,"29":0,"30":1,"31":1,"32":0,"33":1,"34":1,"35":7,"36":7,"37":7,"38":7,"39":7,"40":7,"41":1,"42":11,"43":11,"44":5,"45":6,"46":6,"47":6,"48":2,"49":1,"50":1,"51":10,"52":10,"53":10,"54":0,"55":10,"56":10,"57":0,"58":10,"59":10,"60":0,"61":10,"62":10,"63":5,"64":5,"65":10,"66":10,"67":10,"68":7,"69":11,"70":11,"71":4,"72":8,"73":1,"74":7,"75":0,"76":0,"77":7,"78":7,"79":2,"80":7,"81":0,"82":7,"83":1,"84":7,"85":1,"86":1,"87":6,"88":12,"89":12,"90":7,"91":0,"92":7,"93":3,"94":1,"95":2,"96":1,"97":7,"98":1,"99":1},"b":{"1":[1,0],"2":[1,1],"3":[1,0],"4":[0,1],"5":[1,0],"6":[1,1],"7":[1,0],"8":[0,1],"9":[1,0],"10":[5,6],"11":[2,4],"12":[1,0],"13":[0,10],"14":[0,10],"15":[0,10],"16":[0,10],"17":[5,5],"18":[1,7],"19":[0,7],"20":[1,6],"21":[2,5],"22":[0,7],"23":[1,6],"24":[7,7],"25":[1,6],"26":[12,0],"27":[12,12],"28":[0,7],"29":[1,2],"30":[1,1]},"f":{"1":1,"2":2,"3":1,"4":2,"5":1,"6":7,"7":11,"8":11,"9":4,"10":8,"11":12,"12":7,"13":3},"fnMap":{"1":{"name":"loadHelpers","line":8,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":28}}},"2":{"name":"(anonymous_2)","line":12,"loc":{"start":{"line":12,"column":20},"end":{"line":12,"column":36}}},"3":{"name":"(anonymous_3)","line":14,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":44}}},"4":{"name":"load","line":31,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":34}}},"5":{"name":"(anonymous_5)","line":36,"loc":{"start":{"line":36,"column":37},"end":{"line":36,"column":53}}},"6":{"name":"Jade","line":55,"loc":{"start":{"line":55,"column":0},"end":{"line":55,"column":24}}},"7":{"name":"renderer","line":72,"loc":{"start":{"line":72,"column":2},"end":{"line":72,"column":52}}},"8":{"name":"(anonymous_8)","line":126,"loc":{"start":{"line":126,"column":13},"end":{"line":126,"column":30}}},"9":{"name":"(anonymous_9)","line":135,"loc":{"start":{"line":135,"column":11},"end":{"line":135,"column":23}}},"10":{"name":"(anonymous_10)","line":138,"loc":{"start":{"line":138,"column":11},"end":{"line":138,"column":30}}},"11":{"name":"(anonymous_11)","line":166,"loc":{"start":{"line":166,"column":34},"end":{"line":166,"column":56}}},"12":{"name":"(anonymous_12)","line":181,"loc":{"start":{"line":181,"column":11},"end":{"line":181,"column":23}}},"13":{"name":"(anonymous_13)","line":185,"loc":{"start":{"line":185,"column":11},"end":{"line":185,"column":26}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":25}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":28}},"7":{"start":{"line":8,"column":0},"end":{"line":53,"column":1}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":18}},"9":{"start":{"line":11,"column":2},"end":{"line":29,"column":3}},"10":{"start":{"line":12,"column":4},"end":{"line":26,"column":6}},"11":{"start":{"line":13,"column":6},"end":{"line":25,"column":7}},"12":{"start":{"line":14,"column":8},"end":{"line":22,"column":10}},"13":{"start":{"line":15,"column":10},"end":{"line":21,"column":11}},"14":{"start":{"line":16,"column":12},"end":{"line":20,"column":13}},"15":{"start":{"line":17,"column":14},"end":{"line":17,"column":30}},"16":{"start":{"line":19,"column":14},"end":{"line":19,"column":34}},"17":{"start":{"line":23,"column":13},"end":{"line":25,"column":7}},"18":{"start":{"line":24,"column":8},"end":{"line":24,"column":18}},"19":{"start":{"line":28,"column":4},"end":{"line":28,"column":14}},"20":{"start":{"line":31,"column":2},"end":{"line":50,"column":3}},"21":{"start":{"line":32,"column":4},"end":{"line":32,"column":36}},"22":{"start":{"line":33,"column":4},"end":{"line":33,"column":36}},"23":{"start":{"line":35,"column":4},"end":{"line":49,"column":5}},"24":{"start":{"line":36,"column":6},"end":{"line":38,"column":8}},"25":{"start":{"line":37,"column":8},"end":{"line":37,"column":30}},"26":{"start":{"line":39,"column":11},"end":{"line":49,"column":5}},"27":{"start":{"line":40,"column":6},"end":{"line":40,"column":33}},"28":{"start":{"line":42,"column":6},"end":{"line":48,"column":7}},"29":{"start":{"line":43,"column":8},"end":{"line":43,"column":33}},"30":{"start":{"line":44,"column":13},"end":{"line":48,"column":7}},"31":{"start":{"line":45,"column":8},"end":{"line":45,"column":48}},"32":{"start":{"line":47,"column":8},"end":{"line":47,"column":83}},"33":{"start":{"line":52,"column":2},"end":{"line":52,"column":16}},"34":{"start":{"line":55,"column":0},"end":{"line":199,"column":1}},"35":{"start":{"line":56,"column":2},"end":{"line":59,"column":3}},"36":{"start":{"line":60,"column":2},"end":{"line":60,"column":27}},"37":{"start":{"line":61,"column":2},"end":{"line":61,"column":27}},"38":{"start":{"line":62,"column":2},"end":{"line":62,"column":24}},"39":{"start":{"line":63,"column":2},"end":{"line":63,"column":14}},"40":{"start":{"line":64,"column":2},"end":{"line":64,"column":18}},"41":{"start":{"line":72,"column":2},"end":{"line":121,"column":3}},"42":{"start":{"line":73,"column":4},"end":{"line":73,"column":61}},"43":{"start":{"line":75,"column":4},"end":{"line":89,"column":5}},"44":{"start":{"line":76,"column":6},"end":{"line":76,"column":43}},"45":{"start":{"line":79,"column":6},"end":{"line":79,"column":47}},"46":{"start":{"line":80,"column":6},"end":{"line":80,"column":33}},"47":{"start":{"line":83,"column":6},"end":{"line":88,"column":7}},"48":{"start":{"line":84,"column":8},"end":{"line":84,"column":39}},"49":{"start":{"line":85,"column":8},"end":{"line":87,"column":9}},"50":{"start":{"line":86,"column":10},"end":{"line":86,"column":55}},"51":{"start":{"line":91,"column":4},"end":{"line":91,"column":38}},"52":{"start":{"line":93,"column":4},"end":{"line":93,"column":48}},"53":{"start":{"line":95,"column":4},"end":{"line":97,"column":5}},"54":{"start":{"line":96,"column":6},"end":{"line":96,"column":38}},"55":{"start":{"line":99,"column":4},"end":{"line":99,"column":37}},"56":{"start":{"line":101,"column":4},"end":{"line":105,"column":5}},"57":{"start":{"line":102,"column":6},"end":{"line":102,"column":25}},"58":{"start":{"line":104,"column":6},"end":{"line":104,"column":64}},"59":{"start":{"line":107,"column":4},"end":{"line":116,"column":5}},"60":{"start":{"line":108,"column":6},"end":{"line":108,"column":54}},"61":{"start":{"line":110,"column":6},"end":{"line":110,"column":39}},"62":{"start":{"line":112,"column":6},"end":{"line":115,"column":7}},"63":{"start":{"line":113,"column":8},"end":{"line":113,"column":56}},"64":{"start":{"line":114,"column":8},"end":{"line":114,"column":40}},"65":{"start":{"line":118,"column":4},"end":{"line":118,"column":81}},"66":{"start":{"line":119,"column":4},"end":{"line":119,"column":27}},"67":{"start":{"line":120,"column":4},"end":{"line":120,"column":15}},"68":{"start":{"line":123,"column":2},"end":{"line":193,"column":4}},"69":{"start":{"line":127,"column":8},"end":{"line":127,"column":30}},"70":{"start":{"line":128,"column":8},"end":{"line":128,"column":18}},"71":{"start":{"line":136,"column":8},"end":{"line":136,"column":29}},"72":{"start":{"line":139,"column":8},"end":{"line":141,"column":9}},"73":{"start":{"line":140,"column":10},"end":{"line":140,"column":16}},"74":{"start":{"line":143,"column":8},"end":{"line":146,"column":9}},"75":{"start":{"line":144,"column":10},"end":{"line":144,"column":29}},"76":{"start":{"line":145,"column":10},"end":{"line":145,"column":16}},"77":{"start":{"line":148,"column":8},"end":{"line":148,"column":77}},"78":{"start":{"line":150,"column":8},"end":{"line":152,"column":9}},"79":{"start":{"line":151,"column":10},"end":{"line":151,"column":40}},"80":{"start":{"line":154,"column":8},"end":{"line":156,"column":9}},"81":{"start":{"line":155,"column":10},"end":{"line":155,"column":41}},"82":{"start":{"line":158,"column":8},"end":{"line":160,"column":9}},"83":{"start":{"line":159,"column":10},"end":{"line":159,"column":59}},"84":{"start":{"line":162,"column":8},"end":{"line":171,"column":9}},"85":{"start":{"line":163,"column":10},"end":{"line":163,"column":47}},"86":{"start":{"line":164,"column":10},"end":{"line":164,"column":53}},"87":{"start":{"line":166,"column":10},"end":{"line":170,"column":12}},"88":{"start":{"line":167,"column":12},"end":{"line":169,"column":13}},"89":{"start":{"line":168,"column":14},"end":{"line":168,"column":48}},"90":{"start":{"line":173,"column":8},"end":{"line":175,"column":9}},"91":{"start":{"line":174,"column":10},"end":{"line":174,"column":50}},"92":{"start":{"line":182,"column":8},"end":{"line":182,"column":28}},"93":{"start":{"line":186,"column":8},"end":{"line":190,"column":9}},"94":{"start":{"line":187,"column":10},"end":{"line":187,"column":28}},"95":{"start":{"line":188,"column":15},"end":{"line":190,"column":9}},"96":{"start":{"line":189,"column":10},"end":{"line":189,"column":29}},"97":{"start":{"line":195,"column":2},"end":{"line":198,"column":13}},"98":{"start":{"line":201,"column":0},"end":{"line":206,"column":2}},"99":{"start":{"line":208,"column":0},"end":{"line":208,"column":21}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":2},"end":{"line":11,"column":2}},{"start":{"line":11,"column":2},"end":{"line":11,"column":2}}]},"2":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":6},"end":{"line":13,"column":6}},{"start":{"line":13,"column":6},"end":{"line":13,"column":6}}]},"3":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":10},"end":{"line":15,"column":10}},{"start":{"line":15,"column":10},"end":{"line":15,"column":10}}]},"4":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":12},"end":{"line":16,"column":12}},{"start":{"line":16,"column":12},"end":{"line":16,"column":12}}]},"5":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":13},"end":{"line":23,"column":13}},{"start":{"line":23,"column":13},"end":{"line":23,"column":13}}]},"6":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":4},"end":{"line":35,"column":4}},{"start":{"line":35,"column":4},"end":{"line":35,"column":4}}]},"7":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":11},"end":{"line":39,"column":11}},{"start":{"line":39,"column":11},"end":{"line":39,"column":11}}]},"8":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":6}},{"start":{"line":42,"column":6},"end":{"line":42,"column":6}}]},"9":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":13},"end":{"line":44,"column":13}},{"start":{"line":44,"column":13},"end":{"line":44,"column":13}}]},"10":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":75,"column":4}},{"start":{"line":75,"column":4},"end":{"line":75,"column":4}}]},"11":{"line":83,"type":"if","locations":[{"start":{"line":83,"column":6},"end":{"line":83,"column":6}},{"start":{"line":83,"column":6},"end":{"line":83,"column":6}}]},"12":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":8},"end":{"line":85,"column":8}},{"start":{"line":85,"column":8},"end":{"line":85,"column":8}}]},"13":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":4},"end":{"line":95,"column":4}},{"start":{"line":95,"column":4},"end":{"line":95,"column":4}}]},"14":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":4},"end":{"line":101,"column":4}},{"start":{"line":101,"column":4},"end":{"line":101,"column":4}}]},"15":{"line":104,"type":"cond-expr","locations":[{"start":{"line":104,"column":41},"end":{"line":104,"column":48}},{"start":{"line":104,"column":51},"end":{"line":104,"column":64}}]},"16":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":4},"end":{"line":107,"column":4}},{"start":{"line":107,"column":4},"end":{"line":107,"column":4}}]},"17":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":6},"end":{"line":112,"column":6}},{"start":{"line":112,"column":6},"end":{"line":112,"column":6}}]},"18":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"19":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"20":{"line":148,"type":"cond-expr","locations":[{"start":{"line":148,"column":50},"end":{"line":148,"column":66}},{"start":{"line":148,"column":69},"end":{"line":148,"column":77}}]},"21":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":8},"end":{"line":150,"column":8}},{"start":{"line":150,"column":8},"end":{"line":150,"column":8}}]},"22":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"23":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":8},"end":{"line":158,"column":8}},{"start":{"line":158,"column":8},"end":{"line":158,"column":8}}]},"24":{"line":158,"type":"binary-expr","locations":[{"start":{"line":158,"column":12},"end":{"line":158,"column":42}},{"start":{"line":158,"column":46},"end":{"line":158,"column":75}}]},"25":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"26":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":12},"end":{"line":167,"column":12}},{"start":{"line":167,"column":12},"end":{"line":167,"column":12}}]},"27":{"line":167,"type":"binary-expr","locations":[{"start":{"line":167,"column":16},"end":{"line":167,"column":30}},{"start":{"line":167,"column":34},"end":{"line":167,"column":59}}]},"28":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"29":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"30":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":15},"end":{"line":188,"column":15}},{"start":{"line":188,"column":15},"end":{"line":188,"column":15}}]}}},"/Users/Chris/Workspace/koa/koa-jade/example/helpers/format-date.js":{"path":"/Users/Chris/Workspace/koa/koa-jade/example/helpers/format-date.js","s":{"1":1,"2":6},"b":{},"f":{"1":6},"fnMap":{"1":{"name":"(anonymous_1)","line":3,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},"2":{"start":{"line":4,"column":4},"end":{"line":4,"column":83}}},"branchMap":{}}} | ||
{"/Users/Chris/Workspace/koa/koa-jade/example/app.js":{"path":"/Users/Chris/Workspace/koa/koa-jade/example/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":11,"10":11,"11":1,"12":5,"13":1,"14":1,"15":1,"16":2,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1},"b":{},"f":{"1":11,"2":5,"3":1,"4":2,"5":1,"6":1,"7":1},"fnMap":{"1":{"name":"(anonymous_1)","line":23,"loc":{"start":{"line":23,"column":8},"end":{"line":23,"column":25}}},"2":{"name":"(anonymous_2)","line":28,"loc":{"start":{"line":28,"column":24},"end":{"line":28,"column":37}}},"3":{"name":"(anonymous_3)","line":34,"loc":{"start":{"line":34,"column":28},"end":{"line":34,"column":41}}},"4":{"name":"(anonymous_4)","line":38,"loc":{"start":{"line":38,"column":27},"end":{"line":38,"column":40}}},"5":{"name":"(anonymous_5)","line":42,"loc":{"start":{"line":42,"column":33},"end":{"line":42,"column":46}}},"6":{"name":"(anonymous_6)","line":46,"loc":{"start":{"line":46,"column":32},"end":{"line":46,"column":45}}},"7":{"name":"(anonymous_7)","line":50,"loc":{"start":{"line":50,"column":30},"end":{"line":50,"column":43}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":33}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":15}},"6":{"start":{"line":7,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":21,"column":0},"end":{"line":21,"column":44}},"8":{"start":{"line":23,"column":0},"end":{"line":26,"column":2}},"9":{"start":{"line":24,"column":2},"end":{"line":24,"column":57}},"10":{"start":{"line":25,"column":2},"end":{"line":25,"column":12}},"11":{"start":{"line":28,"column":0},"end":{"line":32,"column":3}},"12":{"start":{"line":29,"column":2},"end":{"line":31,"column":4}},"13":{"start":{"line":34,"column":0},"end":{"line":36,"column":3}},"14":{"start":{"line":35,"column":2},"end":{"line":35,"column":21}},"15":{"start":{"line":38,"column":0},"end":{"line":40,"column":3}},"16":{"start":{"line":39,"column":2},"end":{"line":39,"column":20}},"17":{"start":{"line":42,"column":0},"end":{"line":44,"column":3}},"18":{"start":{"line":43,"column":2},"end":{"line":43,"column":26}},"19":{"start":{"line":46,"column":0},"end":{"line":48,"column":3}},"20":{"start":{"line":47,"column":2},"end":{"line":47,"column":20}},"21":{"start":{"line":50,"column":0},"end":{"line":52,"column":3}},"22":{"start":{"line":51,"column":2},"end":{"line":51,"column":23}},"23":{"start":{"line":54,"column":0},"end":{"line":54,"column":20}}},"branchMap":{}},"/Users/Chris/Workspace/koa/koa-jade/index.js":{"path":"/Users/Chris/Workspace/koa/koa-jade/index.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":2,"12":1,"13":1,"14":1,"15":0,"16":1,"17":1,"18":1,"19":0,"20":1,"21":2,"22":2,"23":2,"24":1,"25":1,"26":1,"27":1,"28":1,"29":0,"30":1,"31":1,"32":0,"33":1,"34":1,"35":13,"36":13,"37":13,"38":13,"39":13,"40":13,"41":1,"42":12,"43":12,"44":5,"45":7,"46":7,"47":7,"48":2,"49":1,"50":1,"51":11,"52":11,"53":11,"54":0,"55":11,"56":11,"57":6,"58":6,"59":11,"60":1,"61":4,"62":1,"63":16,"64":16,"65":4,"66":16,"67":16,"68":4,"69":12,"70":12,"71":0,"72":12,"73":12,"74":15,"75":15,"76":13,"77":5,"78":1,"79":1,"80":4,"81":14,"82":1,"83":13,"84":0,"85":0,"86":13,"87":13,"88":2,"89":13,"90":0,"91":13,"92":1,"93":13,"94":1,"95":1,"96":12,"97":24,"98":24,"99":13,"100":1,"101":13,"102":4,"103":7,"104":3,"105":1,"106":2,"107":1,"108":13,"109":1,"110":1},"b":{"1":[1,0],"2":[1,1],"3":[1,0],"4":[0,1],"5":[1,0],"6":[1,1],"7":[1,0],"8":[0,1],"9":[1,0],"10":[5,7],"11":[2,5],"12":[1,0],"13":[0,11],"14":[6,5],"15":[4,12],"16":[4,12],"17":[0,12],"18":[0,12],"19":[1,13],"20":[0,13],"21":[2,11],"22":[2,11],"23":[0,13],"24":[1,12],"25":[13,13],"26":[1,12],"27":[24,0],"28":[24,24],"29":[1,12],"30":[4,9],"31":[13,4],"32":[1,2],"33":[1,1]},"f":{"1":1,"2":2,"3":1,"4":2,"5":1,"6":13,"7":12,"8":4,"9":16,"10":5,"11":1,"12":4,"13":14,"14":24,"15":7,"16":3},"fnMap":{"1":{"name":"loadHelpers","line":8,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":28}}},"2":{"name":"(anonymous_2)","line":12,"loc":{"start":{"line":12,"column":20},"end":{"line":12,"column":36}}},"3":{"name":"(anonymous_3)","line":14,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":44}}},"4":{"name":"load","line":31,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":34}}},"5":{"name":"(anonymous_5)","line":36,"loc":{"start":{"line":36,"column":37},"end":{"line":36,"column":53}}},"6":{"name":"Jade","line":55,"loc":{"start":{"line":55,"column":0},"end":{"line":55,"column":24}}},"7":{"name":"compileFile","line":66,"loc":{"start":{"line":66,"column":2},"end":{"line":66,"column":64}}},"8":{"name":"compileString","line":103,"loc":{"start":{"line":103,"column":2},"end":{"line":103,"column":55}}},"9":{"name":"renderer","line":113,"loc":{"start":{"line":113,"column":2},"end":{"line":113,"column":52}}},"10":{"name":"(anonymous_10)","line":143,"loc":{"start":{"line":143,"column":13},"end":{"line":143,"column":28}}},"11":{"name":"(anonymous_11)","line":150,"loc":{"start":{"line":150,"column":13},"end":{"line":150,"column":30}}},"12":{"name":"(anonymous_12)","line":159,"loc":{"start":{"line":159,"column":11},"end":{"line":159,"column":23}}},"13":{"name":"(anonymous_13)","line":162,"loc":{"start":{"line":162,"column":11},"end":{"line":162,"column":30}}},"14":{"name":"(anonymous_14)","line":190,"loc":{"start":{"line":190,"column":34},"end":{"line":190,"column":56}}},"15":{"name":"(anonymous_15)","line":209,"loc":{"start":{"line":209,"column":11},"end":{"line":209,"column":23}}},"16":{"name":"(anonymous_16)","line":213,"loc":{"start":{"line":213,"column":11},"end":{"line":213,"column":26}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":25}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":28}},"7":{"start":{"line":8,"column":0},"end":{"line":53,"column":1}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":18}},"9":{"start":{"line":11,"column":2},"end":{"line":29,"column":3}},"10":{"start":{"line":12,"column":4},"end":{"line":26,"column":6}},"11":{"start":{"line":13,"column":6},"end":{"line":25,"column":7}},"12":{"start":{"line":14,"column":8},"end":{"line":22,"column":10}},"13":{"start":{"line":15,"column":10},"end":{"line":21,"column":11}},"14":{"start":{"line":16,"column":12},"end":{"line":20,"column":13}},"15":{"start":{"line":17,"column":14},"end":{"line":17,"column":30}},"16":{"start":{"line":19,"column":14},"end":{"line":19,"column":34}},"17":{"start":{"line":23,"column":13},"end":{"line":25,"column":7}},"18":{"start":{"line":24,"column":8},"end":{"line":24,"column":18}},"19":{"start":{"line":28,"column":4},"end":{"line":28,"column":14}},"20":{"start":{"line":31,"column":2},"end":{"line":50,"column":3}},"21":{"start":{"line":32,"column":4},"end":{"line":32,"column":36}},"22":{"start":{"line":33,"column":4},"end":{"line":33,"column":36}},"23":{"start":{"line":35,"column":4},"end":{"line":49,"column":5}},"24":{"start":{"line":36,"column":6},"end":{"line":38,"column":8}},"25":{"start":{"line":37,"column":8},"end":{"line":37,"column":30}},"26":{"start":{"line":39,"column":11},"end":{"line":49,"column":5}},"27":{"start":{"line":40,"column":6},"end":{"line":40,"column":33}},"28":{"start":{"line":42,"column":6},"end":{"line":48,"column":7}},"29":{"start":{"line":43,"column":8},"end":{"line":43,"column":33}},"30":{"start":{"line":44,"column":13},"end":{"line":48,"column":7}},"31":{"start":{"line":45,"column":8},"end":{"line":45,"column":48}},"32":{"start":{"line":47,"column":8},"end":{"line":47,"column":83}},"33":{"start":{"line":52,"column":2},"end":{"line":52,"column":16}},"34":{"start":{"line":55,"column":0},"end":{"line":227,"column":1}},"35":{"start":{"line":56,"column":2},"end":{"line":59,"column":3}},"36":{"start":{"line":60,"column":2},"end":{"line":60,"column":27}},"37":{"start":{"line":61,"column":2},"end":{"line":61,"column":27}},"38":{"start":{"line":62,"column":2},"end":{"line":62,"column":24}},"39":{"start":{"line":63,"column":2},"end":{"line":63,"column":14}},"40":{"start":{"line":64,"column":2},"end":{"line":64,"column":18}},"41":{"start":{"line":66,"column":2},"end":{"line":101,"column":3}},"42":{"start":{"line":67,"column":4},"end":{"line":67,"column":34}},"43":{"start":{"line":69,"column":4},"end":{"line":83,"column":5}},"44":{"start":{"line":70,"column":6},"end":{"line":70,"column":43}},"45":{"start":{"line":73,"column":6},"end":{"line":73,"column":47}},"46":{"start":{"line":74,"column":6},"end":{"line":74,"column":33}},"47":{"start":{"line":77,"column":6},"end":{"line":82,"column":7}},"48":{"start":{"line":78,"column":8},"end":{"line":78,"column":39}},"49":{"start":{"line":79,"column":8},"end":{"line":81,"column":9}},"50":{"start":{"line":80,"column":10},"end":{"line":80,"column":55}},"51":{"start":{"line":85,"column":4},"end":{"line":85,"column":38}},"52":{"start":{"line":87,"column":4},"end":{"line":87,"column":37}},"53":{"start":{"line":89,"column":4},"end":{"line":98,"column":5}},"54":{"start":{"line":90,"column":6},"end":{"line":90,"column":54}},"55":{"start":{"line":92,"column":6},"end":{"line":92,"column":39}},"56":{"start":{"line":94,"column":6},"end":{"line":97,"column":7}},"57":{"start":{"line":95,"column":8},"end":{"line":95,"column":56}},"58":{"start":{"line":96,"column":8},"end":{"line":96,"column":40}},"59":{"start":{"line":100,"column":4},"end":{"line":100,"column":27}},"60":{"start":{"line":103,"column":2},"end":{"line":105,"column":3}},"61":{"start":{"line":104,"column":4},"end":{"line":104,"column":52}},"62":{"start":{"line":113,"column":2},"end":{"line":138,"column":3}},"63":{"start":{"line":114,"column":4},"end":{"line":114,"column":52}},"64":{"start":{"line":116,"column":4},"end":{"line":118,"column":5}},"65":{"start":{"line":117,"column":6},"end":{"line":117,"column":38}},"66":{"start":{"line":120,"column":4},"end":{"line":120,"column":77}},"67":{"start":{"line":122,"column":4},"end":{"line":134,"column":5}},"68":{"start":{"line":123,"column":6},"end":{"line":123,"column":65}},"69":{"start":{"line":125,"column":6},"end":{"line":125,"column":19}},"70":{"start":{"line":127,"column":6},"end":{"line":131,"column":7}},"71":{"start":{"line":128,"column":8},"end":{"line":128,"column":27}},"72":{"start":{"line":130,"column":8},"end":{"line":130,"column":66}},"73":{"start":{"line":133,"column":6},"end":{"line":133,"column":74}},"74":{"start":{"line":136,"column":4},"end":{"line":136,"column":27}},"75":{"start":{"line":137,"column":4},"end":{"line":137,"column":15}},"76":{"start":{"line":140,"column":2},"end":{"line":221,"column":4}},"77":{"start":{"line":144,"column":8},"end":{"line":144,"column":37}},"78":{"start":{"line":151,"column":8},"end":{"line":151,"column":30}},"79":{"start":{"line":152,"column":8},"end":{"line":152,"column":18}},"80":{"start":{"line":160,"column":8},"end":{"line":160,"column":29}},"81":{"start":{"line":163,"column":8},"end":{"line":165,"column":9}},"82":{"start":{"line":164,"column":10},"end":{"line":164,"column":16}},"83":{"start":{"line":167,"column":8},"end":{"line":170,"column":9}},"84":{"start":{"line":168,"column":10},"end":{"line":168,"column":29}},"85":{"start":{"line":169,"column":10},"end":{"line":169,"column":16}},"86":{"start":{"line":172,"column":8},"end":{"line":172,"column":77}},"87":{"start":{"line":174,"column":8},"end":{"line":176,"column":9}},"88":{"start":{"line":175,"column":10},"end":{"line":175,"column":40}},"89":{"start":{"line":178,"column":8},"end":{"line":180,"column":9}},"90":{"start":{"line":179,"column":10},"end":{"line":179,"column":41}},"91":{"start":{"line":182,"column":8},"end":{"line":184,"column":9}},"92":{"start":{"line":183,"column":10},"end":{"line":183,"column":59}},"93":{"start":{"line":186,"column":8},"end":{"line":195,"column":9}},"94":{"start":{"line":187,"column":10},"end":{"line":187,"column":47}},"95":{"start":{"line":188,"column":10},"end":{"line":188,"column":53}},"96":{"start":{"line":190,"column":10},"end":{"line":194,"column":12}},"97":{"start":{"line":191,"column":12},"end":{"line":193,"column":13}},"98":{"start":{"line":192,"column":14},"end":{"line":192,"column":48}},"99":{"start":{"line":197,"column":8},"end":{"line":199,"column":9}},"100":{"start":{"line":198,"column":10},"end":{"line":198,"column":50}},"101":{"start":{"line":201,"column":8},"end":{"line":203,"column":9}},"102":{"start":{"line":202,"column":10},"end":{"line":202,"column":31}},"103":{"start":{"line":210,"column":8},"end":{"line":210,"column":28}},"104":{"start":{"line":214,"column":8},"end":{"line":218,"column":9}},"105":{"start":{"line":215,"column":10},"end":{"line":215,"column":28}},"106":{"start":{"line":216,"column":15},"end":{"line":218,"column":9}},"107":{"start":{"line":217,"column":10},"end":{"line":217,"column":29}},"108":{"start":{"line":223,"column":2},"end":{"line":226,"column":13}},"109":{"start":{"line":229,"column":0},"end":{"line":234,"column":2}},"110":{"start":{"line":236,"column":0},"end":{"line":236,"column":21}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":2},"end":{"line":11,"column":2}},{"start":{"line":11,"column":2},"end":{"line":11,"column":2}}]},"2":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":6},"end":{"line":13,"column":6}},{"start":{"line":13,"column":6},"end":{"line":13,"column":6}}]},"3":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":10},"end":{"line":15,"column":10}},{"start":{"line":15,"column":10},"end":{"line":15,"column":10}}]},"4":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":12},"end":{"line":16,"column":12}},{"start":{"line":16,"column":12},"end":{"line":16,"column":12}}]},"5":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":13},"end":{"line":23,"column":13}},{"start":{"line":23,"column":13},"end":{"line":23,"column":13}}]},"6":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":4},"end":{"line":35,"column":4}},{"start":{"line":35,"column":4},"end":{"line":35,"column":4}}]},"7":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":11},"end":{"line":39,"column":11}},{"start":{"line":39,"column":11},"end":{"line":39,"column":11}}]},"8":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":6}},{"start":{"line":42,"column":6},"end":{"line":42,"column":6}}]},"9":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":13},"end":{"line":44,"column":13}},{"start":{"line":44,"column":13},"end":{"line":44,"column":13}}]},"10":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":69,"column":4}},{"start":{"line":69,"column":4},"end":{"line":69,"column":4}}]},"11":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":6},"end":{"line":77,"column":6}},{"start":{"line":77,"column":6},"end":{"line":77,"column":6}}]},"12":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":8},"end":{"line":79,"column":8}},{"start":{"line":79,"column":8},"end":{"line":79,"column":8}}]},"13":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":4},"end":{"line":89,"column":4}},{"start":{"line":89,"column":4},"end":{"line":89,"column":4}}]},"14":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":6},"end":{"line":94,"column":6}},{"start":{"line":94,"column":6},"end":{"line":94,"column":6}}]},"15":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":4},"end":{"line":116,"column":4}},{"start":{"line":116,"column":4},"end":{"line":116,"column":4}}]},"16":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":4},"end":{"line":122,"column":4}},{"start":{"line":122,"column":4},"end":{"line":122,"column":4}}]},"17":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":6},"end":{"line":127,"column":6}},{"start":{"line":127,"column":6},"end":{"line":127,"column":6}}]},"18":{"line":130,"type":"cond-expr","locations":[{"start":{"line":130,"column":43},"end":{"line":130,"column":50}},{"start":{"line":130,"column":53},"end":{"line":130,"column":66}}]},"19":{"line":163,"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":163,"column":8}},{"start":{"line":163,"column":8},"end":{"line":163,"column":8}}]},"20":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":8},"end":{"line":167,"column":8}},{"start":{"line":167,"column":8},"end":{"line":167,"column":8}}]},"21":{"line":172,"type":"cond-expr","locations":[{"start":{"line":172,"column":50},"end":{"line":172,"column":66}},{"start":{"line":172,"column":69},"end":{"line":172,"column":77}}]},"22":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"23":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":8}},{"start":{"line":178,"column":8},"end":{"line":178,"column":8}}]},"24":{"line":182,"type":"if","locations":[{"start":{"line":182,"column":8},"end":{"line":182,"column":8}},{"start":{"line":182,"column":8},"end":{"line":182,"column":8}}]},"25":{"line":182,"type":"binary-expr","locations":[{"start":{"line":182,"column":12},"end":{"line":182,"column":42}},{"start":{"line":182,"column":46},"end":{"line":182,"column":75}}]},"26":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"27":{"line":191,"type":"if","locations":[{"start":{"line":191,"column":12},"end":{"line":191,"column":12}},{"start":{"line":191,"column":12},"end":{"line":191,"column":12}}]},"28":{"line":191,"type":"binary-expr","locations":[{"start":{"line":191,"column":16},"end":{"line":191,"column":30}},{"start":{"line":191,"column":34},"end":{"line":191,"column":59}}]},"29":{"line":197,"type":"if","locations":[{"start":{"line":197,"column":8},"end":{"line":197,"column":8}},{"start":{"line":197,"column":8},"end":{"line":197,"column":8}}]},"30":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":8},"end":{"line":201,"column":8}},{"start":{"line":201,"column":8},"end":{"line":201,"column":8}}]},"31":{"line":201,"type":"binary-expr","locations":[{"start":{"line":201,"column":12},"end":{"line":201,"column":23}},{"start":{"line":201,"column":27},"end":{"line":201,"column":73}}]},"32":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]},"33":{"line":216,"type":"if","locations":[{"start":{"line":216,"column":15},"end":{"line":216,"column":15}},{"start":{"line":216,"column":15},"end":{"line":216,"column":15}}]}}},"/Users/Chris/Workspace/koa/koa-jade/example/helpers/format-date.js":{"path":"/Users/Chris/Workspace/koa/koa-jade/example/helpers/format-date.js","s":{"1":1,"2":6},"b":{},"f":{"1":6},"fnMap":{"1":{"name":"(anonymous_1)","line":3,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},"2":{"start":{"line":4,"column":4},"end":{"line":4,"column":83}}},"branchMap":{}}} |
70
index.js
@@ -66,10 +66,4 @@ var pkg = require('./package.json') | ||
/** | ||
* @param {String} tpl the template path, search start from viewPath | ||
* @param {Object} locals locals that pass to Jade compiler, merged with global locals | ||
* @param {Object} options options that pass to Jade compiler, merged with global default options | ||
* @param {Boolean} noCache use cache or not | ||
*/ | ||
function renderer (tpl, locals, options, noCache) { | ||
var compileOptions, tplPath, rawJade, compiler, skipCache | ||
function compileFile (tpl, locals, compileOptions, skipCache) { | ||
var tplPath, rawJade, compiler | ||
@@ -94,16 +88,4 @@ if (_.endsWith(tpl, '.jade')) { | ||
compileOptions = _.merge({}, defaultOptions) | ||
if (_.isPlainObject(options)) { | ||
_.merge(compileOptions, options) | ||
} | ||
compileOptions.filename = tplPath | ||
if (_.isBoolean(options)) { | ||
skipCache = options | ||
} else { | ||
skipCache = _.isBoolean(noCache) ? noCache : globalNoCache | ||
} | ||
if (skipCache) { | ||
@@ -120,3 +102,38 @@ compiler = jade.compile(rawJade, compileOptions) | ||
this.body = compiler(_.merge({}, helpers, defaultLocals, this.state, locals)) | ||
return compiler(locals) | ||
} | ||
function compileString (tpl, locals, compileOptions) { | ||
return jade.compile(tpl, compileOptions)(locals) | ||
} | ||
/** | ||
* @param {String} tpl the template path, search start from viewPath | ||
* @param {Object} locals locals that pass to Jade compiler, merged with global locals | ||
* @param {Object} options options that pass to Jade compiler, merged with global default options | ||
* @param {Boolean} noCache use cache or not | ||
*/ | ||
function renderer (tpl, locals, options, noCache) { | ||
var compileOptions = _.merge({}, defaultOptions) | ||
if (_.isPlainObject(options)) { | ||
_.merge(compileOptions, options) | ||
} | ||
var finalLocals = _.merge({}, helpers, defaultLocals, this.state, locals) | ||
if (compileOptions.fromString) { | ||
this.body = compileString(tpl, finalLocals, compileOptions) | ||
} else { | ||
var skipCache | ||
if (_.isBoolean(options)) { | ||
skipCache = options | ||
} else { | ||
skipCache = _.isBoolean(noCache) ? noCache : globalNoCache | ||
} | ||
this.body = compileFile(tpl, finalLocals, compileOptions, skipCache) | ||
} | ||
this.type = 'text/html' | ||
@@ -127,2 +144,9 @@ return this | ||
Object.defineProperties(this, { | ||
use: { | ||
enumerable: true, | ||
value: function (app) { | ||
app.context.render = renderer | ||
} | ||
}, | ||
middleware: { | ||
@@ -180,2 +204,6 @@ enumerable: true, | ||
} | ||
if (options.app && options.app.constructor.name === 'Application') { | ||
this.use(options.app) | ||
} | ||
} | ||
@@ -182,0 +210,0 @@ }, |
{ | ||
"name": "koa-jade", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "A Jade middleware for Koa", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,4 @@ # Koa-jade | ||
{ _: require('lodash') } | ||
] | ||
], | ||
app: app // equals to jade.use(app) and app.use(jade.middleware) | ||
}) | ||
@@ -35,4 +36,2 @@ | ||
app.use(jade.middleware) | ||
app.use(function* () { | ||
@@ -69,3 +68,3 @@ this.render('index', locals_for_this_page, true) | ||
server1.use(jade1.middleware) | ||
jade1.use(server1) | ||
@@ -76,3 +75,3 @@ server1.use(function* (next) { | ||
server2.use(jade2.middleware) | ||
jade2.use(server2) | ||
@@ -105,4 +104,19 @@ server2.use(function* (next) { | ||
### middleware | ||
### use | ||
```js | ||
const Jade = require('koa-jade') | ||
const jade = new Jade() | ||
// `new Jade({ app })` equals to | ||
jade.use(app) | ||
app.use(function* () { | ||
this.render('h1 Hello, #{name}', { name: 'Jade' }, { fromString: true }) | ||
}) | ||
``` | ||
Binding `render` function to `app.context`. See [official doc](https://github.com/koajs/koa/blob/master/docs/api/index.md#appcontext). | ||
### middleware (deprecated) | ||
The middleware for configuring Koa's [context](http://koajs.com/#context). | ||
@@ -175,2 +189,4 @@ | ||
`options.fromString`: `fromString` only available in `ctx.render`, by assigning a true value, Jade will **not** treat `tpl` as a path: `ctx.render('h1 Hello, #{name}')`. Templates rendered with `fromString: true` will **not** be stored in cache. | ||
`noCache`: use cache or not. Notes: 1. overrides global `noCache`; 2. won't affect other pages. | ||
@@ -263,2 +279,8 @@ | ||
# Migration Notes | ||
## 2.x | ||
- `this.render` becomes a normal function, it does not require `yield` statement anymore. ([Issue #14](https://github.com/chrisyip/koa-jade/issues/14#issuecomment-164997785)) | ||
# Contributors | ||
@@ -265,0 +287,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
119301
580
292