[Pkg-javascript-commits] [node-stream-http] 169/208: style consistency

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 13 13:39:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-http.

commit e8ef98b2863056dc2269adea698d6b4fe8738876
Author: John Hiesey <john at hiesey.com>
Date:   Fri Jan 6 01:04:07 2017 -1000

    style consistency
---
 lib/capability.js | 42 ++++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/lib/capability.js b/lib/capability.js
index 7b11328..e71b40a 100644
--- a/lib/capability.js
+++ b/lib/capability.js
@@ -2,33 +2,31 @@ exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream)
 
 exports.blobConstructor = false
 try {
-  new Blob([new ArrayBuffer(1)])
-  exports.blobConstructor = true
+	new Blob([new ArrayBuffer(1)])
+	exports.blobConstructor = true
 } catch (e) {}
 
 // Service workers don't have XHR
+var xhr = null
 if (global.XMLHttpRequest) {
-  var xhr = new global.XMLHttpRequest()
-  // If XDomainRequest is available (ie only, where xhr might not work
-  // cross domain), use the page location. Otherwise use example.com
-  // Note: this doesn't actually make an http request.
-  try {
-    xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com')
-  } catch(_) {
-    xhr = null
-  }
-} else {
-  var xhr = null
+	xhr = new global.XMLHttpRequest()
+	// If XDomainRequest is available (ie only, where xhr might not work
+	// cross domain), use the page location. Otherwise use example.com
+	// Note: this doesn't actually make an http request.
+	try {
+		xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com')
+	} catch(e) {
+		xhr = null
+	}
 }
 
-
 function checkTypeSupport (type) {
-  if (!xhr) return false
-  try {
-    xhr.responseType = type
-    return xhr.responseType === type
-  } catch (e) {}
-  return false
+	if (!xhr) return false
+	try {
+		xhr.responseType = type
+		return xhr.responseType === type
+	} catch (e) {}
+	return false
 }
 
 // For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'.
@@ -41,12 +39,12 @@ exports.arraybuffer = haveArrayBuffer && checkTypeSupport('arraybuffer')
 // be used if it's available, just return false for these to avoid the warnings.
 exports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream')
 exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer &&
-  checkTypeSupport('moz-chunked-arraybuffer')
+	checkTypeSupport('moz-chunked-arraybuffer')
 exports.overrideMimeType = xhr ? isFunction(xhr.overrideMimeType) : false
 exports.vbArray = isFunction(global.VBArray)
 
 function isFunction (value) {
-  return typeof value === 'function'
+	return typeof value === 'function'
 }
 
 xhr = null // Help gc

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git



More information about the Pkg-javascript-commits mailing list