@localizedirect/ndjson-fetch
Advanced tools
Comparing version 1.0.0 to 1.0.1
18
index.js
require('whatwg-fetch') | ||
function parseNdJSON(response) { | ||
return response.text() | ||
.then(function(text) { | ||
return text.split('\n').map(function(x) { | ||
return JSON.parse(x) | ||
function parse(response) { | ||
response.jsonStream = function() { | ||
return response.text() | ||
.then(function(text) { | ||
return text.split('\n').map(function(x) { | ||
return JSON.parse(x) | ||
}) | ||
}) | ||
}) | ||
} | ||
return response | ||
} | ||
@@ -14,3 +18,3 @@ | ||
return fetch(url, params) | ||
.then(parseNdJSON) | ||
.then(parse) | ||
} |
{ | ||
"name": "@localizedirect/ndjson-fetch", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
1221
16