baseline-browser-mapping 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,20 +44,14 @@ Updating this module and `@mdn/browser-compat-data` regularly is recommended to
44
44
 
45
45
  ## Usage
46
46
 
47
- ### Import the module
48
-
49
- First, import the module:
50
-
51
- ```javascript
52
- import baselineBrowserMapping from "baseline-browser-mapping";
53
- ```
54
-
55
47
  ### Get Baseline Widely Available browser versions
56
48
 
57
49
  To get the current list of minimum browser versions compatible with Baseline Widely Available features from the core browser set, call the `getMinimumWidelyAvailable` method:
58
50
 
59
51
  ```javascript
60
- baselineBrowserMapping.getMinimumWidelyAvailable();
52
+ import { getMinimumWidelyAvailable } from "baseline-browser-mapping";
53
+
54
+ getMinimumWidelyAvailable();
61
55
  ```
62
56
 
63
57
  Executed on 29th November 2024, the above code returns the final version of each core browser released on or before 24th May 2022 i.e. 30 months before the date of execution:
@@ -116,10 +110,12 @@ Executed on 29th November 2024, the above code returns the final version of each
116
110
  ];
117
111
  ```
118
112
 
119
- If you need a list of _all_ compatible versions, you can call:
113
+ If you need a list of _all_ compatible versions, you can import and call:
120
114
 
121
115
  ```javascript
122
- baselineBrowserMapping.getAllWidelyAvailable();
116
+ import { getMinimumWidelyAvailable } from "baseline-browser-mapping";
117
+
118
+ getAllWidelyAvailable();
123
119
  ```
124
120
 
125
121
  ### Get Baseline Widely Available compatible browser versions as of a specific date
@@ -127,17 +123,37 @@ baselineBrowserMapping.getAllWidelyAvailable();
127
123
  To get the minimum browser versions that supported Baseline Widely Available on a specific date, call `getMinimumWidelyAvailableOnDate` or `geAllWidelyAvailableOnDate`, passing the desired date in the format `YYYY-MM-DD`:
128
124
 
129
125
  ```javascript
130
- baselineBrowserMapping.getMinimumWidelyAvailableOnDate("2021-03-19");
126
+ import { getMinimumWidelyAvailableOnDate } from "baseline-browser-mapping";
127
+
128
+ getMinimumWidelyAvailableOnDate("2021-03-19");
131
129
  ```
132
130
 
133
131
  This would return the final version of each core browser released on or before 19th September 2018 i.e. 30 months before 19th March 2021.
134
132
 
133
+ If you need a list of _all_ compatible versions, you can import and call:
134
+
135
+ ```javascript
136
+ import { getAllWidelyAvailableOnDate } from "baseline-browser-mapping";
137
+
138
+ getAllWidelyAvailableOnDate("2021-03-19");
139
+ ```
140
+
135
141
  ### Get Baseline year compatible browser versions
136
142
 
137
143
  To get the list of browser versions that support a particular year's Baseline feature set, call `getMinimumByYear` or `getAllByYear` passing the desired year in the format YYYY:
138
144
 
139
145
  ```javascript
140
- baselineBrowserMapping.getMinimumByYear("2020");
146
+ import { getMinimumByYear } from "baseline-browser-mapping";
147
+
148
+ getMinimumByYear("2020");
149
+ ```
150
+
151
+ If you need a list of _all_ compatible versions, you can import and call:
152
+
153
+ ```javascript
154
+ import { getAllByYear } from "baseline-browser-mapping";
155
+
156
+ getAllByYear("2020");
141
157
  ```
142
158
 
143
159
  ### Including downstreambrowsers
@@ -145,11 +161,11 @@ baselineBrowserMapping.getMinimumByYear("2020");
145
161
  Each of the methods above can take an optional final boolean parameter `includeDownstream`. The default for this in all functions is `false`. To include downstream browsers, pass `true` as the final parameter when you call the function:
146
162
 
147
163
  ```javascript
148
- baselineBrowserMapping.getAllWidelyAvailable(true)
164
+ getAllWidelyAvailable(true)
149
165
 
150
- baselineBrowserMapping.getMinimumWidelyAvailableOnDate('2021-03-19' true)
166
+ getMinimumWidelyAvailableOnDate('2021-03-19' true)
151
167
 
152
- baselineBrowserMapping.getMinimumByYear('2020', true)
168
+ getMinimumByYear('2020', true)
153
169
  ```
154
170
 
155
171
  Passing `true` will include the appropriate versions of the browsers listed as "Core" = `false` below.
@@ -170,11 +186,11 @@ Passing `true` will include the appropriate versions of the browsers listed as "
170
186
  | Samsung Internet | `samsunginternet_android` | `false` | MDN `browser-compat-data` |
171
187
  | WebView Android | `webview_android` | `false` | MDN `browser-compat-data` |
172
188
  | QQ Browser Mobile | `qq_android` | `false` | useragents.io |
173
- | UC Browser Mobile | `UC_android` | `false` | useragents.io |
189
+ | UC Browser Mobile | `uc_android` | `false` | useragents.io |
174
190
  | Yandex Browser Mobile | `ya_android` | `false` | useragents.io |
175
191
 
176
192
  > **Note**
177
- > All the non-core browsers currently included implement Chromium. Their inclusion in any of the above functions is based on the Baseline feature set supported by the Chromium version they implement, not their release date.
193
+ > All the non-core browsers currently included implement Chromium. Their inclusion in any of the above methods is based on the Baseline feature set supported by the Chromium version they implement, not their release date.
178
194
 
179
195
  ## Helping out and getting help
180
196
 
@@ -118,7 +118,7 @@ const getDownstreamBrowsers = (inputArray = [], minOnly = true) => {
118
118
  if (versionData.engine != "Blink") {
119
119
  return false;
120
120
  }
121
- if (compareVersions(versionData.engine_version, minimumChromeVersion) == 0) {
121
+ if (parseInt(versionData.engine_version) < parseInt(minimumChromeVersion)) {
122
122
  return false;
123
123
  }
124
124
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseline-browser-mapping",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A library for obtaining browser versions with their maximum supported Baseline feature set and Widely Available status.",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"