-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump the all-dependencies group with 3 updates (#408)
* Bump the all-dependencies group with 3 updates Bumps the all-dependencies group with 3 updates: [@mdn/browser-compat-data](https://github.com/mdn/browser-compat-data), [semver](https://github.com/npm/node-semver) and [web-features](https://github.com/web-platform-dx/web-features). Updates `@mdn/browser-compat-data` from 5.5.39 to 5.5.40 - [Release notes](https://github.com/mdn/browser-compat-data/releases) - [Changelog](https://github.com/mdn/browser-compat-data/blob/main/RELEASE_NOTES.md) - [Commits](mdn/browser-compat-data@v5.5.39...v5.5.40) Updates `semver` from 7.6.2 to 7.6.3 - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](npm/node-semver@v7.6.2...v7.6.3) Updates `web-features` from 0.10.0 to 1.0.0 - [Release notes](https://github.com/web-platform-dx/web-features/releases) - [Commits](web-platform-dx/web-features@v0.10.0...v1.0.0) --- updated-dependencies: - dependency-name: "@mdn/browser-compat-data" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: semver dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: web-features dependency-type: direct:development update-type: version-update:semver-major dependency-group: all-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> * refine the interop algorithm --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Romain Menke <[email protected]>
- Loading branch information
1 parent
e34f5f2
commit 579ff53
Showing
8 changed files
with
104 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const MDNToBrowserlistMap = { | ||
chrome_android: 'and_chr', | ||
safari_ios: 'ios_saf', | ||
firefox_android: 'and_ff', | ||
opera_android: 'op_mob', | ||
samsunginternet_android: 'samsung', | ||
webview_android: 'android', | ||
}; | ||
|
||
export function MDNToBrowserlist(browser) { | ||
return MDNToBrowserlistMap[browser] || browser; | ||
} | ||
|
||
export const BrowserslistToMDNMap = { | ||
and_chr: 'chrome_android', | ||
ios_saf: 'safari_ios', | ||
and_ff: 'firefox_android', | ||
op_mob: 'opera_android', | ||
samsung: 'samsunginternet_android', | ||
android: 'webview_android', | ||
}; | ||
|
||
export function BrowserslistToMDN(browser) { | ||
return BrowserslistToMDNMap[browser] || browser; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import bcd from '@mdn/browser-compat-data' assert { type: 'json' }; | ||
import semver from 'semver'; | ||
|
||
export function scanForNextBrowserVersionWithReleaseDate(browser, version, cb) { | ||
if (!browser || !version) { | ||
return; | ||
} | ||
|
||
{ | ||
const result = cb(browser, version); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
|
||
const versionNames = Object.keys(bcd.browsers?.[browser]?.releases); | ||
const thisVersion = semver.coerce(version); | ||
const thisVersionOrLater = versionNames.find(v => { | ||
return semver.gte(semver.coerce(v), thisVersion); | ||
}); | ||
const thisVersionIndex = versionNames.indexOf(thisVersionOrLater); | ||
if (thisVersionIndex === -1) { | ||
return; | ||
} | ||
|
||
for (let i = 1; i < 10; i++) { | ||
const result = cb(browser, version); | ||
if (result) { | ||
return result; | ||
} | ||
|
||
version = versionNames[thisVersionIndex + i]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters