@microlink/mql 0.10.30 → 0.10.32

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,10 +2,9 @@
2
2
  "name": "@microlink/mql",
3
3
  "description": "Microlink Query Language. The official HTTP client to interact with Microlink API for Node.js, browsers & Deno.",
4
4
  "homepage": "https://nicedoc.io/microlinkhq/mql",
5
- "version": "0.10.30",
5
+ "version": "0.10.32",
6
6
  "browser": "src/browser.js",
7
7
  "main": "src/node.js",
8
- "module": "dist/mql.mjs",
9
8
  "author": {
10
9
  "email": "josefrancisco.verdu@gmail.com",
11
10
  "name": "Kiko Beats",
@@ -46,7 +45,6 @@
46
45
  "dependencies": {
47
46
  "flattie": "~1.1.0",
48
47
  "got": "~11.8.5",
49
- "qss": "~2.0.3",
50
48
  "url-http": "~1.0.7",
51
49
  "whoops": "~4.1.1"
52
50
  },
@@ -94,25 +92,6 @@
94
92
  "lightweight",
95
93
  "src"
96
94
  ],
97
- "scripts": {
98
- "build": "rollup -c rollup.config.js --bundleConfigAsCjs",
99
- "build:kys": "[ -f src/ky.js ] || rollup node_modules/ky/distribution/index.js --format=umd --name=ky --exports=named --file=src/ky.js",
100
- "clean": "rm -rf node_modules",
101
- "clean:build": "rm -rf dist",
102
- "contributors": "(git-authors-cli && finepack --sort-ignore-object-at ava && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
103
- "dev": "npm run build -- -w",
104
- "lint": "standard",
105
- "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
106
- "prebuild": "npm run clean:build && npm run build:kys",
107
- "prerelease": "npm run update:check && npm run contributors",
108
- "pretest": "npm run lint && npm run build",
109
- "release": "standard-version -a",
110
- "release:github": "conventional-github-releaser -p angular",
111
- "release:tags": "git push --follow-tags origin HEAD:master",
112
- "test": "c8 ava --verbose",
113
- "update": "ncu -u",
114
- "update:check": "ncu -- --error-level 2"
115
- },
116
95
  "license": "MIT",
117
96
  "ava": {
118
97
  "files": [
@@ -158,5 +137,24 @@
158
137
  },
159
138
  "types": "index.d.ts",
160
139
  "umd:main": "dist/mql.js",
161
- "unpkg": "dist/mql.js"
162
- }
140
+ "unpkg": "dist/mql.js",
141
+ "scripts": {
142
+ "build": "rollup -c rollup.config.js --bundleConfigAsCjs",
143
+ "build:kys": "[ -f src/ky.js ] || rollup node_modules/ky/distribution/index.js --format=umd --name=ky --exports=named --file=src/ky.js",
144
+ "clean": "rm -rf node_modules",
145
+ "clean:build": "rm -rf dist",
146
+ "contributors": "(npx git-authors-cli && npx finepack --sort-ignore-object-at ava && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
147
+ "dev": "npm run build -- -w",
148
+ "lint": "standard",
149
+ "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
150
+ "prebuild": "npm run clean:build && npm run build:kys",
151
+ "prerelease": "npm run update:check",
152
+ "pretest": "npm run lint && npm run build",
153
+ "release": "standard-version -a",
154
+ "release:github": "conventional-github-releaser -p angular",
155
+ "release:tags": "git push --follow-tags origin HEAD:master",
156
+ "test": "c8 ava --verbose",
157
+ "update": "ncu -u",
158
+ "update:check": "ncu -- --error-level 2"
159
+ }
160
+ }
package/src/browser.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  const urlHttp = require('url-http/lightweight')
4
4
  const { flattie: flatten } = require('flattie')
5
- const { encode: stringify } = require('qss')
6
5
 
7
6
  const factory = require('./factory')
8
7
  const { default: ky } = require('./ky')
@@ -49,7 +48,6 @@ const got = async (url, opts) => {
49
48
  module.exports = factory({
50
49
  MicrolinkError,
51
50
  urlHttp,
52
- stringify,
53
51
  got,
54
52
  flatten,
55
53
  VERSION: '__MQL_VERSION__'
package/src/factory.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const ENDPOINT = {
2
- FREE: 'https://api.microlink.io',
3
- PRO: 'https://pro.microlink.io'
2
+ FREE: 'https://api.microlink.io/',
3
+ PRO: 'https://pro.microlink.io/'
4
4
  }
5
5
 
6
6
  const isObject = input => input !== null && typeof input === 'object'
@@ -102,11 +102,11 @@ const factory = ({
102
102
  const isPro = !!apiKey
103
103
  const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']
104
104
 
105
- const apiUrl = `${apiEndpoint}?${stringify({
105
+ const apiUrl = `${apiEndpoint}?${new URLSearchParams({
106
106
  url,
107
107
  ...mapRules(data),
108
108
  ...flatten(opts)
109
- })}`
109
+ }).toString()}`
110
110
 
111
111
  const headers = isPro
112
112
  ? { ...gotHeaders, 'x-api-key': apiKey }
package/src/node.js CHANGED
@@ -1,7 +1,6 @@
1
1
  module.exports = require('./factory')({
2
2
  MicrolinkError: require('whoops')('MicrolinkError'),
3
3
  urlHttp: require('url-http/lightweight'),
4
- stringify: require('querystring').stringify,
5
4
  got: require('got'),
6
5
  flatten: require('flattie').flattie,
7
6
  VERSION: require('../package.json').version