als-layout 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/layout.js +5 -3
  2. package/package.json +1 -1
package/lib/layout.js CHANGED
@@ -115,13 +115,15 @@ class Layout extends Document {
115
115
  }
116
116
 
117
117
  status(statusCode) { this.statusCode = statusCode; return this }
118
- end(res) {
119
- res.writeHead(this.statusCode);
118
+
119
+ end(res,statusCode = this.statusCode, rawHtml = this.rawHtml) {
120
+ res.writeHead(statusCode);
120
121
  if (res.set) res.set('Content-Type', 'text/html') // for Express
121
122
  else res.setHeader('Content-Type', 'text/html') // for http
122
- res.end(this.rawHtml)
123
+ res.end(rawHtml)
123
124
  return this
124
125
  }
126
+
125
127
  }
126
128
 
127
129
  module.exports = Layout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "als-layout",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "node --test --experimental-test-coverage",