keep-a-changelog 2.1.0 → 2.2.1

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +16 -4
  3. package/esm/bin.js +6 -2
  4. package/esm/deps/deno.land/std@0.173.0/_util/asserts.js +21 -0
  5. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/_util/os.js +3 -2
  6. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/flags/mod.js +145 -36
  7. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_constants.js +1 -0
  8. package/esm/deps/deno.land/std@0.173.0/path/_interface.js +3 -0
  9. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_util.js +1 -0
  10. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/common.js +1 -1
  11. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/glob.js +1 -1
  12. package/esm/deps/deno.land/std@0.173.0/path/mod.js +32 -0
  13. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/posix.js +20 -16
  14. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/separator.js +1 -1
  15. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/win32.js +17 -15
  16. package/esm/deps/deno.land/{x/semver@v1.4.0 → std@0.173.0/semver}/mod.js +227 -334
  17. package/esm/src/Change.js +15 -15
  18. package/esm/src/Changelog.js +9 -1
  19. package/esm/src/Release.js +10 -0
  20. package/esm/src/deps.js +1 -1
  21. package/esm/src/parser.js +19 -3
  22. package/esm/test/changelog.custom.type.md +0 -1
  23. package/esm/test/changelog.expected.linted.md +208 -0
  24. package/esm/test/changelog.expected.md +3 -1
  25. package/esm/test/changelog.md +4 -0
  26. package/esm/test/empty.expected.md +0 -1
  27. package/package.json +13 -8
  28. package/script/bin.js +6 -2
  29. package/script/deps/deno.land/std@0.173.0/_util/asserts.js +27 -0
  30. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/_util/os.js +4 -3
  31. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/flags/mod.js +149 -40
  32. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_constants.js +1 -0
  33. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_interface.js +1 -1
  34. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_util.js +1 -0
  35. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/common.js +1 -1
  36. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/glob.js +1 -1
  37. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/mod.js +19 -1
  38. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/posix.js +20 -16
  39. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/separator.js +1 -1
  40. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/win32.js +18 -16
  41. package/script/deps/deno.land/{x/semver@v1.4.0 → std@0.173.0/semver}/mod.js +232 -342
  42. package/script/src/Change.js +15 -15
  43. package/script/src/Changelog.js +9 -1
  44. package/script/src/Release.js +10 -0
  45. package/script/src/deps.js +1 -1
  46. package/script/src/parser.js +19 -3
  47. package/script/test/changelog.custom.type.md +0 -1
  48. package/script/test/changelog.expected.linted.md +208 -0
  49. package/script/test/changelog.expected.md +3 -1
  50. package/script/test/changelog.md +4 -0
  51. package/script/test/empty.expected.md +0 -1
  52. package/types/deps/deno.land/std@0.173.0/_util/asserts.d.ts +10 -0
  53. package/types/deps/deno.land/std@0.173.0/_util/os.d.ts +4 -0
  54. package/types/deps/deno.land/std@0.173.0/flags/mod.d.ts +166 -0
  55. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_constants.d.ts +0 -0
  56. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_interface.d.ts +1 -1
  57. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_util.d.ts +0 -0
  58. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/common.d.ts +0 -0
  59. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/glob.d.ts +10 -5
  60. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/mod.d.ts +0 -0
  61. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/posix.d.ts +9 -5
  62. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/separator.d.ts +0 -0
  63. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/win32.d.ts +7 -5
  64. package/types/deps/deno.land/std@0.173.0/semver/mod.d.ts +398 -0
  65. package/types/src/Changelog.d.ts +1 -0
  66. package/types/src/Release.d.ts +1 -0
  67. package/types/src/deps.d.ts +1 -1
  68. package/esm/deps/deno.land/std@0.120.0/_util/assert.js +0 -13
  69. package/esm/deps/deno.land/std@0.120.0/path/_interface.js +0 -3
  70. package/esm/deps/deno.land/std@0.120.0/path/mod.js +0 -14
  71. package/script/deps/deno.land/std@0.120.0/_util/assert.js +0 -18
  72. package/types/deps/deno.land/std@0.120.0/_util/assert.d.ts +0 -5
  73. package/types/deps/deno.land/std@0.120.0/_util/os.d.ts +0 -3
  74. package/types/deps/deno.land/std@0.120.0/flags/mod.d.ts +0 -50
  75. package/types/deps/deno.land/x/semver@v1.4.0/mod.d.ts +0 -116
