Skip to content

Commit

Permalink
fix: make the function pure
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenrikoverland committed Aug 8, 2024
1 parent 8fe2bf6 commit d6b2faa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/api/analytics/AnalyticsBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ const analyticsMetaDataQuery = {

export const generateDimensionStrings = (dimensions = [], options) => {
const sortedDimensions = sortBy(dimensions, 'dimension')
console.log('arrays the same?', sortedDimensions === dimensions)
return sortedDimensions.map(({ dimension, items }) => {
if (Array.isArray(items) && items.length) {
if (options && options.sorted) {
items.sort()
items = items.slice().sort()
}

return `${dimension}:${items.join(';')}`
Expand Down

0 comments on commit d6b2faa

Please sign in to comment.