get-movie-extra-name
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -7,2 +7,3 @@ const request = require('request'); | ||
const removeStartDash = str => str.replace(/^-+\s*/, '').trim(); | ||
const difference = (x, y) => Math.abs(x - y); | ||
@@ -53,2 +54,4 @@ async function getMovieExtraName(param, inputTime) { | ||
console.log(extras); | ||
for (let i = 0; i < extras.length; i += 1) { | ||
@@ -63,3 +66,3 @@ if (extras[i].time === time) { | ||
for (let i = 0; i < extras.length; i += 1) { | ||
if (Math.abs(extras[i].time - time) <= 1) { | ||
if (difference(extras[i].time, time) <= 2) { | ||
output = extras[i].title; | ||
@@ -66,0 +69,0 @@ break; |
{ | ||
"name": "get-movie-extra-name", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Pass the title of a movie and the length of an extra and get back the title of that extra", | ||
@@ -5,0 +5,0 @@ "main": "./lib/get-movie-extra-name.js", |
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
5136
73