elections-types 1.0.32 → 1.0.34

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.
@@ -7,7 +7,7 @@ export declare class Video {
7
7
  readonly title: string;
8
8
  readonly description: string;
9
9
  readonly tags?: string[];
10
- readonly duration: number;
10
+ readonly duration?: number;
11
11
  readonly fetch_time: string;
12
12
  constructor(video: any);
13
13
  static is(video: any): video is Video;
@@ -34,7 +34,7 @@ export class Video {
34
34
  typeof video.title === "string" &&
35
35
  typeof video.description === "string" &&
36
36
  (video.tags === undefined || Array.isArray(video.tags) && video.tags.map((tag) => typeof tag === "string")) &&
37
- typeof video.duration === "number" &&
38
- typeof video.fetch_time === "number");
37
+ (video.duration === undefined || typeof video.duration === "number" && !isNaN(video.duration)) &&
38
+ typeof video.fetch_time === "string");
39
39
  }
40
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -7,7 +7,7 @@ export class Video {
7
7
  readonly title : string
8
8
  readonly description : string
9
9
  readonly tags? : string[]
10
- readonly duration : number
10
+ readonly duration? : number
11
11
  readonly fetch_time : string
12
12
 
13
13
  constructor(video : any) {
@@ -37,8 +37,8 @@ export class Video {
37
37
  typeof video.title === "string" &&
38
38
  typeof video.description === "string" &&
39
39
  (video.tags === undefined || Array.isArray(video.tags) && video.tags.map((tag : any) => typeof tag === "string")) &&
40
- typeof video.duration === "number" &&
41
- typeof video.fetch_time === "number"
40
+ (video.duration === undefined || typeof video.duration === "number" && !isNaN(video.duration)) &&
41
+ typeof video.fetch_time === "string"
42
42
  )
43
43
  }
44
44
  }
package/tsconfig.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "rootDir": "./",
25
25
  "skipLibCheck": true,
26
26
  "maxNodeModuleJsDepth": 0,
27
- "types": ["jest", "node"]
27
+ "types": ["node"]
28
28
  },
29
29
  "tsc-alias": {
30
30
  "resolveFullPaths": true,