Comparing version 2.0.0 to 2.1.0
@@ -52,4 +52,4 @@ "use strict"; | ||
this["_year_data"] = obj[attr]; | ||
if (obj[attr].match(/\d{4}[\-–](?:\d{4})/)) { | ||
this[attr] = parseInt(obj[attr]); | ||
if (!obj[attr].match(/\d{4}[\-–]\d{4}/)) { | ||
this[attr.toLowerCase()] = parseInt(obj[attr]); | ||
} | ||
@@ -135,3 +135,3 @@ } | ||
throw new TypeError("cb must be a function"); | ||
var qs = { plot: "full", r: "json" }; | ||
var qs = { plot: "full", r: "json", y: req.year }; | ||
if (req.name) { | ||
@@ -138,0 +138,0 @@ qs["t"] = req.name; |
@@ -5,3 +5,3 @@ { | ||
"description": "Queries unofficial imdb APIs to get movie and television information from imdb", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"main": "lib/imdb.js", | ||
@@ -26,3 +26,3 @@ "homepage": "https://github.com/worr/node-imdb-api", | ||
"tslint": "^3.15.1", | ||
"typescript": "1.8.x" | ||
"typescript": "^2.0.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "optionalDependencies": {}, |
@@ -27,4 +27,5 @@ /// <reference path="../typings/index.d.ts"/> | ||
export interface MovieRequest { | ||
name: string; | ||
id: string; | ||
name?: string; | ||
id?: string; | ||
year?: number; | ||
} | ||
@@ -98,4 +99,4 @@ | ||
this["_year_data"] = obj[attr]; | ||
if (obj[attr].match(/\d{4}[\-–](?:\d{4})/)) { | ||
this[attr] = parseInt(obj[attr]); | ||
if (! obj[attr].match(/\d{4}[\-–]\d{4}/)) { | ||
this[attr.toLowerCase()] = parseInt(obj[attr]); | ||
} | ||
@@ -184,3 +185,3 @@ } else if (attr === "Released") { | ||
let qs = {plot: "full", r: "json"}; | ||
let qs = {plot: "full", r: "json", y: req.year}; | ||
@@ -187,0 +188,0 @@ if (req.name) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
176615
35
3755