From 65c7c71a7a1c4d64b55a5449941eb229364c9f8a Mon Sep 17 00:00:00 2001 From: Adam Grieger Date: Mon, 22 Oct 2018 02:23:07 -0700 Subject: [PATCH] Make options optional for more playback endpoints. Fixes #115. (#116) --- package-lock.json | 28 +++++++++++++++++++++------- src/spotify-web-api.js | 4 ++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3e0a94..6d6132a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1946,12 +1946,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1966,17 +1968,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2093,7 +2098,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2105,6 +2111,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2119,6 +2126,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2126,12 +2134,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2150,6 +2160,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2230,7 +2241,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2242,6 +2254,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2363,6 +2376,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/src/spotify-web-api.js b/src/spotify-web-api.js index e2bbfaa..55c0014 100644 --- a/src/spotify-web-api.js +++ b/src/spotify-web-api.js @@ -1589,6 +1589,7 @@ var SpotifyWebApi = (function() { * @return {Object} Null if a callback is provided, a `Promise` object otherwise */ Constr.prototype.seek = function(position_ms, options, callback) { + options = options || {}; var params = { position_ms: position_ms }; @@ -1615,6 +1616,7 @@ var SpotifyWebApi = (function() { * @return {Object} Null if a callback is provided, a `Promise` object otherwise */ Constr.prototype.setRepeat = function(state, options, callback) { + options = options || {}; var params = { state: state }; @@ -1641,6 +1643,7 @@ var SpotifyWebApi = (function() { * @return {Object} Null if a callback is provided, a `Promise` object otherwise */ Constr.prototype.setVolume = function(volume_percent, options, callback) { + options = options || {}; var params = { volume_percent: volume_percent }; @@ -1667,6 +1670,7 @@ var SpotifyWebApi = (function() { * @return {Object} Null if a callback is provided, a `Promise` object otherwise */ Constr.prototype.setShuffle = function(state, options, callback) { + options = options || {}; var params = { state: state };