epg-grabber 0.25.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/utils.js +8 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "Node.js CLI tool for grabbing EPG from different sites",
5
5
  "main": "src/index.js",
6
6
  "preferGlobal": true,
package/src/utils.js CHANGED
@@ -70,9 +70,10 @@ utils.createClient = function (config) {
70
70
  client.interceptors.response.use(
71
71
  function (response) {
72
72
  if (config.debug) {
73
- const data = utils.isObject(response.data)
74
- ? JSON.stringify(response.data)
75
- : response.data.toString()
73
+ const data =
74
+ utils.isObject(response.data) || Array.isArray(response.data)
75
+ ? JSON.stringify(response.data)
76
+ : response.data.toString()
76
77
  console.log(
77
78
  'Response:',
78
79
  JSON.stringify(
@@ -315,9 +316,10 @@ utils.getUTCDate = function (d = null) {
315
316
  }
316
317
 
317
318
  utils.parseResponse = async (item, response, config) => {
318
- const content = utils.isObject(response.data)
319
- ? JSON.stringify(response.data)
320
- : response.data.toString()
319
+ const content =
320
+ utils.isObject(response.data) || Array.isArray(response.data)
321
+ ? JSON.stringify(response.data)
322
+ : response.data.toString()
321
323
  const buffer = Buffer.from(content, 'utf8')
322
324
  const data = merge(item, config, {
323
325
  content,