epg-grabber 0.37.4 → 0.37.5

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.
@@ -0,0 +1,25 @@
1
+ import globals from "globals";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import js from "@eslint/js";
5
+ import { FlatCompat } from "@eslint/eslintrc";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const compat = new FlatCompat({
10
+ baseDirectory: __dirname,
11
+ recommendedConfig: js.configs.recommended,
12
+ allConfig: js.configs.all
13
+ });
14
+
15
+ export default [...compat.extends("eslint:recommended"), {
16
+ languageOptions: {
17
+ globals: {
18
+ ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, "off"])),
19
+ ...globals.node,
20
+ },
21
+
22
+ ecmaVersion: 12,
23
+ sourceType: "commonjs",
24
+ },
25
+ }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.37.4",
3
+ "version": "0.37.5",
4
4
  "description": "Node.js CLI tool for grabbing EPG from different sites",
5
5
  "main": "src/index.js",
6
6
  "preferGlobal": true,
@@ -48,8 +48,11 @@
48
48
  "devDependencies": {
49
49
  "@babel/core": "^7.13.14",
50
50
  "@babel/preset-env": "^7.13.12",
51
+ "@eslint/eslintrc": "^3.2.0",
52
+ "@eslint/js": "^9.18.0",
51
53
  "babel-jest": "^29.7.0",
52
54
  "eslint": "^9.17.0",
55
+ "globals": "^15.14.0",
53
56
  "jest": "^29.7.0",
54
57
  "jest-mock-axios": "^4.4.1"
55
58
  },
package/src/Channel.js CHANGED
@@ -1,5 +1,3 @@
1
- const { toArray } = require('./utils')
2
-
3
1
  class Channel {
4
2
  constructor(c) {
5
3
  const data = {
package/src/index.d.ts CHANGED
@@ -101,19 +101,21 @@ export type GrabCallbackData = {
101
101
  }
102
102
 
103
103
  export declare class EPGGrabber {
104
- constructor(config: SiteConfig)
104
+ constructor(config?: SiteConfig)
105
105
  grab(
106
106
  channel: Channel,
107
107
  date: string | dayjs.Dayjs,
108
- cb: (data: GrabCallbackData, err: Error | null) => void
108
+ config?: SiteConfig,
109
+ cb?: (data: GrabCallbackData, err: Error | null) => void
109
110
  ): Promise<Program[]>
110
111
  }
111
112
 
112
113
  export declare class EPGGrabberMock {
113
- constructor(config: SiteConfig)
114
+ constructor(config?: SiteConfig)
114
115
  grab(
115
116
  channel: Channel,
116
117
  date: string | dayjs.Dayjs,
117
- cb: (data: GrabCallbackData, err: Error | null) => void
118
+ config?: SiteConfig,
119
+ cb?: (data: GrabCallbackData, err: Error | null) => void
118
120
  ): Promise<Program[]>
119
121
  }
package/src/index.js CHANGED
@@ -60,7 +60,7 @@ class EPGGrabber {
60
60
  }
61
61
 
62
62
  class EPGGrabberMock {
63
- constructor(config) {
63
+ constructor(config = {}) {
64
64
  this.config = config
65
65
  }
66
66
 
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8" ?><tv date="20241215">
1
+ <?xml version="1.0" encoding="UTF-8" ?><tv date="20250124">
2
2
  <channel id="1TV.com"><display-name>1 TV</display-name><icon src="https://example.com/logos/1TV.png"/><url>https://example.com</url></channel>
3
3
  <channel id="2TV.com"><display-name>2 TV</display-name><url>https://example.com</url></channel>
4
4
  <channel id="3TV.com"><display-name>3 TV</display-name><url>https://example2.com</url></channel>
package/.eslintrc.js DELETED
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: false,
4
- node: true,
5
- es6: true
6
- },
7
- extends: 'eslint:recommended',
8
- parserOptions: {
9
- ecmaVersion: 12
10
- }
11
- }