public-google-sheets-parser
Advanced tools
Comparing version 1.2.3 to 1.2.4
{ | ||
"name": "public-google-sheets-parser", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Get JSONArray from public google sheets with using only spreadsheetId", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -6,6 +6,14 @@ const https = require('https') | ||
const req = https.request(url, (res) => { | ||
res.on('data', (data) => { | ||
if (!String(data).startsWith('/*O_o*/')) return resolve(null) | ||
const body = [] | ||
let isStarted = false | ||
const response = { ok: true, text: () => String(data) } | ||
res.on('data', (chunk) => { | ||
if (!isStarted && !String(chunk).startsWith('/*O_o*/')) return resolve(null) | ||
isStarted = true | ||
body.push(chunk) | ||
}) | ||
res.on('end', () => { | ||
const response = { ok: true, text: () => Buffer.concat(body).toString() } | ||
resolve(response) | ||
@@ -12,0 +20,0 @@ }) |
827041
14
328