epg-grabber 0.46.0 → 0.46.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.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as name, v as version, d as description, p as parseNumber, l as loadJs, a as parseProxy, E as EPGGrabberMock, b as EPGGrabber, c as defaultConfig, i as isObject, g as getAbsPath, e as getUTCDate } from './index-DUJ5SdIU.js';
2
+ import { n as name, v as version, d as description, p as parseNumber, l as loadJs, a as parseProxy, E as EPGGrabberMock, b as EPGGrabber, c as defaultConfig, i as isObject, g as getAbsPath, e as getUTCDate } from './index-Bnw63KMN.js';
3
3
  import { Collection, Template } from '@freearhey/core';
4
4
  import { Command, Option } from 'commander';
5
5
  import { SocksProxyAgent } from 'socks-proxy-agent';
@@ -102,7 +102,7 @@ function toArray(value) {
102
102
  }
103
103
 
104
104
  var name = "epg-grabber";
105
- var version = "0.46.0";
105
+ var version = "0.46.1";
106
106
  var description = "Node.js CLI tool for grabbing EPG from different sites";
107
107
  var homepage = "https://github.com/freearhey/epg-grabber";
108
108
 
@@ -731,7 +731,7 @@ class EPGGrabber {
731
731
  async loadLogo(channel, date, config = {}) {
732
732
  if (!(channel instanceof Channel))
733
733
  throw new Error('The first argument must be the "Channel" class');
734
- config = merge(defaultConfig, config, this.globalConfig);
734
+ config = merge({}, defaultConfig, config, this.globalConfig);
735
735
  if (typeof config.logo !== "function") return null;
736
736
  const requestContext = { channel, date: getUTCDate(date), config };
737
737
  const logo = config.logo(requestContext);
@@ -749,7 +749,7 @@ class EPGGrabber {
749
749
  config = {};
750
750
  }
751
751
  const utcDate = getUTCDate(date);
752
- config = merge(defaultConfig, config, this.globalConfig);
752
+ config = merge({}, defaultConfig, config, this.globalConfig);
753
753
  if (!config.parser) throw new Error("Could not find parser() in the config file");
754
754
  if (!config.site) throw new Error("The required 'site' property is missing");
755
755
  if (!config.url) throw new Error("The required 'url' property is missing");
@@ -826,7 +826,7 @@ class EPGGrabberMock extends EPGGrabber {
826
826
  config = {};
827
827
  }
828
828
  const utcDate = getUTCDate(date);
829
- config = merge(defaultConfig, config, this.globalConfig);
829
+ config = merge({}, defaultConfig, config, this.globalConfig);
830
830
  if (!config.parser) throw new Error("Could not find parser() in the config file");
831
831
  try {
832
832
  const requestContext = { channel, date: utcDate, config };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export { C as Channel, b as EPGGrabber, E as EPGGrabberMock, P as Program } from './index-DUJ5SdIU.js';
2
+ export { C as Channel, b as EPGGrabber, E as EPGGrabberMock, P as Program } from './index-Bnw63KMN.js';
3
3
  import 'axios-mock-adapter';
4
4
  import 'lodash.merge';
5
5
  import 'xml-js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "description": "Node.js CLI tool for grabbing EPG from different sites",
5
5
  "homepage": "https://github.com/freearhey/epg-grabber",
6
6
  "preferGlobal": true,
package/src/index.ts CHANGED
@@ -30,7 +30,7 @@ export class EPGGrabber {
30
30
  if (!(channel instanceof Channel))
31
31
  throw new Error('The first argument must be the "Channel" class')
32
32
 
33
- config = merge(defaultConfig, config, this.globalConfig)
33
+ config = merge({}, defaultConfig, config, this.globalConfig)
34
34
 
35
35
  if (typeof config.logo !== 'function') return null
36
36
 
@@ -59,7 +59,7 @@ export class EPGGrabber {
59
59
 
60
60
  const utcDate = getUTCDate(date)
61
61
 
62
- config = merge(defaultConfig, config, this.globalConfig)
62
+ config = merge({}, defaultConfig, config, this.globalConfig)
63
63
 
64
64
  if (!config.parser) throw new Error('Could not find parser() in the config file')
65
65
  if (!config.site) throw new Error("The required 'site' property is missing")
@@ -175,7 +175,7 @@ export class EPGGrabberMock extends EPGGrabber {
175
175
 
176
176
  const utcDate = getUTCDate(date)
177
177
 
178
- config = merge(defaultConfig, config, this.globalConfig)
178
+ config = merge({}, defaultConfig, config, this.globalConfig)
179
179
 
180
180
  if (!config.parser) throw new Error('Could not find parser() in the config file')
181
181
 
package/tests/cli.test.ts CHANGED
@@ -57,72 +57,21 @@ it('can load mini config', () => {
57
57
  }
58
58
  )
59
59
 
60
- expect(stdout).contains(`{
61
- "site": "example.com",
62
- "url": "http://example.com/20210319/1tv.json",
63
- "channels": [
60
+ expect(stdout).contains('"site": "example.com"')
61
+ expect(stdout).contains('"url": "http://example.com/20210319/1tv.json"')
62
+ expect(stdout).contains(`"channels": [
64
63
  "tests/__data__/input/example.channels.xml"
65
- ],
66
- "request": {
67
- "timeout": 1,
68
- "httpAgent": {
69
- "_events": {},
70
- "_eventsCount": 2,
71
- "options": {
72
- "noDelay": true,
73
- "path": null
74
- },
75
- "requests": {},
76
- "sockets": {},
77
- "freeSockets": {},
78
- "keepAliveMsecs": 1000,
79
- "keepAlive": false,
80
- "maxSockets": null,
81
- "maxFreeSockets": 256,
82
- "scheduling": "lifo",
83
- "maxTotalSockets": null,
84
- "totalSocketCount": 0,
85
- "shouldLookup": false,
86
- "proxy": {
64
+ ]`)
65
+ expect(stdout).contains('"timeout": 1')
66
+ expect(stdout).contains(`"proxy": {
87
67
  "host": "127.0.0.1",
88
68
  "port": 1086,
89
69
  "type": 5
90
- },
91
- "timeout": null,
92
- "socketOptions": null
93
- },
94
- "httpsAgent": {
95
- "_events": {},
96
- "_eventsCount": 2,
97
- "options": {
98
- "noDelay": true,
99
- "path": null
100
- },
101
- "requests": {},
102
- "sockets": {},
103
- "freeSockets": {},
104
- "keepAliveMsecs": 1000,
105
- "keepAlive": false,
106
- "maxSockets": null,
107
- "maxFreeSockets": 256,
108
- "scheduling": "lifo",
109
- "maxTotalSockets": null,
110
- "totalSocketCount": 0,
111
- "shouldLookup": false,
112
- "proxy": {
113
- "host": "127.0.0.1",
114
- "port": 1086,
115
- "type": 5
116
- },
117
- "timeout": null,
118
- "socketOptions": null
119
- }
120
- },
121
- "output": "tests/__data__/output/mini.guide.xml",
122
- "days": 3,
123
- "delay": 0,
124
- "debug": true
125
- }`)
70
+ }`)
71
+ expect(stdout).contains('"output": "tests/__data__/output/mini.guide.xml"')
72
+ expect(stdout).contains('"days": 3')
73
+ expect(stdout).contains('"delay": 0')
74
+ expect(stdout).contains('"debug": true')
126
75
  expect(stdout).contains("File 'tests/__data__/output/mini.guide.xml' successfully saved")
127
76
  expect(content('tests/__data__/output/mini.guide.xml')).toEqual(
128
77
  content('tests/__data__/expected/mini.guide.xml')