Skip to content

Commit

Permalink
Merge branch 'release/3.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
electerious committed Jan 21, 2021
2 parents 7891863 + c6b6fad commit ec97b7f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.0.2] - 2021-01-21

### Fixed

- Temporary workaround for missing browser sizes (#217)

## [3.0.1] - 2021-01-21

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ackee",
"private": true,
"version": "3.0.1",
"version": "3.0.2",
"authors": [
"Tobias Reich <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion src/database/sizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const get = async (ids, sorting, type, range, limit, dateDetails) => {
[ `${ entry._id.screenHeight }px`, [ entry._id.screenHeight ]],
[ `${ entry._id.browserWidth }px`, [ entry._id.browserWidth ]],
[ `${ entry._id.browserHeight }px`, [ entry._id.browserHeight ]]
]),
], '0px'),
count: entry.count,
created: entry.created
}))
Expand Down
12 changes: 10 additions & 2 deletions src/utils/bestMatch.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
'use strict'

module.exports = (matches) => {
module.exports = (matches, fallback) => {

// Find the first item that only consists if defined values
return matches.reduce((prev, [ key, values ]) => {
const result = matches.reduce((prev, [ key, values ]) => {
return values.every(Boolean) === true && prev == null ? key : prev
}, undefined)

if (result != null) {
return result
}

if (fallback != null) {
return fallback
}

}

0 comments on commit ec97b7f

Please sign in to comment.