@microlink/mql 0.10.13 → 0.10.17

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": "@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.13",
5
+ "version": "0.10.17",
6
6
  "browser": "src/browser.js",
7
7
  "main": "src/node.js",
8
8
  "author": {
@@ -19,13 +19,13 @@
19
19
  "name": "ndom91",
20
20
  "email": "yo@ndo.dev"
21
21
  },
22
- {
23
- "name": "Askar Yusupov",
24
- "email": "devex.soft@gmail.com"
25
- },
26
22
  {
27
23
  "name": "Gabe O'Leary",
28
24
  "email": "oleary.gabe@gmail.com"
25
+ },
26
+ {
27
+ "name": "Askar Yusupov",
28
+ "email": "devex.soft@gmail.com"
29
29
  }
30
30
  ],
31
31
  "repository": {
@@ -58,6 +58,7 @@
58
58
  "abort-controller": "latest",
59
59
  "ava": "3",
60
60
  "beauty-error": "latest",
61
+ "c8": "latest",
61
62
  "chalk": "latest",
62
63
  "ci-publish": "latest",
63
64
  "conventional-github-releaser": "latest",
@@ -65,13 +66,11 @@
65
66
  "esm": "latest",
66
67
  "exists-file": "latest",
67
68
  "git-authors-cli": "latest",
68
- "git-dirty": "latest",
69
69
  "ky": "latest",
70
70
  "meow": "latest",
71
71
  "nano-staged": "latest",
72
72
  "node-fetch": "2",
73
73
  "npm-check-updates": "latest",
74
- "nyc": "latest",
75
74
  "prettier-standard": "latest",
76
75
  "rollup": "latest",
77
76
  "rollup-plugin-filesize": "latest",
@@ -97,27 +96,28 @@
97
96
  ],
98
97
  "scripts": {
99
98
  "build": "rollup -c rollup.config.js",
100
- "build:ky": "[ -f src/ky.js ] || rollup node_modules/ky/index.js --format=umd --name=ky --file=src/ky.js",
99
+ "build:ky": "[ -f src/ky.js ] || rollup node_modules/ky/distribution/index.js --format=umd --name=ky --file=src/ky.js",
101
100
  "clean": "rm -rf node_modules",
101
+ "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
102
102
  "dev": "npm run build -- -w",
103
103
  "lint": "standard",
104
- "postrelease": "npm run release:build && npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
105
- "prerelease": "git-dirty && npm run update:check && npm test",
104
+ "postbump": "npm run build",
105
+ "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
106
+ "prerelease": "npm run update:check && npm run contributors",
106
107
  "pretest": "npm run lint && npm run build:ky",
107
- "release": "git-authors-cli && git add package.json && standard-version -a",
108
- "release:build": "npm run build && git add dist/ && git commit -m \"build(no-release): generate bundle\"",
108
+ "release": "standard-version -a",
109
109
  "release:github": "conventional-github-releaser -p angular",
110
- "release:tags": "git push --follow-tags origin master",
111
- "test": "nyc ava --verbose",
110
+ "release:tags": "git push --follow-tags origin HEAD:master",
111
+ "test": "c8 ava --verbose",
112
112
  "update": "ncu -u",
113
113
  "update:check": "ncu -- --error-level 2"
114
114
  },
115
115
  "license": "MIT",
116
116
  "ava": {
117
117
  "files": [
118
- "test/**/*",
119
118
  "!test/browser-globals.js",
120
- "!test/clients.js"
119
+ "!test/clients.js",
120
+ "test/**/*"
121
121
  ],
122
122
  "require": [
123
123
  "esm"
package/src/browser.js CHANGED
@@ -6,7 +6,7 @@ const { encode: stringify } = require('qss')
6
6
  const whoops = require('whoops')
7
7
 
8
8
  const factory = require('./factory')
9
- const ky = require('./ky')
9
+ const { default: ky } = require('./ky')
10
10
 
11
11
  const MicrolinkError = whoops('MicrolinkError')
12
12
 
@@ -22,8 +22,11 @@ const got = async (url, opts) => {
22
22
  const { response } = err
23
23
  err.response = {
24
24
  ...response,
25
- headers: [...response.headers.entries()].reduce(
26
- (acc, [key, value]) => ({ ...acc, [key]: value }),
25
+ headers: Array.from(response.headers.entries()).reduce(
26
+ (acc, [key, value]) => {
27
+ acc[key] = value
28
+ return acc
29
+ },
27
30
  {}
28
31
  ),
29
32
  statusCode: response.status,
package/src/factory.js CHANGED
@@ -47,10 +47,10 @@ const factory = ({
47
47
  const mapRules = rules => {
48
48
  if (!isObject(rules)) return
49
49
  const flatRules = flatten(rules)
50
- return Object.keys(flatRules).reduce(
51
- (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key].toString() }),
52
- {}
53
- )
50
+ return Object.keys(flatRules).reduce((acc, key) => {
51
+ acc[`data.${key}`] = flatRules[key].toString()
52
+ return acc
53
+ }, {})
54
54
  }
55
55
 
56
56
  const fetchFromApi = async (apiUrl, opts = {}, retryCount = 0) => {