Skip to content

Commit e059ee4

Browse files
authored
Merge pull request #110 from chantouchsek/feat/upgrade-depedencies
Upgrade dependencies
2 parents 93e8c8f + eb6e360 commit e059ee4

File tree

12 files changed

+1247
-1244
lines changed

12 files changed

+1247
-1244
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
language: node_js
22
node_js:
3-
- 12
3+
- 16

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-api-queries",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Elegant and simple way to build requests for REST API",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
1414
"watch": "tsc -w",
1515
"start": "yarn link && nodemon",
1616
"semantic-release": "semantic-release",
17-
"prepublish": "yarn build",
17+
"prepublish": "yarn test && yarn build",
1818
"clean": "rimraf dist",
1919
"prepare": "husky install"
2020
},
@@ -43,40 +43,40 @@
4343
"devDependencies": {
4444
"@commitlint/cli": "^13.1.0",
4545
"@commitlint/config-conventional": "^13.1.0",
46-
"@nuxt/types": "^2.14.7",
46+
"@nuxt/types": "^2.15.8",
4747
"@types/escape-string-regexp": "^2.0.1",
48-
"@types/jest": "^26.0.14",
48+
"@types/jest": "^27.0.1",
4949
"@types/lodash.merge": "^4.6.6",
50-
"@types/node": "^16.7.10",
50+
"@types/node": "^16.9.3",
5151
"@types/qs": "^6.9.7",
52-
"@typescript-eslint/eslint-plugin": "^4.15.1",
53-
"@typescript-eslint/parser": "^4.4.1",
52+
"@typescript-eslint/eslint-plugin": "^4.31.1",
53+
"@typescript-eslint/parser": "^4.31.1",
5454
"@vue/test-utils": "^1.2.2",
55-
"axios": "^0.21.1",
56-
"axios-mock-adapter": "^1.18.2",
57-
"eslint": "^7.2.0",
58-
"eslint-config-prettier": "^6.13.0",
59-
"eslint-plugin-import": "^2.22.1",
60-
"eslint-plugin-prettier": "^3.1.4",
61-
"eslint-plugin-promise": "^4.3.1",
62-
"husky": "^7.0.1",
63-
"jest": "^27.0.6",
64-
"nodemon": "^2.0.5",
65-
"nuxt": "^2.15.7",
66-
"prettier": "^2.1.2",
55+
"axios": "^0.21.4",
56+
"axios-mock-adapter": "^1.20.0",
57+
"eslint": "^7.32.0",
58+
"eslint-config-prettier": "^7.2.0",
59+
"eslint-plugin-import": "^2.24.2",
60+
"eslint-plugin-prettier": "^4.0.0",
61+
"eslint-plugin-promise": "^5.1.0",
62+
"husky": "^7.0.2",
63+
"jest": "^27.2.0",
64+
"nodemon": "^2.0.12",
65+
"nuxt": "^2.15.8",
66+
"prettier": "^2.4.1",
6767
"rimraf": "^3.0.2",
68-
"semantic-release": "^17.2.1",
69-
"ts-jest": "^27.0.4",
70-
"typescript": "^4.3.5"
68+
"semantic-release": "^18.0.0",
69+
"ts-jest": "^27.0.5",
70+
"typescript": "^4.4.3"
7171
},
7272
"files": [
7373
"dist",
7474
"nuxt"
7575
],
7676
"dependencies": {
77-
"camelcase-keys": "^6.2.2",
77+
"camelcase-keys": "^7.0.0",
7878
"lodash.merge": "^4.6.2",
79-
"qs": "^6.9.6",
80-
"snakecase-keys": "^4.0.2"
79+
"qs": "^6.10.1",
80+
"snakecase-keys": "^5.0.0"
8181
}
8282
}

src/__tests__/base-proxy.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ describe('BaseProxy', () => {
2727
try {
2828
await proxy.getMany()
2929
} catch (e) {
30-
expect(e.message).toBe('Vue Api Queries, No http library provided.')
30+
const { message } = e as any
31+
expect(message).toBe('Vue Api Queries, No http library provided.')
3132
}
3233
})
3334

@@ -94,7 +95,8 @@ describe('BaseProxy', () => {
9495
try {
9596
await proxy.all()
9697
} catch (e) {
97-
expect(e.message).toBe('Network Error')
98+
const { message } = e as any
99+
expect(message).toBe('Network Error')
98100
}
99101
})
100102

@@ -307,7 +309,8 @@ describe('BaseProxy', () => {
307309
try {
308310
await proxy.post(item)
309311
} catch (e) {
310-
expect(e.message).toBe('Request failed with status code 422')
312+
const { message } = e as any
313+
expect(message).toBe('Request failed with status code 422')
311314
}
312315
expect(validator.has('first_name')).toBeTruthy()
313316
})

src/__tests__/package.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import Vue from 'vue'
22
import VueApiQueries from '../'
3-
import {
4-
sleep,
5-
addElemWithDataAppToBody,
6-
disableTransitions,
7-
} from '../util/createDom'
3+
import { addElemWithDataAppToBody, disableTransitions, sleep } from '../util'
84
import { mount } from '@vue/test-utils'
95

106
describe('Vue Api Queries', () => {

src/core/BaseProxy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import {
77
} from 'axios'
88
import type { Errors } from '..'
99
import Validator from './Validator'
10-
import { hasFiles, objectToFormData } from '../util/formData'
10+
import { hasFiles, objectToFormData, removeDoubleSlash } from '../util'
1111
import qs, { ParsedQs } from 'qs'
12-
import { removeDoubleSlash } from '../util/string'
1312

1413
const validator = Validator
1514
const UNPROCESSABLE_ENTITY = 422

src/core/BaseTransformer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class BaseTransformer {
1313
return items.map((item: T) => this.send(item, snakeKey))
1414
}
1515

16-
static fetch<T>(item: T, camelKey?: boolean) {
16+
static fetch<T extends Record<string, any>>(
17+
item: T,
18+
camelKey?: boolean,
19+
): T | any {
1720
return camelKey ? camelcaseKeys(item, { deep: true }) : item
1821
}
1922

src/core/Validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { is, isArray } from '../util/objects'
1+
import { is, isArray } from '../util'
22

33
class Validator {
44
public errors: any

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ export {
3333
PaginationTransformer,
3434
BaseProxy as BaseService,
3535
}
36+
export * from './util'
3637
export default new VueApiQueries()

src/util/createDom.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import { createWrapper } from '@vue/test-utils'
22

3-
export function sleep(ms: number) {
4-
return new Promise((resolve) => {
5-
setTimeout(resolve, ms)
6-
})
7-
}
8-
93
export function wrap(vm: any) {
104
return createWrapper(vm, {
115
attachedToDocument: true,

src/util/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './createDom'
2+
export * from './formData'
3+
export * from './objects'
4+
export * from './promise'
5+
export * from './string'

0 commit comments

Comments
 (0)