Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imdb-api

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imdb-api - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

10

lib/imdb.js

@@ -110,3 +110,3 @@ var __extends = this.__extends || function (d, b) {

myDeanclatworthy = new ApiHost(deanclatworthy);
if(req.name !== null) {
if(req.name) {
myDeanclatworthy.path += "?" + querystring.stringify({

@@ -116,3 +116,3 @@ q: req.name,

});
} else if(req.id !== null) {
} else if(req.id) {
myDeanclatworthy.path += "?" + querystring.stringify({

@@ -137,3 +137,3 @@ id: req.id

if(responseObject.hasOwnProperty("code") && responseObject.hasOwnProperty("error")) {
return cb(new ImdbError(responseObject.error + ": " + (req.name === null ? req.id : req.name), req), null);
return cb(new ImdbError(responseObject.error + ": " + (req.name ? req.name : req.id), req), null);
}

@@ -154,3 +154,3 @@ if(responseObject.series === 0) {

return getReq({
id: null,
id: undefined,
name: name

@@ -172,3 +172,3 @@ }, cb);

id: id,
name: null
name: undefined
}, cb);

@@ -175,0 +175,0 @@ }

@@ -5,3 +5,3 @@ {

"description": "Queries unofficial imdb APIs to get movie and television information from imdb",
"version": "1.3.0",
"version": "1.3.1",
"main": "lib/imdb.js",

@@ -8,0 +8,0 @@ "homepage": "https://github.com/worr/node-imdb-api",

@@ -137,5 +137,5 @@ "use strict";

if (req.name !== null) {
if (req.name) {
myDeanclatworthy.path += "?" + querystring.stringify({ q: req.name, yg: 0 });
} else if (req.id !== null) {
} else if (req.id) {
myDeanclatworthy.path += "?" + querystring.stringify({ id: req.id });

@@ -164,3 +164,3 @@ }

if (responseObject.hasOwnProperty("code") && responseObject.hasOwnProperty("error")) {
return cb(new ImdbError(responseObject.error + ": " + (req.name === null ? req.id : req.name), req), null);
return cb(new ImdbError(responseObject.error + ": " + (req.name ? req.name : req.id), req), null);
}

@@ -183,3 +183,3 @@

export function get(name: string, cb: (Error, any) => any) {
return getReq({id: null, name: name }, cb);
return getReq({id: undefined, name: name }, cb);
};

@@ -199,4 +199,4 @@

return getReq({ id: id, name: null }, cb);
return getReq({ id: id, name: undefined }, cb);
};

@@ -32,3 +32,3 @@ var http = require('http');

test.deepEqual(err, new imdb.ImdbError('rate limited: The Green Mile', { name:'The Green Mile', id: null }), "testing error code");
test.deepEqual(err, new imdb.ImdbError('rate limited: The Green Mile', { name:'The Green Mile', id: undefined }), "testing error code");

@@ -59,3 +59,3 @@ test.done();

test.deepEqual(err, new imdb.ImdbError('Film not found: asdfasdfasdf', { name:'asdfasdfasdf', id: null }), "testing film not found error");
test.deepEqual(err, new imdb.ImdbError('Film not found: asdfasdfasdf', { name:'asdfasdfasdf', id: undefined }), "testing film not found error");

@@ -62,0 +62,0 @@ test.done();

@@ -34,3 +34,3 @@ "use strict";

test.deepEqual(err, new imdb.ImdbError('rate limited: tt0090190', { id: 'tt0090190', name: null }), "testing error code");
test.deepEqual(err, new imdb.ImdbError('rate limited: tt0090190', { id: 'tt0090190', name: undefined }), "testing error code");

@@ -61,3 +61,3 @@ test.done();

test.deepEqual(err, new imdb.ImdbError('Film not found: tt0090190', { id: 'tt0090190', name: null }), "testing film not found error");
test.deepEqual(err, new imdb.ImdbError('Film not found: tt0090190', { id: 'tt0090190', name: undefined }), "testing film not found error");

@@ -64,0 +64,0 @@ test.done();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc