Skip to content

Commit

Permalink
build(deps-dev): replace standard with neostandard (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Dec 5, 2024
1 parent 52a7285 commit bf8ee8b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![CI](https://github.com/fastify/fastify-compress/workflows/CI/badge.svg)
[![NPM version](https://img.shields.io/npm/v/@fastify/compress.svg?style=flat)](https://www.npmjs.com/package/@fastify/compress)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)

Adds compression utils to [the Fastify `reply` object](https://fastify.dev/docs/latest/Reference/Reply/#reply) and a hook to decompress requests payloads.
Supports `gzip`, `deflate`, and `brotli`.
Expand Down
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict'

module.exports = require('neostandard')({
ignores: require('neostandard').resolveIgnoresFromGitignore(),
ts: true
})
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@
"devDependencies": {
"@fastify/pre-commit": "^2.1.0",
"@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"adm-zip": "^0.5.12",
"c8": "^10.1.2",
"fastify": "^5.0.0",
"jsonstream": "^1.0.3",
"standard": "^17.1.0",
"neostandard": "^0.11.9",
"tsd": "^0.31.0",
"typescript": "~5.7.2"
},
"scripts": {
"lint": "standard",
"lint:fix": "npm run lint -- --fix",
"lint:fix:typescript": "npm run lint:fix -- --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin \"**/*.d.ts\"",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:typescript",
"test:typescript": "tsd",
"test:unit": "node --test",
Expand Down
15 changes: 8 additions & 7 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
RouteOptions as FastifyRouteOptions,
RawServerBase,
RawServerDefault
} from 'fastify';
import { Stream } from 'stream';
import { BrotliOptions, ZlibOptions } from 'zlib';
} from 'fastify'
import { Stream } from 'stream'
import { BrotliOptions, ZlibOptions } from 'zlib'

declare module 'fastify' {
export interface FastifyContextConfig {
Expand All @@ -18,6 +18,7 @@ declare module 'fastify' {
}

export interface RouteShorthandOptions<
// eslint-disable-next-line @typescript-eslint/no-unused-vars
RawServer extends RawServerBase = RawServerDefault
> {
compress?: RouteCompressOptions | false;
Expand Down Expand Up @@ -56,17 +57,17 @@ type RouteDecompressOptions = Pick<fastifyCompress.FastifyCompressOptions,
| 'zlib'
>

type EncodingToken = 'br' | 'deflate' | 'gzip' | 'identity';
type EncodingToken = 'br' | 'deflate' | 'gzip' | 'identity'

type CompressibleContentTypeFunction = (contentType: string) => boolean;
type CompressibleContentTypeFunction = (contentType: string) => boolean

type Input =
| Buffer
| NodeJS.TypedArray
| ArrayBuffer
| string
| Iterable<Buffer | string>
| AsyncIterable<Buffer | string>;
| AsyncIterable<Buffer | string>

declare namespace fastifyCompress {

Expand Down Expand Up @@ -105,5 +106,5 @@ declare namespace fastifyCompress {
export { fastifyCompress as default }
}

declare function fastifyCompress(...params: Parameters<FastifyCompress>): ReturnType<FastifyCompress>
declare function fastifyCompress (...params: Parameters<FastifyCompress>): ReturnType<FastifyCompress>
export = fastifyCompress
2 changes: 1 addition & 1 deletion types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const stream = createReadStream('./package.json')
const withGlobalOptions: FastifyCompressOptions = {
global: true,
threshold: 10,
zlib: zlib,
zlib,
brotliOptions: {
params: {
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
Expand Down

0 comments on commit bf8ee8b

Please sign in to comment.