@microlink/ping-url 1.3.25 → 1.4.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.
File without changes
package/README.md CHANGED
@@ -46,24 +46,21 @@ The payload returned by `pingUrl` will be `response` but without any stream obje
46
46
 
47
47
  ## API
48
48
 
49
- ### pingUrl([keyvOptions], [memoizeOptions])
49
+ ### createPingUrl([keyvOptions], [memoOpts]) → pingUrl(url, [gotOpts])
50
50
 
51
51
  #### keyvOptions
52
52
 
53
53
  See [`keyv#options`](https://www.npmjs.com/package/keyv#new-keyvuri-options).
54
54
 
55
- #### memoizeOptions
55
+ #### memoOpts
56
56
 
57
57
  See [`@keyvhq/memoize`](https://github.com/microlinkhq/keyv/tree/master/packages/memoize).
58
58
 
59
- Additionally, you can setup:
59
+ #### gotOpts
60
60
 
61
- ##### decorate
61
+ Type: `object`
62
62
 
63
- Type: `function`<br/>
64
- Default: `lodash.identity`
65
-
66
- Setup a function to be executed before save the content into the store.
63
+ Any option provided here will passed to [got#options](https://github.com/sindresorhus/got#options).
67
64
 
68
65
  ## License
69
66
 
package/index.js CHANGED
@@ -1,14 +1,10 @@
1
1
  'use strict'
2
2
 
3
- const { identity, omitBy } = require('lodash')
4
3
  const reachableUrl = require('reachable-url')
5
4
  const memoize = require('@keyvhq/memoize')
6
5
  const isStream = require('is-stream')
6
+ const { omitBy } = require('lodash')
7
7
 
8
- const pingUrl = decorate => async (...args) =>
9
- decorate(omitBy(await reachableUrl(...args), isStream))
8
+ const pingUrl = async (...args) => omitBy(await reachableUrl(...args), isStream)
10
9
 
11
- module.exports = (keyOpts, { decorate = identity, ...memOpts } = {}) =>
12
- memoize(pingUrl(decorate), keyOpts, {
13
- ...memOpts
14
- })
10
+ module.exports = (keyOpts, memoOpts) => memoize(pingUrl, keyOpts, memoOpts)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@microlink/ping-url",
3
3
  "description": "Fast DNS resolution caching results for a while.",
4
4
  "homepage": "https://nicedoc.io/microlinkhq/ping-url",
5
- "version": "1.3.25",
5
+ "version": "1.4.0",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",