Skip to content

Commit

Permalink
fix: removed iltorb dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Dec 1, 2021
1 parent e0493d8 commit e76ec7c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 189 deletions.
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@
"dist/"
],
"devDependencies": {
"@types/ioredis": "^4.22.0",
"@types/iltorb": "^2.3.2",
"@types/express": "^4.17.11",
"@types/lodash": "^4.14.168",
"@babel/cli": "^7.13.0",
"@babel/core": "^7.13.8",
"@babel/node": "^7.13.0",
"@babel/plugin-transform-runtime": "^7.13.9",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.13.9",
"@babel/preset-env": "^7.13.9",
"@babel/preset-typescript": "^7.13.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.2.0",
"@semantic-release/npm": "^7.0.9",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/express": "^4.17.11",
"@types/iltorb": "^2.3.2",
"@types/ioredis": "^4.22.0",
"@types/lodash": "^4.14.168",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"babel-eslint": "^10.1.0",
"babel-plugin-lodash": "^3.3.4",
"body-parser": "^1.19.0",
"cross-env": "^7.0.3",
"eslint": "^7.21.0",
"@typescript-eslint/parser": "^4.25.0",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.3",
"express": "^4.17.1",
"prettier": "^2.3.0",
"rimraf": "^3.0.2",
"semantic-release": "^17.4.3",
"typescript": "^4.3.2",
"@babel/preset-typescript": "^7.13.0",
"prettier": "^2.3.0",
"eslint-config-prettier": "^8.3.0",
"babel-plugin-lodash": "^3.3.4",
"cross-env": "^7.0.3"
"typescript": "^4.3.2"
},
"scripts": {
"prepare": "yarn run build:clean && yarn run build:lib && yarn run build:lib:browser && yarn run build:types",
Expand Down Expand Up @@ -80,12 +80,11 @@
"ssri": "^8.0.1"
},
"dependencies": {
"apollo-link": "^1.2.14",
"@babel/polyfill": "^7.12.1",
"apollo-link": "^1.2.14",
"apollo-utilities": "^1.3.4",
"graphql": "^14.5.8",
"http-proxy-middleware": "^2.0.0",
"iltorb": "^2.4.5",
"lodash": "^4.17.21"
},
"engines": {
Expand Down
10 changes: 1 addition & 9 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import zlib from 'zlib'
import type EventEmitter from 'events'
import type { IncomingMessage } from 'http'
import { decompressStream } from 'iltorb'

export async function stream<T extends EventEmitter>(data: T) {
const thisBuffer = [] as string[]
Expand All @@ -19,8 +18,6 @@ export async function stream<T extends EventEmitter>(data: T) {
}) as Promise<string>
}

const supportsBrotli = typeof zlib.createBrotliDecompress === 'function'

export async function decode(request: IncomingMessage) {
const encoding = (request.headers['content-encoding'] || '')
.trim()
Expand All @@ -31,12 +28,7 @@ export async function decode(request: IncomingMessage) {
} else if (encoding === 'deflate') {
decoder = zlib.createInflate()
} else if (encoding === 'br') {
if (supportsBrotli) {
// $FlowFixMe: ignore, supported from node v11
decoder = zlib.createBrotliDecompress()
} else {
decoder = decompressStream()
}
decoder = zlib.createBrotliDecompress()
}

if (decoder) {
Expand Down
Loading

0 comments on commit e76ec7c

Please sign in to comment.