@statoscope/stats-extension-compressed
Advanced tools
Comparing version 5.28.0 to 5.28.1
import { APIFactory } from '@statoscope/extensions'; | ||
import { Format, Size } from './generator'; | ||
export declare type API = (compilationId: string, resourceId: string) => Size | null; | ||
export type API = (compilationId: string, resourceId: string) => Size | null; | ||
declare const makeAPI: APIFactory<Format, API>; | ||
export default makeAPI; |
@@ -5,7 +5,7 @@ /// <reference types="node" /> | ||
import { Extension, ExtensionDescriptor } from '@statoscope/stats/spec/extension'; | ||
export declare type Compressor = string | { | ||
export type Compressor = string | { | ||
name: string; | ||
version: string; | ||
}; | ||
export declare type Size = { | ||
export type Size = { | ||
compressor?: Compressor; | ||
@@ -15,20 +15,20 @@ size: number; | ||
}; | ||
export declare type CompressFunction<TOptions = any> = (source: Buffer | string, filename: string, options?: TOptions) => Size; | ||
export declare type Format = Extension<Payload>; | ||
export declare type Resource = { | ||
export type CompressFunction<TOptions = any> = (source: Buffer | string, filename: string, options?: TOptions) => Size; | ||
export type Format = Extension<Payload>; | ||
export type Resource = { | ||
id: string; | ||
size: Size; | ||
}; | ||
export declare type Compilation = { | ||
export type Compilation = { | ||
id: string; | ||
resources: Array<Resource>; | ||
}; | ||
export declare type Payload = { | ||
export type Payload = { | ||
compilations: Array<Compilation>; | ||
}; | ||
export declare type ResolvedCompressor = { | ||
export type ResolvedCompressor = { | ||
compressor: CompressFunction<unknown>; | ||
params?: unknown; | ||
}; | ||
export declare type CompressorOrPreset = string | ['gzip', ZlibOptions?] | CompressFunction; | ||
export type CompressorOrPreset = string | ['gzip', ZlibOptions?] | CompressFunction; | ||
export default class Generator { | ||
@@ -35,0 +35,0 @@ private adapter?; |
@@ -37,2 +37,3 @@ "use strict"; | ||
this.resolveCompilation = (0, entity_resolver_1.default)(this.payload.compilations, (item) => item.id, null, false); | ||
this.descriptor.adapter = this.adapter; | ||
} | ||
@@ -39,0 +40,0 @@ handleResource(compilationId, resourceId, source, compressor) { |
{ | ||
"name": "@statoscope/stats-extension-compressed", | ||
"version": "5.28.0", | ||
"version": "5.28.1", | ||
"description": "Statoscope extension for collecting compressed resource sizes", | ||
"main": "./dist/index.js", | ||
"scripts": { | ||
"build": "../../node_modules/.bin/tsc", | ||
"prepublishOnly": "npm run build" | ||
"build": "../../node_modules/.bin/tsc" | ||
}, | ||
@@ -21,10 +20,8 @@ "repository": "https://github.com/statoscope/statoscope.git", | ||
"dependencies": { | ||
"@statoscope/helpers": "5.28.0", | ||
"@statoscope/extensions": "5.28.1", | ||
"@statoscope/helpers": "5.28.1", | ||
"@statoscope/stats": "5.28.1", | ||
"gzip-size": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@statoscope/extensions": "5.14.1", | ||
"@statoscope/stats": "5.14.1" | ||
}, | ||
"gitHead": "8593d1728fba7201855ba496eb5c01d28333c60b" | ||
"gitHead": "a89f68a6251a1c914791e22b643dd94ca2a70253" | ||
} |
0
155
8469
4
+ Added@statoscope/stats@5.28.1
+ Added@statoscope/extensions@5.28.1(transitive)
+ Added@statoscope/helpers@5.28.1(transitive)
+ Added@statoscope/stats@5.28.1(transitive)
- Removed@statoscope/helpers@5.28.0(transitive)
Updated@statoscope/helpers@5.28.1