keep-a-changelog 2.0.1 → 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 (117) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/README.md +21 -6
  3. package/esm/_dnt.polyfills.js +15 -0
  4. package/esm/bin.js +9 -4
  5. package/esm/deps/deno.land/std@0.173.0/_util/asserts.js +21 -0
  6. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/_util/os.js +4 -1
  7. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/flags/mod.js +145 -36
  8. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_constants.js +1 -0
  9. package/esm/deps/deno.land/std@0.173.0/path/_interface.js +3 -0
  10. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_util.js +1 -0
  11. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/common.js +1 -1
  12. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/glob.js +1 -1
  13. package/esm/deps/deno.land/std@0.173.0/path/mod.js +32 -0
  14. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/posix.js +23 -16
  15. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/separator.js +1 -1
  16. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/win32.js +20 -15
  17. package/esm/deps/{deno_land/x/semver_v1.4.0 → deno.land/std@0.173.0/semver}/mod.js +227 -334
  18. package/esm/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.js +0 -0
  19. package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.js +1 -1
  20. package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.js +0 -0
  21. package/esm/mod.js +1 -0
  22. package/esm/src/Change.js +15 -15
  23. package/esm/src/Changelog.js +9 -1
  24. package/esm/src/Release.js +21 -4
  25. package/esm/src/deps.js +1 -1
  26. package/esm/src/parser.js +24 -5
  27. package/esm/test/changelog.custom.type.md +0 -1
  28. package/esm/test/changelog.expected.linted.md +208 -0
  29. package/esm/test/changelog.expected.md +6 -4
  30. package/esm/test/changelog.md +7 -3
  31. package/esm/test/empty.expected.md +0 -1
  32. package/package.json +13 -8
  33. package/script/_dnt.polyfills.js +16 -0
  34. package/script/_dnt.shims.js +66 -0
  35. package/script/bin.js +144 -0
  36. package/script/deps/deno.land/std@0.173.0/_util/asserts.js +27 -0
  37. package/script/deps/deno.land/std@0.173.0/_util/os.js +44 -0
  38. package/script/deps/deno.land/std@0.173.0/flags/mod.js +368 -0
  39. package/script/deps/deno.land/std@0.173.0/path/_constants.js +49 -0
  40. package/script/deps/deno.land/std@0.173.0/path/_interface.js +4 -0
  41. package/script/deps/deno.land/std@0.173.0/path/_util.js +125 -0
  42. package/script/deps/deno.land/std@0.173.0/path/common.js +40 -0
  43. package/script/deps/deno.land/std@0.173.0/path/glob.js +391 -0
  44. package/script/deps/deno.land/std@0.173.0/path/mod.js +63 -0
  45. package/script/deps/deno.land/std@0.173.0/path/posix.js +539 -0
  46. package/script/deps/deno.land/std@0.173.0/path/separator.js +8 -0
  47. package/script/deps/deno.land/std@0.173.0/path/win32.js +1007 -0
  48. package/script/deps/deno.land/std@0.173.0/semver/mod.js +1458 -0
  49. package/script/deps/deno.land/std@0.51.0/fs/eol.js +34 -0
  50. package/script/deps/deno.land/x/ini@v2.1.0/ini.js +256 -0
  51. package/script/deps/deno.land/x/ini@v2.1.0/mod.js +17 -0
  52. package/script/mod.js +15 -0
  53. package/{umd → script}/package.json +0 -0
  54. package/script/src/Change.js +51 -0
  55. package/script/src/Changelog.js +148 -0
  56. package/script/src/Release.js +227 -0
  57. package/script/src/deps.js +9 -0
  58. package/script/src/parser.js +184 -0
  59. package/{umd → script}/test/changelog.custom.type.md +0 -1
  60. package/script/test/changelog.expected.linted.md +208 -0
  61. package/{umd → script}/test/changelog.expected.md +6 -4
  62. package/{umd → script}/test/changelog.md +7 -3
  63. package/{umd → script}/test/empty.expected.md +0 -1
  64. package/types/_dnt.polyfills.d.ts +11 -0
  65. package/types/_dnt.shims.d.ts +0 -4
  66. package/types/bin.d.ts +1 -1
  67. package/types/deps/deno.land/std@0.173.0/_util/asserts.d.ts +10 -0
  68. package/types/deps/deno.land/std@0.173.0/_util/os.d.ts +4 -0
  69. package/types/deps/deno.land/std@0.173.0/flags/mod.d.ts +166 -0
  70. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_constants.d.ts +0 -0
  71. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_interface.d.ts +1 -1
  72. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_util.d.ts +0 -0
  73. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/common.d.ts +0 -0
  74. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/glob.d.ts +10 -5
  75. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/mod.d.ts +0 -0
  76. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/posix.d.ts +9 -5
  77. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/separator.d.ts +0 -0
  78. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/win32.d.ts +7 -5
  79. package/types/deps/deno.land/std@0.173.0/semver/mod.d.ts +398 -0
  80. package/types/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.d.ts +0 -0
  81. package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.d.ts +0 -0
  82. package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.d.ts +0 -0
  83. package/types/mod.d.ts +1 -0
  84. package/types/src/Changelog.d.ts +1 -0
  85. package/types/src/Release.d.ts +2 -0
  86. package/types/src/deps.d.ts +1 -1
  87. package/esm/deps/deno_land/std_0.120.0/_util/assert.js +0 -13
  88. package/esm/deps/deno_land/std_0.120.0/path/_interface.js +0 -3
  89. package/esm/deps/deno_land/std_0.120.0/path/mod.js +0 -14
  90. package/types/deps/deno_land/std_0.120.0/_util/assert.d.ts +0 -5
  91. package/types/deps/deno_land/std_0.120.0/_util/os.d.ts +0 -3
  92. package/types/deps/deno_land/std_0.120.0/flags/mod.d.ts +0 -50
  93. package/types/deps/deno_land/x/semver_v1.4.0/mod.d.ts +0 -116
  94. package/umd/_dnt.shims.js +0 -76
  95. package/umd/bin.js +0 -145
  96. package/umd/deps/deno_land/std_0.120.0/_util/assert.js +0 -28
  97. package/umd/deps/deno_land/std_0.120.0/_util/os.js +0 -47
  98. package/umd/deps/deno_land/std_0.120.0/flags/mod.js +0 -269
  99. package/umd/deps/deno_land/std_0.120.0/path/_constants.js +0 -58
  100. package/umd/deps/deno_land/std_0.120.0/path/_interface.js +0 -14
  101. package/umd/deps/deno_land/std_0.120.0/path/_util.js +0 -134
  102. package/umd/deps/deno_land/std_0.120.0/path/common.js +0 -50
  103. package/umd/deps/deno_land/std_0.120.0/path/glob.js +0 -397
  104. package/umd/deps/deno_land/std_0.120.0/path/mod.js +0 -51
  105. package/umd/deps/deno_land/std_0.120.0/path/posix.js +0 -538
  106. package/umd/deps/deno_land/std_0.120.0/path/separator.js +0 -18
  107. package/umd/deps/deno_land/std_0.120.0/path/win32.js +0 -1008
  108. package/umd/deps/deno_land/std_0.51.0/fs/eol.js +0 -44
  109. package/umd/deps/deno_land/x/ini_v2.1.0/ini.js +0 -262
  110. package/umd/deps/deno_land/x/ini_v2.1.0/mod.js +0 -23
  111. package/umd/deps/deno_land/x/semver_v1.4.0/mod.js +0 -1578
  112. package/umd/mod.js +0 -24
  113. package/umd/src/Change.js +0 -61
  114. package/umd/src/Changelog.js +0 -150
  115. package/umd/src/Release.js +0 -220
  116. package/umd/src/deps.js +0 -19
  117. package/umd/src/parser.js +0 -175
