33Object . defineProperty ( exports , "__esModule" , {
44 value : true
55} ) ;
6+ exports . default = {
7+ name : 'hn-story' ,
8+ body : body ,
9+ headers : { sync : true , needs : '[css]' }
10+ } ;
611
7- var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
812
9- function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
13+ function body ( node , _ref ) {
14+ var id = _ref . id ,
15+ _ref$title = _ref . title ,
16+ title = _ref$title === undefined ? '' : _ref$title ,
17+ _ref$descendants = _ref . descendants ,
18+ descendants = _ref$descendants === undefined ? 0 : _ref$descendants ,
19+ _ref$score = _ref . score ,
20+ score = _ref$score === undefined ? 0 : _ref$score ,
21+ url = _ref . url ;
1022
11- var _class = function ( ) {
12- function _class ( ) {
13- _classCallCheck ( this , _class ) ;
14- }
23+ var o = once ( node ) ;
1524
16- _createClass ( _class , [ {
17- key : 'render' ,
18- value : function render ( node , _ref ) {
19- var id = _ref . id ,
20- _ref$title = _ref . title ,
21- title = _ref$title === undefined ? '' : _ref$title ,
22- _ref$descendants = _ref . descendants ,
23- descendants = _ref$descendants === undefined ? 0 : _ref$descendants ,
24- _ref$score = _ref . score ,
25- score = _ref$score === undefined ? 0 : _ref$score ,
26- url = _ref . url ;
25+ o ( 'a.title' , 1 ) . attr ( 'href' , url ) . text ( title ) ;
2726
28- var o = once ( node ) ;
27+ o ( 'a.comments' , 1 ) . attr ( 'href' , 'https://news.ycombinator.com/item?id=' + id ) . text ( descendants ) ;
2928
30- o ( 'a.title' , 1 ) . attr ( 'href' , url ) . text ( title ) ;
31-
32- o ( 'a.comments' , 1 ) . attr ( 'href' , 'https://news.ycombinator.com/item?id=' + id ) . text ( descendants ) ;
33-
34- o ( 'span.score' , 1 ) . text ( score ) ;
35- }
36- } ] , [ {
37- key : 'async' ,
38- get : function get ( ) {
39- return true ;
40- }
41- } ] ) ;
42-
43- return _class ;
44- } ( ) ;
45-
46- exports . default = _class ;
29+ o ( 'span.score' , 1 ) . text ( score ) ;
30+ }
0 commit comments