@browserless/goto 10.8.0-beta.4 → 10.9.0

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/goto",
3
3
  "description": "Go to a page aborting unnecessary requests",
4
4
  "homepage": "https://browserless.js.org/#/?id=gotopage-options",
5
- "version": "10.8.0-beta.4",
5
+ "version": "10.9.0",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -31,18 +31,16 @@
31
31
  "dependencies": {
32
32
  "@browserless/devices": "^10.7.13",
33
33
  "@ghostery/adblocker-puppeteer": "~2.11.3",
34
- "@kikobeats/time-span": "~1.0.8",
35
34
  "debug-logfmt": "~1.4.0",
36
35
  "got": "~11.8.6",
37
36
  "is-url-http": "~2.3.10",
38
37
  "p-reflect": "~2.1.0",
39
38
  "p-timeout": "~4.1.0",
40
- "pretty-ms": "~7.0.1",
41
39
  "shallow-equal": "~3.1.0",
42
40
  "tough-cookie": "~6.0.0"
43
41
  },
44
42
  "devDependencies": {
45
- "@browserless/test": "^10.7.13",
43
+ "@browserless/test": "^10.9.0",
46
44
  "ava": "5",
47
45
  "p-wait-for": "3"
48
46
  },
@@ -66,5 +64,5 @@
66
64
  "timeout": "2m",
67
65
  "workerThreads": false
68
66
  },
69
- "gitHead": "1661cb17734e79e9b9b0e35b5e0ea5cda7df4f08"
67
+ "gitHead": "d3843b489f96c2b52af786a8740ab2a47d7e7125"
70
68
  }
package/src/engine.bin CHANGED
Binary file
package/src/index.js CHANGED
@@ -11,8 +11,6 @@ const isUrl = require('is-url-http')
11
11
  const path = require('path')
12
12
  const fs = require('fs')
13
13
 
14
- const timeSpan = require('@kikobeats/time-span')({ format: require('pretty-ms') })
15
-
16
14
  const { DEFAULT_INTERCEPT_RESOLUTION_PRIORITY } = require('puppeteer')
17
15
 
18
16
  const debug = require('debug-logfmt')('browserless:goto')
@@ -34,11 +32,10 @@ const isEmpty = val => val == null || !(Object.keys(val) || val).length
34
32
  const castArray = value => [].concat(value).filter(Boolean)
35
33
 
36
34
  const run = async ({ fn, timeout, debug: props }) => {
37
- const debugProps = { duration: timeSpan() }
35
+ const duration = debug.duration()
38
36
  const result = await pReflect(timeout ? pTimeout(fn, timeout) : fn)
39
- debugProps.duration = debugProps.duration()
40
- if (result.isRejected) debugProps.error = result.reason.message || result.reason
41
- debug(props, debugProps)
37
+ const errorProps = result.isRejected ? { error: result.reason.message || result.reason } : {}
38
+ duration(props, errorProps)
42
39
  return result
43
40
  }
44
41