@@ -1,7 +1,11 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // Copyright the Browserify authors. MIT License.
3
+ // Ported from https://github.com/browserify/path-browserify/
4
+ // This module is browser compatible.
1
5
  import * as dntShim from "../../../../_dnt.shims.js";
2
6
  import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "./_constants.js";
3
7
  import { _format, assertPath, encodeWhitespace, isPathSeparator, isWindowsDeviceRoot, normalizeString, } from "./_util.js";
4
- import { assert } from "../_util/assert.js";
8
+ import { assert } from "../_util/asserts.js";
5
9
  export const sep = "\\";
6
10
  export const delimiter = ";";
7
11
  /**
@@ -503,8 +507,8 @@ export function toNamespacedPath(path) {
503
507
  return path;
504
508
  }
505
509
  /**
506
- * Return the directory name of a `path`.
507
- * @param path to determine name for
510
+ * Return the directory path of a `path`.
511
+ * @param path to determine the directory path for
508
512
  */
509
513
  export function dirname(path) {
510
514
  assertPath(path);
@@ -637,33 +641,33 @@ export function basename(path, ext = "") {
637
641
  }
638
642
  else {
639
643
  if (firstNonSlashEnd === -1) {
640
- // We saw the first non-path separator, remember this index in case
641
- // 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
642
646
  matchedSlash = false;
643
647
  firstNonSlashEnd = i + 1;
648
+ end = firstNonSlashEnd;
644
649
  }
645
650
  if (extIdx >= 0) {
646
- // Try to match the explicit extension
651
+ // Try to match the explicit suffix
647
652
  if (code === ext.charCodeAt(extIdx)) {
648
653
  if (--extIdx === -1) {
649
- // 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
650
655
  // component
651
656
  end = i;
652
657
  }
653
658
  }
654
659
  else {
655
- // Extension does not match, so our result is the entire path
656
- // component
660
+ // Suffix character does not match, so bail out early
661
+ // from checking rest of characters
657
662
  extIdx = -1;
658
- end = firstNonSlashEnd;
659
663
  }
660
664
  }
661
665
  }
662
666
  }
667
+ if (end === -1)
668
+ return "";
663
669
  if (start === end)
664
670
  end = firstNonSlashEnd;
665
- else if (end === -1)
666
- end = path.length;
667
671
  return path.slice(start, end);
668
672
  }
669
673
  else {
@@ -689,8 +693,9 @@ export function basename(path, ext = "") {
689
693
  }
690
694
  }
691
695
  /**
692
- * Return the extension of the `path`.
696
+ * Return the extension of the `path` with leading period.
693
697
  * @param path with extension
698
+ * @returns extension (ex. for `file.ts` returns `.ts`)
694
699
  */
695
700
  export function extname(path) {
696
701
  assertPath(path);
@@ -914,7 +919,7 @@ export function parse(path) {
914
919
  * Converts a file URL to a path string.
915
920
  *
916
921
  * ```ts
917
- * import { fromFileUrl } from "./win32.ts";
922
+ * import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
918
923
  * fromFileUrl("file:///home/foo"); // "\\home\\foo"
919
924
  * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
920
925
  * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
@@ -939,7 +944,7 @@ export function fromFileUrl(url) {
939
944
  * Converts a path string to a file URL.
940
945
  *
941
946
  * ```ts
942
- * import { toFileUrl } from "./win32.ts";
947
+ * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/win32.ts";
943
948
  * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
944
949
  * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
945
950
  * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")