Comparing version 1.10.0 to 1.10.1
@@ -0,1 +1,8 @@ | ||
v1.10.1 | ||
======= | ||
2017-05-05T12:24:22Z | ||
- `web` can parse UTF-16LE responses or responses with BOM in Node.js. | ||
v1.10.0 | ||
@@ -2,0 +9,0 @@ ======= |
{ | ||
"name": "fus-ext", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "FutureScript Extension", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -119,3 +119,3 @@ "use strict";Object.defineProperty(exports, "__esModule", { | ||
var arg_573300145710716007 = arguments;return (function () { | ||
var response;return (function () { | ||
var response, bodyString, contentType, contentEncodingMatches, encoding;return (function () { | ||
try { | ||
@@ -126,9 +126,37 @@ return (function () { | ||
})() : (function () { | ||
return responseBodyType === "text" ? (function () { | ||
return data.toString(); | ||
})() : (function () { | ||
return responseBodyType === "json" ? (function () { | ||
return JSON.parse(data.toString()); | ||
})() : undefined; | ||
})(); | ||
return ["text", "json"].indexOf(responseBodyType) >= 0 ? (function () { | ||
bodyString = data[0] === 0xef && data[1] === 0xbb && data[2] === 0xbf ? (function () { | ||
return data.toString(undefined, 3); | ||
})() : (function () { | ||
return data[0] === 0xff && data[1] === 0xfe ? (function () { | ||
return data.toString("utf16le", 2); | ||
})() : (function () { | ||
return data[0] === 0xfe && data[1] === 0xff ? (function () { | ||
return (0, _main.fail)(); | ||
})() : (function () { | ||
contentType = rawResponse.headers["content-type"].toLowerCase();return ok_573300145710716007(contentType) ? (function () { | ||
contentEncodingMatches = contentType.match(new RegExp(";\\s*charset=([^\\s;]+)\\s*(;|$)"));return ok_573300145710716007(contentEncodingMatches) ? (function () { | ||
encoding = contentEncodingMatches[1];return encoding === "utf-8" ? (function () { | ||
return data.toString(); | ||
})() : (function () { | ||
return ["utf-16", "utf-16le"].indexOf(encoding) >= 0 ? (function () { | ||
return data.toString("utf16le"); | ||
})() : (function () { | ||
return (0, _main.fail)(); | ||
})(); | ||
})(); | ||
})() : (function () { | ||
return data.toString(); | ||
})(); | ||
})() : (function () { | ||
return data.toString(); | ||
})(); | ||
})(); | ||
})(); | ||
})();return responseBodyType === "text" ? (function () { | ||
return bodyString; | ||
})() : (function () { | ||
return JSON.parse(bodyString); | ||
})(); | ||
})() : undefined; | ||
})() };return 200 <= response.statusCode && response.statusCode < 300 ? (function () { | ||
@@ -135,0 +163,0 @@ return resolve(response); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
352513
4278