oembed-spec 1.3.18 → 1.3.21

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
@@ -1,12 +1,11 @@
1
1
  <div align="center">
2
2
  <img src="https://cdn.microlink.io/logo/banner.png" alt="microlink logo">
3
+ <br>
4
+ <br>
3
5
  </div>
4
6
 
5
7
  ![Last version](https://img.shields.io/github/tag/microlinkhq/oembed-spec.svg?style=flat-square)
6
- [![Build Status](https://img.shields.io/travis/com/microlinkhq/oembed-spec/master.svg?style=flat-square)](https://travis-ci.com/microlinkhq/oembed-spec)
7
8
  [![Coverage Status](https://img.shields.io/coveralls/microlinkhq/oembed-spec.svg?style=flat-square)](https://coveralls.io/github/microlinkhq/oembed-spec)
8
- [![Dependency status](https://img.shields.io/david/microlinkhq/oembed-spec.svg?style=flat-square)](https://david-dm.org/microlinkhq/oembed-spec)
9
- [![Dev Dependencies Status](https://img.shields.io/david/dev/microlinkhq/oembed-spec.svg?style=flat-square)](https://david-dm.org/microlinkhq/oembed-spec#info=devDependencies)
10
9
  [![NPM Status](https://img.shields.io/npm/dm/oembed-spec.svg?style=flat-square)](https://www.npmjs.org/package/oembed-spec)
11
10
 
12
11
  > A parser for oEmbed specification.
@@ -56,7 +55,7 @@ oEmbed('http://www.youtu.be/I8u2NdWuaYs', { maxheight: 612 })
56
55
 
57
56
  ## API
58
57
 
59
- ### oEmbed(input, [options])
58
+ ### oEmbed(input, [options], [gotOpts])
60
59
 
61
60
  #### input
62
61
 
@@ -69,17 +68,21 @@ A valid WHATWG URL.
69
68
 
70
69
  Any option present will be passed against the consumer request (see [oembed.com](https://oembed.com) section 2.2).
71
70
 
71
+ #### gotOpts
72
+
73
+ Any option present will be passed to [got](https://github.com/sindresorhus/got).
74
+
72
75
  ### .findProvider(url)
73
76
 
74
77
  Standalone method for finding a provider.
75
78
 
76
- ### .fetchProvider(provider, url, opts)
79
+ ### .fetchProvider(provider, url, [opts], [gotOpts])
77
80
 
78
81
  Standalone method for fetching an specific provider.
79
82
 
80
83
  ## License
81
84
 
82
85
  **oembed-spec** © [microlink.io](https://microlink.io), released under the [MIT](https://github.com/microlinkhq/oembed-spec/blob/master/LICENSE) License.<br>
83
- Authored and maintained by [microlink.io](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/oembed-spec/contributors).
86
+ Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/microlinkhq/oembed-spec/contributors).
84
87
 
85
88
  > [microlink.io](https://microlink.io) · GitHub [microlink.io](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "oembed-spec",
3
3
  "description": "A parser for oEmbed specification",
4
4
  "homepage": "https://nicedoc.io/microlinkhq/oembed-spec",
5
- "version": "1.3.18",
5
+ "version": "1.3.21",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -13,10 +13,6 @@
13
13
  {
14
14
  "name": "Kiko Beats",
15
15
  "email": "josefrancisco.verdu@gmail.com"
16
- },
17
- {
18
- "name": "Rémi Berson",
19
- "email": "remi@cliqz.com"
20
16
  }
21
17
  ],
22
18
  "repository": {
@@ -32,8 +28,8 @@
32
28
  "spec"
33
29
  ],
34
30
  "dependencies": {
35
- "got": "~11.8.0",
36
- "tldts": "~5.6.60"
31
+ "got": "~11.8.1",
32
+ "tldts": "~5.7.0"
37
33
  },
38
34
  "devDependencies": {
39
35
  "@commitlint/cli": "latest",
@@ -42,20 +38,17 @@
42
38
  "ava": "latest",
43
39
  "benchmark": "latest",
44
40
  "big-list-of-naughty-strings": "latest",
41
+ "c8": "latest",
45
42
  "chalk": "latest",
46
43
  "ci-publish": "latest",
47
44
  "conventional-github-releaser": "latest",
48
- "coveralls": "latest",
49
45
  "finepack": "latest",
50
46
  "git-authors-cli": "latest",
51
- "git-dirty": "latest",
52
- "husky": "latest",
53
- "lint-staged": "latest",
54
- "nanobench": "latest",
47
+ "nano-staged": "latest",
55
48
  "npm-check-updates": "latest",
56
- "nyc": "latest",
57
49
  "oembed-parser": "latest",
58
50
  "prettier-standard": "latest",
51
+ "simple-git-hooks": "latest",
59
52
  "standard": "latest",
60
53
  "standard-markdown": "latest",
61
54
  "standard-version": "latest"
@@ -71,40 +64,43 @@
71
64
  "benchmark": "node ./benchmarks/benchmark.js",
72
65
  "clean": "rm -rf node_modules",
73
66
  "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
74
- "coverage": "nyc report --reporter=text-lcov | coveralls",
75
67
  "lint": "standard-markdown README.md && standard",
76
68
  "postinstall": "node scripts/postinstall.js",
77
- "postrelease": "npm run release:tags && npm run release:github && ci-publish",
69
+ "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
78
70
  "prerelease": "npm run update:check && npm run contributors",
79
71
  "pretest": "npm run lint",
80
72
  "release": "standard-version -a",
81
73
  "release:github": "conventional-github-releaser -p angular",
82
74
  "release:tags": "git push --follow-tags origin HEAD:master",
83
- "test": "nyc ava test/index.js test/find-provider/*.js test/providers/*.js",
75
+ "test": "c8 ava",
84
76
  "update": "ncu -u",
85
77
  "update:check": "ncu -- --error-level 2"
86
78
  },
87
79
  "license": "MIT",
80
+ "ava": {
81
+ "files": [
82
+ "!test/helpers/**/*",
83
+ "test/**/*"
84
+ ]
85
+ },
88
86
  "commitlint": {
89
87
  "extends": [
90
88
  "@commitlint/config-conventional"
91
89
  ]
92
90
  },
93
- "husky": {
94
- "hooks": {
95
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
96
- "pre-commit": "lint-staged"
97
- }
98
- },
99
- "lint-staged": {
100
- "package.json": [
101
- "finepack"
102
- ],
91
+ "nano-staged": {
103
92
  "*.js": [
104
93
  "prettier-standard"
105
94
  ],
106
95
  "*.md": [
107
96
  "standard-markdown"
97
+ ],
98
+ "package.json": [
99
+ "finepack --sort-ignore-object-at ava"
108
100
  ]
101
+ },
102
+ "simple-git-hooks": {
103
+ "commit-msg": "npx commitlint --edit",
104
+ "pre-commit": "npx nano-staged"
109
105
  }
110
106
  }
package/src/index.js CHANGED
@@ -20,9 +20,11 @@ const fetchProvider = async (provider, url, opts = {}, gotOpts = {}) => {
20
20
  return body
21
21
  }
22
22
 
23
- module.exports = async (url, opts) => {
23
+ module.exports = async (url, opts, gotOpts) => {
24
24
  const provider = findProvider(url)
25
- return provider !== undefined ? fetchProvider(provider, url, opts) : undefined
25
+ return provider !== undefined
26
+ ? fetchProvider(provider, url, opts, gotOpts)
27
+ : undefined
26
28
  }
27
29
 
28
30
  module.exports.findProvider = findProvider