├── README.md
├── coverage
├── coverage.json
├── lcov-report
│ ├── base.css
│ ├── index.html
│ ├── lib
│ │ ├── builder.js.html
│ │ ├── index.html
│ │ ├── init_server.js.html
│ │ └── warn.js.html
│ ├── prettify.css
│ ├── prettify.js
│ ├── sort-arrow-sprite.png
│ └── sorter.js
└── lcov.info
├── index.js
├── lib
├── builder.js
└── logger.js
├── package.json
├── simple-restify.png
└── test
├── builder.test.js
└── integration
├── routes
├── health.js
└── withParams.js
└── server.test.js
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | Hassle free server creation. No point in recreating the same thing when we can have one standard server.
4 |
5 | ### What is this repository for? ###
6 |
7 | * Creating Restify servers.
8 |
9 | ### How do I get set up? ###
10 |
11 | Everything is created using the builder object. In order to use the builder object you should require common-server:
12 |
13 | var Builder = require( 'simple-restify' );
14 |
15 | The Builder object has 3 functions:
16 |
17 | var server = Builder
18 | .config( config ) //add the server configurations from a json object
19 | .routesOptions( options ) //accepts json object that will be passed into all the routes
20 | .add( function( server ){ //allows you to add your own custom functions which need server
21 |
22 | return server;
23 |
24 | })
25 | .run(); //runs the server and returns the server json object
26 |
27 | The config json has the following properties you can add:
28 |
29 | {
30 | "port" : 8000,
31 | "name" : "sample-server",
32 | "version" : 1.0.0,
33 | "logging" : true,
34 | "rootPath" : "/users/test",
35 | "routesPath" : "/users/test/routes/"
36 | }
37 |
--------------------------------------------------------------------------------
/coverage/coverage.json:
--------------------------------------------------------------------------------
1 | {"/Users/tomt/Projects/jeeko/common-server/lib/builder.js":{"path":"/Users/tomt/Projects/jeeko/common-server/lib/builder.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":3,"9":3,"10":3,"11":3,"12":3,"13":3,"14":3,"15":3,"16":3,"17":3,"18":3,"19":3,"20":3,"21":3,"22":3,"23":3,"24":3,"25":3,"26":1,"27":1,"28":1,"29":2,"30":2,"31":2,"32":0,"33":2,"34":2,"35":1,"36":0,"37":0,"38":0,"39":1,"40":1,"41":1,"42":1,"43":0,"44":0,"45":1,"46":3,"47":1,"48":1},"b":{"1":[3,0],"2":[3,0],"3":[3,0],"4":[3,0],"5":[3,0],"6":[3,0],"7":[3,3],"8":[3,0],"9":[3,2],"10":[3,3],"11":[3,3],"12":[0,2],"13":[0,0],"14":[0,0],"15":[0,0]},"f":{"1":3,"2":1,"3":2,"4":2,"5":0,"6":1,"7":0,"8":3},"fnMap":{"1":{"name":"ServerObject","line":17,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":59}}},"2":{"name":"valueHandlers","line":65,"loc":{"start":{"line":65,"column":0},"end":{"line":65,"column":41}}},"3":{"name":"(anonymous_3)","line":69,"loc":{"start":{"line":69,"column":18},"end":{"line":69,"column":35}}},"4":{"name":"(anonymous_4)","line":73,"loc":{"start":{"line":73,"column":56},"end":{"line":73,"column":71}}},"5":{"name":"(anonymous_5)","line":83,"loc":{"start":{"line":83,"column":36},"end":{"line":83,"column":61}}},"6":{"name":"(anonymous_6)","line":90,"loc":{"start":{"line":90,"column":38},"end":{"line":90,"column":57}}},"7":{"name":"(anonymous_7)","line":96,"loc":{"start":{"line":96,"column":29},"end":{"line":96,"column":40}}},"8":{"name":"create","line":102,"loc":{"start":{"line":102,"column":0},"end":{"line":102,"column":47}}}},"statementMap":{"1":{"start":{"line":4,"column":0},"end":{"line":4,"column":28}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":31}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":41}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":46}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":42}},"6":{"start":{"line":11,"column":0},"end":{"line":14,"column":6}},"7":{"start":{"line":17,"column":0},"end":{"line":63,"column":1}},"8":{"start":{"line":21,"column":1},"end":{"line":21,"column":26}},"9":{"start":{"line":23,"column":1},"end":{"line":26,"column":2}},"10":{"start":{"line":25,"column":2},"end":{"line":25,"column":48}},"11":{"start":{"line":30,"column":1},"end":{"line":30,"column":18}},"12":{"start":{"line":31,"column":1},"end":{"line":31,"column":22}},"13":{"start":{"line":32,"column":1},"end":{"line":32,"column":24}},"14":{"start":{"line":36,"column":1},"end":{"line":36,"column":63}},"15":{"start":{"line":38,"column":1},"end":{"line":44,"column":2}},"16":{"start":{"line":41,"column":2},"end":{"line":41,"column":36}},"17":{"start":{"line":42,"column":2},"end":{"line":42,"column":45}},"18":{"start":{"line":48,"column":1},"end":{"line":48,"column":65}},"19":{"start":{"line":50,"column":1},"end":{"line":56,"column":2}},"20":{"start":{"line":52,"column":2},"end":{"line":52,"column":46}},"21":{"start":{"line":53,"column":2},"end":{"line":53,"column":46}},"22":{"start":{"line":54,"column":2},"end":{"line":54,"column":55}},"23":{"start":{"line":60,"column":1},"end":{"line":60,"column":31}},"24":{"start":{"line":61,"column":1},"end":{"line":61,"column":31}},"25":{"start":{"line":62,"column":1},"end":{"line":62,"column":40}},"26":{"start":{"line":65,"column":0},"end":{"line":81,"column":1}},"27":{"start":{"line":67,"column":1},"end":{"line":67,"column":30}},"28":{"start":{"line":69,"column":2},"end":{"line":80,"column":4}},"29":{"start":{"line":71,"column":3},"end":{"line":71,"column":43}},"30":{"start":{"line":73,"column":3},"end":{"line":79,"column":3}},"31":{"start":{"line":75,"column":3},"end":{"line":76,"column":39}},"32":{"start":{"line":75,"column":15},"end":{"line":75,"column":42}},"33":{"start":{"line":76,"column":10},"end":{"line":76,"column":37}},"34":{"start":{"line":78,"column":3},"end":{"line":78,"column":15}},"35":{"start":{"line":83,"column":0},"end":{"line":88,"column":1}},"36":{"start":{"line":85,"column":1},"end":{"line":85,"column":46}},"37":{"start":{"line":86,"column":1},"end":{"line":86,"column":50}},"38":{"start":{"line":87,"column":1},"end":{"line":87,"column":55}},"39":{"start":{"line":90,"column":0},"end":{"line":94,"column":1}},"40":{"start":{"line":92,"column":1},"end":{"line":92,"column":29}},"41":{"start":{"line":93,"column":1},"end":{"line":93,"column":13}},"42":{"start":{"line":96,"column":0},"end":{"line":100,"column":1}},"43":{"start":{"line":98,"column":1},"end":{"line":98,"column":8}},"44":{"start":{"line":99,"column":1},"end":{"line":99,"column":22}},"45":{"start":{"line":102,"column":0},"end":{"line":105,"column":1}},"46":{"start":{"line":104,"column":1},"end":{"line":104,"column":56}},"47":{"start":{"line":108,"column":0},"end":{"line":108,"column":38}},"48":{"start":{"line":110,"column":0},"end":{"line":114,"column":2}}},"branchMap":{"1":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":1},"end":{"line":23,"column":1}},{"start":{"line":23,"column":1},"end":{"line":23,"column":1}}]},"2":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":1},"end":{"line":38,"column":1}},{"start":{"line":38,"column":1},"end":{"line":38,"column":1}}]},"3":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":14},"end":{"line":41,"column":22}},{"start":{"line":41,"column":26},"end":{"line":41,"column":35}}]},"4":{"line":42,"type":"binary-expr","locations":[{"start":{"line":42,"column":17},"end":{"line":42,"column":28}},{"start":{"line":42,"column":32},"end":{"line":42,"column":44}}]},"5":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":1},"end":{"line":50,"column":1}},{"start":{"line":50,"column":1},"end":{"line":50,"column":1}}]},"6":{"line":52,"type":"binary-expr","locations":[{"start":{"line":52,"column":14},"end":{"line":52,"column":32}},{"start":{"line":52,"column":36},"end":{"line":52,"column":45}}]},"7":{"line":53,"type":"binary-expr","locations":[{"start":{"line":53,"column":14},"end":{"line":53,"column":32}},{"start":{"line":53,"column":36},"end":{"line":53,"column":45}}]},"8":{"line":54,"type":"binary-expr","locations":[{"start":{"line":54,"column":17},"end":{"line":54,"column":38}},{"start":{"line":54,"column":42},"end":{"line":54,"column":54}}]},"9":{"line":60,"type":"binary-expr","locations":[{"start":{"line":60,"column":13},"end":{"line":60,"column":17}},{"start":{"line":60,"column":21},"end":{"line":60,"column":30}}]},"10":{"line":61,"type":"binary-expr","locations":[{"start":{"line":61,"column":13},"end":{"line":61,"column":17}},{"start":{"line":61,"column":21},"end":{"line":61,"column":30}}]},"11":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":16},"end":{"line":62,"column":23}},{"start":{"line":62,"column":27},"end":{"line":62,"column":39}}]},"12":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":3},"end":{"line":75,"column":3}},{"start":{"line":75,"column":3},"end":{"line":75,"column":3}}]},"13":{"line":85,"type":"binary-expr","locations":[{"start":{"line":85,"column":13},"end":{"line":85,"column":37}},{"start":{"line":85,"column":41},"end":{"line":85,"column":45}}]},"14":{"line":86,"type":"binary-expr","locations":[{"start":{"line":86,"column":13},"end":{"line":86,"column":37}},{"start":{"line":86,"column":41},"end":{"line":86,"column":49}}]},"15":{"line":87,"type":"binary-expr","locations":[{"start":{"line":87,"column":16},"end":{"line":87,"column":43}},{"start":{"line":87,"column":47},"end":{"line":87,"column":54}}]}}},"/Users/tomt/Projects/jeeko/common-server/lib/warn.js":{"path":"/Users/tomt/Projects/jeeko/common-server/lib/warn.js","s":{"1":1,"2":1,"3":1,"4":1,"5":0,"6":0,"7":0,"8":0,"9":1},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0},"fnMap":{"1":{"name":"warn","line":9,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":16}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":46}},"3":{"start":{"line":7,"column":0},"end":{"line":7,"column":49}},"4":{"start":{"line":9,"column":0},"end":{"line":20,"column":1}},"5":{"start":{"line":11,"column":1},"end":{"line":14,"column":2}},"6":{"start":{"line":13,"column":2},"end":{"line":13,"column":74}},"7":{"start":{"line":16,"column":1},"end":{"line":19,"column":2}},"8":{"start":{"line":18,"column":2},"end":{"line":18,"column":76}},"9":{"start":{"line":22,"column":0},"end":{"line":22,"column":22}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":1},"end":{"line":11,"column":1}},{"start":{"line":11,"column":1},"end":{"line":11,"column":1}}]},"2":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":1},"end":{"line":16,"column":1}},{"start":{"line":16,"column":1},"end":{"line":16,"column":1}}]}}},"/Users/tomt/Projects/jeeko/common-server/lib/init_server.js":{"path":"/Users/tomt/Projects/jeeko/common-server/lib/init_server.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":1,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"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":1,"32":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"includeRoutes","line":7,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":44}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":38},"end":{"line":9,"column":56}}},"3":{"name":"startServer","line":21,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":30}}},"4":{"name":"(anonymous_4)","line":60,"loc":{"start":{"line":60,"column":14},"end":{"line":60,"column":40}}},"5":{"name":"(anonymous_5)","line":71,"loc":{"start":{"line":71,"column":32},"end":{"line":71,"column":64}}},"6":{"name":"(anonymous_6)","line":81,"loc":{"start":{"line":81,"column":29},"end":{"line":81,"column":40}}},"7":{"name":"(anonymous_7)","line":88,"loc":{"start":{"line":88,"column":17},"end":{"line":88,"column":36}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":46}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":25}},"3":{"start":{"line":7,"column":0},"end":{"line":18,"column":1}},"4":{"start":{"line":9,"column":1},"end":{"line":16,"column":4}},"5":{"start":{"line":11,"column":2},"end":{"line":14,"column":3}},"6":{"start":{"line":13,"column":3},"end":{"line":13,"column":76}},"7":{"start":{"line":21,"column":0},"end":{"line":86,"column":1}},"8":{"start":{"line":23,"column":1},"end":{"line":23,"column":29}},"9":{"start":{"line":26,"column":1},"end":{"line":26,"column":36}},"10":{"start":{"line":29,"column":1},"end":{"line":29,"column":42}},"11":{"start":{"line":32,"column":1},"end":{"line":32,"column":36}},"12":{"start":{"line":34,"column":1},"end":{"line":34,"column":38}},"13":{"start":{"line":36,"column":1},"end":{"line":44,"column":2}},"14":{"start":{"line":38,"column":2},"end":{"line":42,"column":5}},"15":{"start":{"line":46,"column":1},"end":{"line":52,"column":2}},"16":{"start":{"line":48,"column":2},"end":{"line":51,"column":5}},"17":{"start":{"line":55,"column":1},"end":{"line":55,"column":37}},"18":{"start":{"line":56,"column":1},"end":{"line":56,"column":55}},"19":{"start":{"line":58,"column":1},"end":{"line":68,"column":2}},"20":{"start":{"line":60,"column":2},"end":{"line":66,"column":5}},"21":{"start":{"line":63,"column":3},"end":{"line":63,"column":37}},"22":{"start":{"line":65,"column":3},"end":{"line":65,"column":17}},"23":{"start":{"line":71,"column":1},"end":{"line":76,"column":4}},"24":{"start":{"line":73,"column":2},"end":{"line":73,"column":70}},"25":{"start":{"line":73,"column":26},"end":{"line":73,"column":68}},"26":{"start":{"line":75,"column":2},"end":{"line":75,"column":71}},"27":{"start":{"line":78,"column":1},"end":{"line":78,"column":59}},"28":{"start":{"line":81,"column":1},"end":{"line":84,"column":4}},"29":{"start":{"line":83,"column":2},"end":{"line":83,"column":88}},"30":{"start":{"line":83,"column":26},"end":{"line":83,"column":87}},"31":{"start":{"line":88,"column":0},"end":{"line":91,"column":1}},"32":{"start":{"line":90,"column":1},"end":{"line":90,"column":23}}},"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":36,"type":"if","locations":[{"start":{"line":36,"column":1},"end":{"line":36,"column":1}},{"start":{"line":36,"column":1},"end":{"line":36,"column":1}}]},"3":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":1},"end":{"line":46,"column":1}},{"start":{"line":46,"column":1},"end":{"line":46,"column":1}}]},"4":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":1},"end":{"line":58,"column":1}},{"start":{"line":58,"column":1},"end":{"line":58,"column":1}}]},"5":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":2},"end":{"line":73,"column":2}},{"start":{"line":73,"column":2},"end":{"line":73,"column":2}}]},"6":{"line":75,"type":"binary-expr","locations":[{"start":{"line":75,"column":40},"end":{"line":75,"column":54}},{"start":{"line":75,"column":58},"end":{"line":75,"column":65}}]},"7":{"line":83,"type":"if","locations":[{"start":{"line":83,"column":2},"end":{"line":83,"column":2}},{"start":{"line":83,"column":2},"end":{"line":83,"column":2}}]}}}}
--------------------------------------------------------------------------------
/coverage/lcov-report/base.css:
--------------------------------------------------------------------------------
1 | body, html {
2 | margin:0; padding: 0;
3 | }
4 | body {
5 | font-family: Helvetica Neue, Helvetica,Arial;
6 | font-size: 10pt;
7 | }
8 | div.header, div.footer {
9 | background: #eee;
10 | padding: 1em;
11 | }
12 | div.header {
13 | z-index: 100;
14 | position: fixed;
15 | top: 0;
16 | border-bottom: 1px solid #666;
17 | width: 100%;
18 | }
19 | div.footer {
20 | border-top: 1px solid #666;
21 | }
22 | div.body {
23 | margin-top: 10em;
24 | }
25 | div.meta {
26 | font-size: 90%;
27 | text-align: center;
28 | }
29 | h1, h2, h3 {
30 | font-weight: normal;
31 | }
32 | h1 {
33 | font-size: 12pt;
34 | }
35 | h2 {
36 | font-size: 10pt;
37 | }
38 | pre {
39 | font-family: Consolas, Menlo, Monaco, monospace;
40 | margin: 0;
41 | padding: 0;
42 | line-height: 14px;
43 | font-size: 14px;
44 | -moz-tab-size: 2;
45 | -o-tab-size: 2;
46 | tab-size: 2;
47 | }
48 |
49 | div.path { font-size: 110%; }
50 | div.path a:link, div.path a:visited { color: #000; }
51 | table.coverage { border-collapse: collapse; margin:0; padding: 0 }
52 |
53 | table.coverage td {
54 | margin: 0;
55 | padding: 0;
56 | color: #111;
57 | vertical-align: top;
58 | }
59 | table.coverage td.line-count {
60 | width: 50px;
61 | text-align: right;
62 | padding-right: 5px;
63 | }
64 | table.coverage td.line-coverage {
65 | color: #777 !important;
66 | text-align: right;
67 | border-left: 1px solid #666;
68 | border-right: 1px solid #666;
69 | }
70 |
71 | table.coverage td.text {
72 | }
73 |
74 | table.coverage td span.cline-any {
75 | display: inline-block;
76 | padding: 0 5px;
77 | width: 40px;
78 | }
79 | table.coverage td span.cline-neutral {
80 | background: #eee;
81 | }
82 | table.coverage td span.cline-yes {
83 | background: #b5d592;
84 | color: #999;
85 | }
86 | table.coverage td span.cline-no {
87 | background: #fc8c84;
88 | }
89 |
90 | .cstat-yes { color: #111; }
91 | .cstat-no { background: #fc8c84; color: #111; }
92 | .fstat-no { background: #ffc520; color: #111 !important; }
93 | .cbranch-no { background: yellow !important; color: #111; }
94 |
95 | .cstat-skip { background: #ddd; color: #111; }
96 | .fstat-skip { background: #ddd; color: #111 !important; }
97 | .cbranch-skip { background: #ddd !important; color: #111; }
98 |
99 | .missing-if-branch {
100 | display: inline-block;
101 | margin-right: 10px;
102 | position: relative;
103 | padding: 0 4px;
104 | background: black;
105 | color: yellow;
106 | }
107 |
108 | .skip-if-branch {
109 | display: none;
110 | margin-right: 10px;
111 | position: relative;
112 | padding: 0 4px;
113 | background: #ccc;
114 | color: white;
115 | }
116 |
117 | .missing-if-branch .typ, .skip-if-branch .typ {
118 | color: inherit !important;
119 | }
120 |
121 | .entity, .metric { font-weight: bold; }
122 | .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
123 | .metric small { font-size: 80%; font-weight: normal; color: #666; }
124 |
125 | div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
126 | div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
127 | div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
128 | div.coverage-summary th.file { border-right: none !important; }
129 | div.coverage-summary th.pic { border-left: none !important; text-align: right; }
130 | div.coverage-summary th.pct { border-right: none !important; }
131 | div.coverage-summary th.abs { border-left: none !important; text-align: right; }
132 | div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
133 | div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
134 | div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; }
135 | div.coverage-summary td.pic { min-width: 120px !important; }
136 | div.coverage-summary a:link { text-decoration: none; color: #000; }
137 | div.coverage-summary a:visited { text-decoration: none; color: #777; }
138 | div.coverage-summary a:hover { text-decoration: underline; }
139 | div.coverage-summary tfoot td { border-top: 1px solid #666; }
140 |
141 | div.coverage-summary .sorter {
142 | height: 10px;
143 | width: 7px;
144 | display: inline-block;
145 | margin-left: 0.5em;
146 | background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147 | }
148 | div.coverage-summary .sorted .sorter {
149 | background-position: 0 -20px;
150 | }
151 | div.coverage-summary .sorted-desc .sorter {
152 | background-position: 0 -10px;
153 | }
154 |
155 | .high { background: #b5d592 !important; }
156 | .medium { background: #ffe87c !important; }
157 | .low { background: #fc8c84 !important; }
158 |
159 | span.cover-fill, span.cover-empty {
160 | display:inline-block;
161 | border:1px solid #444;
162 | background: white;
163 | height: 12px;
164 | }
165 | span.cover-fill {
166 | background: #ccc;
167 | border-right: 1px solid #444;
168 | }
169 | span.cover-empty {
170 | background: white;
171 | border-left: none;
172 | }
173 | span.cover-full {
174 | border-right: none !important;
175 | }
176 | pre.prettyprint {
177 | border: none !important;
178 | padding: 0 !important;
179 | margin: 0 !important;
180 | }
181 | .com { color: #999 !important; }
182 | .ignore-none { color: #999; font-weight: normal; }
183 |
--------------------------------------------------------------------------------
/coverage/lcov-report/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for All files
5 |
6 |
7 |
8 |
13 |
14 |
15 |
26 |
27 |
28 |
29 |
30 |
31 | File |
32 | |
33 | Statements |
34 | |
35 | Branches |
36 | |
37 | Functions |
38 | |
39 | Lines |
40 | |
41 |
42 |
43 |
44 | lib/ |
45 | |
46 | 58.43% |
47 | (52 / 89) |
48 | 33.33% |
49 | (16 / 48) |
50 | 37.5% |
51 | (6 / 16) |
52 | 60.47% |
53 | (52 / 86) |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
63 |
64 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/coverage/lcov-report/lib/builder.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for lib/builder.js
5 |
6 |
7 |
8 |
13 |
14 |
15 |
26 |
27 |
28 | 1
29 | 2
30 | 3
31 | 4
32 | 5
33 | 6
34 | 7
35 | 8
36 | 9
37 | 10
38 | 11
39 | 12
40 | 13
41 | 14
42 | 15
43 | 16
44 | 17
45 | 18
46 | 19
47 | 20
48 | 21
49 | 22
50 | 23
51 | 24
52 | 25
53 | 26
54 | 27
55 | 28
56 | 29
57 | 30
58 | 31
59 | 32
60 | 33
61 | 34
62 | 35
63 | 36
64 | 37
65 | 38
66 | 39
67 | 40
68 | 41
69 | 42
70 | 43
71 | 44
72 | 45
73 | 46
74 | 47
75 | 48
76 | 49
77 | 50
78 | 51
79 | 52
80 | 53
81 | 54
82 | 55
83 | 56
84 | 57
85 | 58
86 | 59
87 | 60
88 | 61
89 | 62
90 | 63
91 | 64
92 | 65
93 | 66
94 | 67
95 | 68
96 | 69
97 | 70
98 | 71
99 | 72
100 | 73
101 | 74
102 | 75
103 | 76
104 | 77
105 | 78
106 | 79
107 | 80
108 | 81
109 | 82
110 | 83
111 | 84
112 | 85
113 | 86
114 | 87
115 | 88
116 | 89
117 | 90
118 | 91
119 | 92
120 | 93
121 | 94
122 | 95
123 | 96
124 | 97
125 | 98
126 | 99
127 | 100
128 | 101
129 | 102
130 | 103
131 | 104
132 | 105
133 | 106
134 | 107
135 | 108
136 | 109
137 | 110
138 | 111
139 | 112
140 | 113
141 | 114
142 | 115
143 | 116
144 | 117
145 | 118
146 | 119
147 | 120
148 | 121
149 | 122
150 | 123
151 | 124
152 | 125
153 | 126
154 | 127
155 | 128
156 | 129 |
157 |
158 |
159 | 1
160 | 1
161 | 1
162 | 1
163 | 1
164 |
165 |
166 | 1
167 |
168 |
169 |
170 |
171 |
172 | 1
173 |
174 |
175 |
176 | 3
177 |
178 | 3
179 |
180 | 3
181 |
182 |
183 |
184 |
185 | 3
186 | 3
187 | 3
188 |
189 |
190 |
191 | 3
192 |
193 | 3
194 |
195 |
196 | 3
197 | 3
198 |
199 |
200 |
201 |
202 |
203 | 3
204 |
205 | 3
206 |
207 | 3
208 | 3
209 | 3
210 |
211 |
212 |
213 |
214 |
215 | 3
216 | 3
217 | 3
218 |
219 |
220 | 1
221 |
222 | 1
223 |
224 | 1
225 |
226 | 2
227 |
228 | 2
229 |
230 | 2
231 | 2
232 |
233 | 2
234 |
235 |
236 |
237 |
238 | 1
239 |
240 |
241 |
242 |
243 |
244 |
245 | 1
246 |
247 | 1
248 | 1
249 |
250 |
251 | 1
252 |
253 |
254 |
255 |
256 |
257 | 1
258 |
259 | 3
260 |
261 |
262 |
263 | 1
264 |
265 | 1
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 | | 'use strict';
285 |
286 | //require all the things
287 | var _ = require( 'lodash' );
288 | var warn = require( './warn' );
289 | var appRoot = require( 'app-root-path' );
290 | var createServer = require( './init_server' );
291 | var u = require( 'common-utils' ).helpers;
292 |
293 | //params for server options
294 | var params = [
295 | "Logging",
296 | "Aws"
297 | ];
298 |
299 | //order of information importance given fields, config.json, package.json, defaults
300 | function ServerObject( port, name, version, testing_flag ) {
301 |
302 | //For testing purposes
303 |
304 | var serverRoot = appRoot;
305 |
306 | Eif( testing_flag ){
307 |
308 | serverRoot = appRoot + "/test/lib/test_files";
309 | }
310 |
311 | //Step 1: set the default values
312 |
313 | this.Port = 8080;
314 | this.Name = "Server";
315 | this.Version = "1.0.0";
316 |
317 | //Step 2: pull values from package.json, overrides defaults
318 |
319 | var pkg = u.require_if_exists( serverRoot + "/package.json" );
320 |
321 | Eif( pkg !== false ){
322 |
323 | //this.Port = pkg.server.port || this.Port;
324 | this.Name = pkg.name || this.Name;
325 | this.Version = pkg.version || this.Version;
326 |
327 | }
328 |
329 | //Step 3: pull values from config.json, overrides default and package.json
330 |
331 | var config = u.require_if_exists( serverRoot + "/config.json" );
332 |
333 | Eif( config !== false ){
334 |
335 | this.Port = config.server.port || this.Port;
336 | this.Name = config.server.name || this.Name;
337 | this.Version = config.server.version || this.Version;
338 |
339 | }
340 |
341 | //Step 4: pull values from arguments, overrides everything else
342 |
343 | this.Port = port || this.Port;
344 | this.Name = name || this.Name;
345 | this.Version = version || this.Version;
346 | }
347 |
348 | function valueHandlers( object, params ) {
349 |
350 | object.prototype.values = {};
351 |
352 | params.forEach( function( param ){
353 |
354 | object.prototype.values[ param ] = true;
355 |
356 | object.prototype[ "with" + _.capitalize( param ) ] = function( val ){
357 |
358 | Iif( val ) { this.values[ param ] = val; }
359 | else { this.values[ param] = true; }
360 |
361 | return this;
362 | }
363 | });
364 | }
365 |
366 | ServerObject.prototype.withConfig = function( configObject ) {
367 |
368 | this.Port = configObject.server.port || 8080;
369 | this.Name = configObject.server.name || "Server";
370 | this.Version = configObject.server.version || "1.0.0";
371 | }
372 |
373 | ServerObject.prototype.routeOptions = function( options ){
374 |
375 | this.routeOptions = options;
376 | return this;
377 | }
378 |
379 | ServerObject.prototype.run = function() {
380 |
381 | warn();
382 | createServer( this );
383 | }
384 |
385 | function create( port, name, version, author ) {
386 |
387 | return new ServerObject( port, name, version, author );
388 | }
389 |
390 | //add all the value handlers
391 | valueHandlers( ServerObject, params );
392 |
393 | module.exports = {
394 |
395 | create : create
396 |
397 | };
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 | |
413 |
414 |
415 |
416 |
419 |
420 |
427 |
428 |
429 |
430 |
--------------------------------------------------------------------------------
/coverage/lcov-report/lib/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for lib/
5 |
6 |
7 |
8 |
13 |
14 |
15 |
26 |
27 |
28 |
29 |
30 |
31 | File |
32 | |
33 | Statements |
34 | |
35 | Branches |
36 | |
37 | Functions |
38 | |
39 | Lines |
40 | |
41 |
42 |
43 |
44 | builder.js |
45 | |
46 | 87.5% |
47 | (42 / 48) |
48 | 53.33% |
49 | (16 / 30) |
50 | 75% |
51 | (6 / 8) |
52 | 89.36% |
53 | (42 / 47) |
54 |
55 |
56 |
57 | init_server.js |
58 | |
59 | 15.63% |
60 | (5 / 32) |
61 | 0% |
62 | (0 / 14) |
63 | 0% |
64 | (0 / 7) |
65 | 16.67% |
66 | (5 / 30) |
67 |
68 |
69 |
70 | warn.js |
71 | |
72 | 55.56% |
73 | (5 / 9) |
74 | 0% |
75 | (0 / 4) |
76 | 0% |
77 | (0 / 1) |
78 | 55.56% |
79 | (5 / 9) |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
89 |
90 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/coverage/lcov-report/lib/init_server.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for lib/init_server.js
5 |
6 |
7 |
8 |
13 |
14 |
15 |
26 |
27 |
28 | 1
29 | 2
30 | 3
31 | 4
32 | 5
33 | 6
34 | 7
35 | 8
36 | 9
37 | 10
38 | 11
39 | 12
40 | 13
41 | 14
42 | 15
43 | 16
44 | 17
45 | 18
46 | 19
47 | 20
48 | 21
49 | 22
50 | 23
51 | 24
52 | 25
53 | 26
54 | 27
55 | 28
56 | 29
57 | 30
58 | 31
59 | 32
60 | 33
61 | 34
62 | 35
63 | 36
64 | 37
65 | 38
66 | 39
67 | 40
68 | 41
69 | 42
70 | 43
71 | 44
72 | 45
73 | 46
74 | 47
75 | 48
76 | 49
77 | 50
78 | 51
79 | 52
80 | 53
81 | 54
82 | 55
83 | 56
84 | 57
85 | 58
86 | 59
87 | 60
88 | 61
89 | 62
90 | 63
91 | 64
92 | 65
93 | 66
94 | 67
95 | 68
96 | 69
97 | 70
98 | 71
99 | 72
100 | 73
101 | 74
102 | 75
103 | 76
104 | 77
105 | 78
106 | 79
107 | 80
108 | 81
109 | 82
110 | 83
111 | 84
112 | 85
113 | 86
114 | 87
115 | 88
116 | 89
117 | 90
118 | 91 |
119 |
120 | 1
121 |
122 | 1
123 |
124 | 1
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | 1
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 | 1
206 |
207 |
208 | | 'use strict';
209 |
210 | var appRoot = require( 'app-root-path' ).path;
211 |
212 | var fs = require( 'fs' );
213 |
214 | function includeRoutes( routesPath, server ){
215 |
216 | fs.readdirSync( routesPath ).forEach(function ( file ) {
217 |
218 | if ( file.substr(-3, 3) === '.js' ) {
219 |
220 | require( routesPath + "/" + file.replace('.js', '')).addRoutes( server );
221 | }
222 |
223 | });
224 |
225 | }
226 |
227 | //only to be used as a module since routes directory does not exist
228 | function startServer( params ){
229 |
230 | var options = params.values;
231 |
232 | //import the logger
233 | var logger = require( './logger' );
234 |
235 | //set up the debugging
236 | var debug = require( 'debug' )( 'main' );
237 |
238 | //set up restify
239 | var restify = require( 'restify' );
240 |
241 | var routesPath = appRoot + "/routes";
242 |
243 | if( options.logging ){
244 |
245 | var server = restify.createServer( {
246 | name: params.name,
247 | log: logger,
248 | version: params.version
249 | });
250 |
251 | }
252 |
253 | if( !options.logging ) {
254 |
255 | var server = restify.createServer( {
256 | name: params.name,
257 | version: params.version
258 | });
259 | }
260 |
261 | //basic restify configurations
262 | server.use( restify.queryParser() );
263 | server.use( restify.bodyParser({ mapParams: false }));
264 |
265 | if( options.logging ){
266 |
267 | server.pre( function (req, res, next) {
268 |
269 | //comment out this line to turn logging of in the console
270 | req.log.info({req: req}, 'START');
271 |
272 | return next();
273 | });
274 |
275 | }
276 |
277 | // handle all uncaught errors - make sure they fit our error format
278 | server.on('uncaughtException', function( req, res, route, err) {
279 |
280 | if( options.logging ) { logger.error( err, 'uncaught exception' ); }
281 |
282 | res.send( 500, { code: 500, message: (err.toString() || 'error') } );
283 | });
284 |
285 | includeRoutes( routesPath, server, params.routesOptions );
286 |
287 | //Run server
288 | server.listen( params.port, function() {
289 |
290 | if( options.logging ) { logger.info( '%s listening at %s', server.name, server.url ) }
291 | });
292 |
293 | }
294 |
295 | module.exports = function( params ) {
296 |
297 | startServer( params );
298 | } |
299 |
300 |
301 |
302 |
305 |
306 |
313 |
314 |
315 |
316 |
--------------------------------------------------------------------------------
/coverage/lcov-report/lib/warn.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Code coverage report for lib/warn.js
5 |
6 |
7 |
8 |
13 |
14 |
15 |
26 |
27 |
28 | 1
29 | 2
30 | 3
31 | 4
32 | 5
33 | 6
34 | 7
35 | 8
36 | 9
37 | 10
38 | 11
39 | 12
40 | 13
41 | 14
42 | 15
43 | 16
44 | 17
45 | 18
46 | 19
47 | 20
48 | 21
49 | 22 |
50 |
51 | 1
52 |
53 | 1
54 |
55 | 1
56 |
57 | 1
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | 1 | 'use strict'
71 |
72 | var jsonFile = require( 'jsonFile' );
73 |
74 | var appRoot = require( 'app-root-path' ).path;
75 |
76 | var pjson = require( appRoot + "/package.json" );
77 |
78 | function warn( ){
79 |
80 | if( pjson.name === "default" ){
81 |
82 | console.warn( "@warning Edit the name of your server in package.json" );
83 | }
84 |
85 | if( pjson.author === "theMagicElf" ){
86 |
87 | console.warn( "@warning Edit the author of your server in package.json" );
88 | }
89 | }
90 |
91 | module.exports = warn; |
92 |
93 |
94 |
95 |
98 |
99 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/coverage/lcov-report/prettify.css:
--------------------------------------------------------------------------------
1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
2 |
--------------------------------------------------------------------------------
/coverage/lcov-report/prettify.js:
--------------------------------------------------------------------------------
1 | window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^