Skip to content

Commit b8dcd04

Browse files
committed
compressedSize => getCompressedSize
1 parent 3f183c2 commit b8dcd04

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/analyzer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Logger = require('./Logger');
77
const Folder = require('./tree/Folder').default;
88
const {parseBundle} = require('./parseUtils');
99
const {createAssetsFilter} = require('./utils');
10-
const {compressedSize} = require('./sizeUtils');
10+
const {getCompressedSize} = require('./sizeUtils');
1111

1212
const FILENAME_QUERY_REGEXP = /\?.*$/u;
1313
const FILENAME_EXTENSIONS = /\.(js|mjs)$/iu;
@@ -103,7 +103,7 @@ function getViewerData(bundleStats, bundleDir, opts) {
103103

104104
if (assetSources) {
105105
asset.parsedSize = Buffer.byteLength(assetSources.src);
106-
asset[`${compressionAlgorithm}Size`] = compressedSize(compressionAlgorithm, assetSources.src);
106+
asset[`${compressionAlgorithm}Size`] = getCompressedSize(compressionAlgorithm, assetSources.src);
107107
}
108108

109109
// Picking modules from current bundle script

src/sizeUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const COMPRESSED_SIZE = {
55
brotli: brotliSize
66
};
77

8-
export function compressedSize(compressionAlgorithm, input) {
8+
export function getCompressedSize(compressionAlgorithm, input) {
99
const fn = COMPRESSED_SIZE[compressionAlgorithm];
1010
if (!fn) throw new Error(`Unsupported compression algorithm: ${compressionAlgorithm}.`);
1111
return fn(input);

src/tree/Folder.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Module from './Module';
44
import BaseFolder from './BaseFolder';
55
import ConcatenatedModule from './ConcatenatedModule';
66
import {getModulePathParts} from './utils';
7-
import {compressedSize} from '../sizeUtils';
7+
import {getCompressedSize} from '../sizeUtils';
88

99
export default class Folder extends BaseFolder {
1010

@@ -18,17 +18,17 @@ export default class Folder extends BaseFolder {
1818
}
1919

2020
get gzipSize() {
21-
return this.opts.compressionAlgorithm === 'gzip' ? this.compressedSize('gzip') : undefined;
21+
return this.opts.compressionAlgorithm === 'gzip' ? this.getCompressedSize('gzip') : undefined;
2222
}
2323

2424
get brotliSize() {
25-
return this.opts.compressionAlgorithm === 'brotli' ? this.compressedSize('brotli') : undefined;
25+
return this.opts.compressionAlgorithm === 'brotli' ? this.getCompressedSize('brotli') : undefined;
2626
}
2727

28-
compressedSize(compressionAlgorithm) {
28+
getCompressedSize(compressionAlgorithm) {
2929
const key = `_${compressionAlgorithm}Size`;
3030
if (!_.has(this, key)) {
31-
this[key] = this.src ? compressedSize(compressionAlgorithm, this.src) : 0;
31+
this[key] = this.src ? getCompressedSize(compressionAlgorithm, this.src) : 0;
3232
}
3333

3434
return this[key];

src/tree/Module.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import {compressedSize} from '../sizeUtils';
2+
import {getCompressedSize} from '../sizeUtils';
33

44
import Node from './Node';
55

@@ -34,17 +34,17 @@ export default class Module extends Node {
3434
}
3535

3636
get gzipSize() {
37-
return this.opts.compressionAlgorithm === 'gzip' ? this.compressedSize('gzip') : undefined;
37+
return this.opts.compressionAlgorithm === 'gzip' ? this.getCompressedSize('gzip') : undefined;
3838
}
3939

4040
get brotliSize() {
41-
return this.opts.compressionAlgorithm === 'brotli' ? this.compressedSize('brotli') : undefined;
41+
return this.opts.compressionAlgorithm === 'brotli' ? this.getCompressedSize('brotli') : undefined;
4242
}
4343

44-
compressedSize(compressionAlgorithm) {
44+
getCompressedSize(compressionAlgorithm) {
4545
const key = `_${compressionAlgorithm}Size`;
4646
if (!_.has(this, key)) {
47-
this[key] = this.src ? compressedSize(compressionAlgorithm, this.src) : undefined;
47+
this[key] = this.src ? getCompressedSize(compressionAlgorithm, this.src) : undefined;
4848
}
4949

5050
return this[key];

0 commit comments

Comments
 (0)