update-browserslist-db 1.0.0 → 1.0.1

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.
Files changed (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +6 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Run update and print output to terminal.
3
3
  */
4
- declare function updateDb(): Promise<void>
4
+ declare function updateDb(print?: (str: string) => void): Promise<void>
5
5
 
6
6
  export = updateDb
package/index.js CHANGED
@@ -15,6 +15,11 @@ function BrowserslistUpdateError(message) {
15
15
 
16
16
  BrowserslistUpdateError.prototype = Error.prototype
17
17
 
18
+ /* c8 ignore next 3 */
19
+ function defaultPrint(str) {
20
+ process.stdout.write(str)
21
+ }
22
+
18
23
  function detectLockfile() {
19
24
  let packageDir = escalade('.', (dir, names) => {
20
25
  return names.indexOf('package.json') !== -1 ? dir : ''
@@ -268,7 +273,7 @@ function updateWith(print, cmd) {
268
273
  } /* c8 ignore end */
269
274
  }
270
275
 
271
- module.exports = function updateDB(print) {
276
+ module.exports = function updateDB(print = defaultPrint) {
272
277
  let lock = detectLockfile()
273
278
  let latest = getLatestInfo(lock)
274
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "update-browserslist-db",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config",
5
5
  "keywords": [
6
6
  "caniuse",