bundlemon-utils
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -20,1 +20,4 @@ export declare enum Compression { | ||
} | ||
export declare enum ProjectProvider { | ||
GitHub = "github" | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FailReason = exports.Status = exports.DiffChange = exports.Compression = void 0; | ||
exports.ProjectProvider = exports.FailReason = exports.Status = exports.DiffChange = exports.Compression = void 0; | ||
var Compression; | ||
@@ -27,1 +27,5 @@ (function (Compression) { | ||
})(FailReason = exports.FailReason || (exports.FailReason = {})); | ||
var ProjectProvider; | ||
(function (ProjectProvider) { | ||
ProjectProvider["GitHub"] = "github"; | ||
})(ProjectProvider = exports.ProjectProvider || (exports.ProjectProvider = {})); |
@@ -32,4 +32,4 @@ "use strict"; | ||
const diffBytes = ((_a = currBranchFile === null || currBranchFile === void 0 ? void 0 : currBranchFile.size) !== null && _a !== void 0 ? _a : 0) - ((_b = baseBranchFile === null || baseBranchFile === void 0 ? void 0 : baseBranchFile.size) !== null && _b !== void 0 ? _b : 0); | ||
const diffPercent = utils_1.getPercentageDiff((_c = currBranchFile === null || currBranchFile === void 0 ? void 0 : currBranchFile.size) !== null && _c !== void 0 ? _c : 0, (_d = baseBranchFile === null || baseBranchFile === void 0 ? void 0 : baseBranchFile.size) !== null && _d !== void 0 ? _d : 0); | ||
const change = utils_1.calcChange({ | ||
const diffPercent = (0, utils_1.getPercentageDiff)((_c = currBranchFile === null || currBranchFile === void 0 ? void 0 : currBranchFile.size) !== null && _c !== void 0 ? _c : 0, (_d = baseBranchFile === null || baseBranchFile === void 0 ? void 0 : baseBranchFile.size) !== null && _d !== void 0 ? _d : 0); | ||
const change = (0, utils_1.calcChange)({ | ||
isExistsInCurrBranch: !!currBranchFile, | ||
@@ -39,3 +39,3 @@ isExistsInBaseBranch: !!baseBranchFile, | ||
}); | ||
const statusObj = utils_1.getStatusObject({ currBranchFile, change, diffPercent }); | ||
const statusObj = (0, utils_1.getStatusObject)({ currBranchFile, change, diffPercent }); | ||
if (statusObj.status === consts_1.Status.Fail) { | ||
@@ -53,3 +53,3 @@ totalStatus = consts_1.Status.Fail; | ||
const diffBytes = stats.currBranchSize - stats.baseBranchSize; | ||
const diffPercent = utils_1.getPercentageDiff(stats.currBranchSize, stats.baseBranchSize); | ||
const diffPercent = (0, utils_1.getPercentageDiff)(stats.currBranchSize, stats.baseBranchSize); | ||
return { | ||
@@ -56,0 +56,0 @@ files, |
@@ -5,3 +5,7 @@ "use strict"; | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -8,0 +12,0 @@ if (k2 === undefined) k2 = k; |
@@ -14,3 +14,3 @@ "use strict"; | ||
function getDiffSizeText(size) { | ||
return `${getSignText(size)}${bytes_1.default(size)}`; | ||
return `${getSignText(size)}${(0, bytes_1.default)(size)}`; | ||
} | ||
@@ -28,3 +28,3 @@ exports.getDiffSizeText = getDiffSizeText; | ||
if (file.maxSize) { | ||
limits.push(bytes_1.default(file.maxSize)); | ||
limits.push((0, bytes_1.default)(file.maxSize)); | ||
} | ||
@@ -45,3 +45,3 @@ if (file.maxPercentIncrease) { | ||
? 'No change in files bundle size' | ||
: `Total files change ${getDiffSizeText(stats.diff.bytes)} ${Number.isFinite(stats.diff.percent) ? getDiffPercentText(stats.diff.percent) : ''}`; | ||
: `${getDiffSizeText(stats.diff.bytes)} ${Number.isFinite(stats.diff.percent) ? getDiffPercentText(stats.diff.percent) : ''} total files change`; | ||
} | ||
@@ -73,3 +73,3 @@ const fileFails = files.filter((f) => f.status === consts_1.Status.Fail); | ||
if (singleFail.maxSize && singleFail.failReasons[0] === consts_1.FailReason.MaxSize) { | ||
return `Max size exceeded in ${type} "${singleFail.path}": ${bytes_1.default(singleFail.size)} > ${bytes_1.default(singleFail.maxSize)}`; | ||
return `Max size exceeded in ${type} "${singleFail.path}": ${(0, bytes_1.default)(singleFail.size)} > ${(0, bytes_1.default)(singleFail.maxSize)}`; | ||
} | ||
@@ -76,0 +76,0 @@ else if (singleFail.maxPercentIncrease && singleFail.failReasons[0] === consts_1.FailReason.MaxPercentIncrease) { |
@@ -20,1 +20,4 @@ export declare enum Compression { | ||
} | ||
export declare enum ProjectProvider { | ||
GitHub = "github" | ||
} |
@@ -24,1 +24,5 @@ export var Compression; | ||
})(FailReason || (FailReason = {})); | ||
export var ProjectProvider; | ||
(function (ProjectProvider) { | ||
ProjectProvider["GitHub"] = "github"; | ||
})(ProjectProvider || (ProjectProvider = {})); |
@@ -33,3 +33,3 @@ import bytes from 'bytes'; | ||
? 'No change in files bundle size' | ||
: `Total files change ${getDiffSizeText(stats.diff.bytes)} ${Number.isFinite(stats.diff.percent) ? getDiffPercentText(stats.diff.percent) : ''}`; | ||
: `${getDiffSizeText(stats.diff.bytes)} ${Number.isFinite(stats.diff.percent) ? getDiffPercentText(stats.diff.percent) : ''} total files change`; | ||
} | ||
@@ -36,0 +36,0 @@ const fileFails = files.filter((f) => f.status === Status.Fail); |
{ | ||
"name": "bundlemon-utils", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31655
790