diff --git a/index.js b/index.js index 6718031a..d2fd7d1d 100644 --- a/index.js +++ b/index.js @@ -893,7 +893,7 @@ var QUERIES = { }, supports: { matches: ['supportType', 'feature'], - regexp: /^(?:(fully|partially) )?supports\s+([\w-]+)$/, + regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/, select: function (context, node) { env.loadFeature(browserslist.cache, node.feature) var withPartial = node.supportType !== 'fully' diff --git a/test/feature.test.js b/test/feature.test.js index 4ec15a93..208915d4 100644 --- a/test/feature.test.js +++ b/test/feature.test.js @@ -72,6 +72,12 @@ test('selects browsers by feature, including partial support', () => { 'chrome 82', 'chrome 81' ]) + + equal(browserslist('partially supports rtcpeerconnection'), [ + 'and_chr 81', + 'chrome 82', + 'chrome 81' + ]) }) test('selects browsers by feature, omiting partial support', () => { @@ -85,6 +91,11 @@ test('selects browsers by feature, omiting partial support', () => { 'and_chr 81', 'chrome 82' ]) + + equal(browserslist('fully supports rtcpeerconnection'), [ + 'and_chr 81', + 'chrome 82' + ]) }) test('selects browsers by feature with dashes in its name', () => {