Browse Source

add XO

http2
Sindre Sorhus 10 years ago
parent
commit
5c1e976b2f
  1. 12
      .jshintrc
  2. 2
      index.js
  3. 5
      package.json
  4. 2
      test/test-gzip.js

12
.jshintrc

@ -1,12 +0,0 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"curly": true,
"immed": true,
"newcap": true,
"noarg": true,
"undef": true,
"unused": "vars",
"strict": true
}

2
index.js

@ -235,7 +235,7 @@ function got(url, opts, cb) {
if (cb) { if (cb) {
asCallback(opts, cb); asCallback(opts, cb);
return; return null;
} }
return asPromise(opts); return asPromise(opts);

5
package.json

@ -20,7 +20,7 @@
"node": ">=0.10.0" "node": ">=0.10.0"
}, },
"scripts": { "scripts": {
"test": "tap test/test-*.js" "test": "xo && tap test/test-*.js"
}, },
"files": [ "files": [
"index.js" "index.js"
@ -60,6 +60,7 @@
"into-stream": "^2.0.0", "into-stream": "^2.0.0",
"istanbul": "^0.3.13", "istanbul": "^0.3.13",
"pem": "^1.4.4", "pem": "^1.4.4",
"tap": "^1.0.0" "tap": "^1.0.0",
"xo": "*"
} }
} }

2
test/test-gzip.js

@ -10,7 +10,7 @@ s.on('/', function (req, res) {
res.statusCode = 200; res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain'); res.setHeader('Content-Type', 'text/plain');
res.setHeader('Content-Encoding', 'gzip'); res.setHeader('Content-Encoding', 'gzip');
zlib.gzip(testContent, function (err, data) { zlib.gzip(testContent, function (_, data) {
res.end(data); res.end(data);
}); });
}); });

Loading…
Cancel
Save