npm-pkg-lint 4.6.8 → 4.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4390,6 +4390,47 @@ var require_coerce = __commonJS({
4390
4390
  }
4391
4391
  });
4392
4392
 
4393
+ // node_modules/semver/functions/truncate.js
4394
+ var require_truncate = __commonJS({
4395
+ "node_modules/semver/functions/truncate.js"(exports, module) {
4396
+ "use strict";
4397
+ var parse2 = require_parse();
4398
+ var constants = require_constants();
4399
+ var SemVer = require_semver();
4400
+ var truncate = (version2, truncation, options) => {
4401
+ if (!constants.RELEASE_TYPES.includes(truncation)) {
4402
+ return null;
4403
+ }
4404
+ const clonedVersion = cloneInputVersion(version2, options);
4405
+ return clonedVersion && doTruncation(clonedVersion, truncation);
4406
+ };
4407
+ var cloneInputVersion = (version2, options) => {
4408
+ const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
4409
+ return parse2(versionStringToParse, options);
4410
+ };
4411
+ var doTruncation = (version2, truncation) => {
4412
+ if (isPrerelease(truncation)) {
4413
+ return version2.version;
4414
+ }
4415
+ version2.prerelease = [];
4416
+ switch (truncation) {
4417
+ case "major":
4418
+ version2.minor = 0;
4419
+ version2.patch = 0;
4420
+ break;
4421
+ case "minor":
4422
+ version2.patch = 0;
4423
+ break;
4424
+ }
4425
+ return version2.format();
4426
+ };
4427
+ var isPrerelease = (type) => {
4428
+ return type.startsWith("pre");
4429
+ };
4430
+ module.exports = truncate;
4431
+ }
4432
+ });
4433
+
4393
4434
  // node_modules/semver/internal/lrucache.js
4394
4435
  var require_lrucache = __commonJS({
4395
4436
  "node_modules/semver/internal/lrucache.js"(exports, module) {
@@ -5424,6 +5465,7 @@ var require_semver2 = __commonJS({
5424
5465
  var lte = require_lte();
5425
5466
  var cmp = require_cmp();
5426
5467
  var coerce = require_coerce();
5468
+ var truncate = require_truncate();
5427
5469
  var Comparator = require_comparator();
5428
5470
  var Range = require_range();
5429
5471
  var satisfies = require_satisfies();
@@ -5462,6 +5504,7 @@ var require_semver2 = __commonJS({
5462
5504
  lte,
5463
5505
  cmp,
5464
5506
  coerce,
5507
+ truncate,
5465
5508
  Comparator,
5466
5509
  Range,
5467
5510
  satisfies,