@@ -1,10 +1,11 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
1
2
  // Copyright the Browserify authors. MIT License.
2
3
  // Ported from https://github.com/browserify/path-browserify/
3
4
  // This module is browser compatible.
4
5
  import * as dntShim from "../../../../_dnt.shims.js";
5
6
  import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "./_constants.js";
6
7
  import { _format, assertPath, encodeWhitespace, isPathSeparator, isWindowsDeviceRoot, normalizeString, } from "./_util.js";
7
- import { assert } from "../_util/assert.js";
8
+ import { assert } from "../_util/asserts.js";
8
9
  export const sep = "\\";
9
10
  export const delimiter = ";";
10
11
  /**
@@ -506,8 +507,8 @@ export function toNamespacedPath(path) {
506
507
  return path;
507
508
  }
508
509
  /**
509
- * Return the directory name of a `path`.
510
- * @param path to determine name for
510
+ * Return the directory path of a `path`.
511
+ * @param path to determine the directory path for
511
512
  */
512
513
  export function dirname(path) {
513
514
  assertPath(path);
@@ -640,33 +641,33 @@ export function basename(path, ext = "") {
640
641
  }
641
642
  else {
642
643
  if (firstNonSlashEnd === -1) {
643
- // We saw the first non-path separator, remember this index in case
644
- // we need it if the extension ends up not matching
644
+ // We saw the first non-path separator, mark this as the end of our
645
+ // path component in case we don't match a whole suffix
645
646
  matchedSlash = false;
646
647
  firstNonSlashEnd = i + 1;
648
+ end = firstNonSlashEnd;
647
649
  }
648
650
  if (extIdx >= 0) {
649
- // Try to match the explicit extension
651
+ // Try to match the explicit suffix
650
652
  if (code === ext.charCodeAt(extIdx)) {
651
653
  if (--extIdx === -1) {
652
- // We matched the extension, so mark this as the end of our path
654
+ // We matched whole suffix, so mark this as the end of our path
653
655
  // component
654
656
  end = i;
655
657
  }
656
658
  }
657
659
  else {
658
- // Extension does not match, so our result is the entire path
659
- // component
660
+ // Suffix character does not match, so bail out early
661
+ // from checking rest of characters
660
662
  extIdx = -1;
661
- end = firstNonSlashEnd;
662
663
  }
663
664
  }
664
665
  }
665
666
  }
667
+ if (end === -1)
668
+ return "";
666
669
  if (start === end)
667
670
  end = firstNonSlashEnd;
668
- else if (end === -1)
669
- end = path.length;
670
671
  return path.slice(start, end);
671
672
  }
672
673
  else {
@@ -692,8 +693,9 @@ export function basename(path, ext = "") {
692
693
  }
693
694
  }
694
695
  /**
695
- * Return the extension of the `path`.
696
+ * Return the extension of the `path` with leading period.
696
697
  * @param path with extension
698
+ * @returns extension (ex. for `file.ts` returns `.ts`)
697
699
  */
698
700
  export function extname(path) {
699
701
  assertPath(path);
@@ -917,7 +919,7 @@ export function parse(path) {
917
919
  * Converts a file URL to a path string.
918
920
  *
919
921
  * ```ts
920
- * import { fromFileUrl } from "./win32.ts";
922
+ * import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
921
923
  * fromFileUrl("file:///home/foo"); // "\\home\\foo"
922
924
  * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
923
925
  * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
@@ -942,7 +944,7 @@ export function fromFileUrl(url) {
942
944
  * Converts a path string to a file URL.
943
945
  *
944
946
  * ```ts
945
- * import { toFileUrl } from "./win32.ts";
947
+ * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
946
948
  * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
947
949
  * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
948
950
  * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")