From e1141ea9d7554ac03bd1831bf882a45706e0b46b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 7 Mar 2022 00:31:48 -0400 Subject: fix unique artists not being shown in track list --- src/util/sugar.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/util') diff --git a/src/util/sugar.js b/src/util/sugar.js index c8f1706c..7a132271 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -32,6 +32,11 @@ export const filterEmptyLines = string => string.split('\n').filter(line => line export const unique = arr => Array.from(new Set(arr)); +export const compareArrays = (arr1, arr2, {checkOrder = true} = {}) => ( + arr1.length === arr2.length && (checkOrder + ? (arr1.every((x, i) => arr2[i] === x)) + : (arr1.every(x => arr2.includes(x))))); + // Stolen from jq! Which pro8a8ly stole the concept from other places. Nice. export const withEntries = (obj, fn) => Object.fromEntries(fn(Object.entries(obj))); -- cgit 1.3.0-6-gf8a5