We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f295457 commit 02424b8Copy full SHA for 02424b8
src/utils.js
@@ -0,0 +1,20 @@
1
+/**
2
+ * deep compares two values for the "playlist prop"
3
+ *
4
+ * @param {string | string[]} lastPlayList
5
+ * @param {string | string[]} playList
6
+ * @returns true if the two are equal
7
+ */
8
+const deepComparePlayList = (lastPlayList, playList) => {
9
+ if (lastPlayList === playList) {
10
+ return true;
11
+ }
12
+
13
+ if (Array.isArray(lastPlayList) && Array.isArray(playList)) {
14
+ return lastPlayList.join('') === playList.join('');
15
16
17
+ return false;
18
+};
19
20
+export {deepComparePlayList};
0 commit comments