File: index.test-d.ts

package info (click to toggle)
node-gzip-size 6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 160 kB
  • sloc: javascript: 381; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 774 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {expectType} from 'tsd';
import * as fs from 'fs';
import gzipSize = require('.');

expectType<Promise<number>>(gzipSize('foo'));
expectType<Promise<number>>(gzipSize('foo', {chunkSize: 1}));
expectType<number>(gzipSize.sync('foo'));
expectType<number>(gzipSize.sync('foo', {chunkSize: 1}));
const gstream = fs
	.createReadStream('index.d.ts')
	.pipe(gzipSize.stream())
	.pipe(gzipSize.stream({chunkSize: 1}))
	.on('gzip-size', size => expectType<number>(size));
expectType<number | undefined>(gstream.gzipSize);
expectType<Promise<number>>(gzipSize.file('index.d.ts'));
expectType<Promise<number>>(gzipSize.file('index.d.ts', {chunkSize: 1}));
expectType<number>(gzipSize.fileSync('index.d.ts'));
expectType<number>(gzipSize.fileSync('index.d.ts', {chunkSize: 1}));