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.
- package/CHANGELOG.md +28 -2
- package/README.md +21 -6
- package/esm/_dnt.polyfills.js +15 -0
- package/esm/bin.js +9 -4
- package/esm/deps/deno.land/std@0.173.0/_util/asserts.js +21 -0
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/_util/os.js +4 -1
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/flags/mod.js +145 -36
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_constants.js +1 -0
- package/esm/deps/deno.land/std@0.173.0/path/_interface.js +3 -0
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_util.js +1 -0
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/common.js +1 -1
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/glob.js +1 -1
- package/esm/deps/deno.land/std@0.173.0/path/mod.js +32 -0
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/posix.js +23 -16
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/separator.js +1 -1
- package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/win32.js +20 -15
- package/esm/deps/{deno_land/x/semver_v1.4.0 → deno.land/std@0.173.0/semver}/mod.js +227 -334
- package/esm/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.js +0 -0
- package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.js +1 -1
- package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.js +0 -0
- package/esm/mod.js +1 -0
- package/esm/src/Change.js +15 -15
- package/esm/src/Changelog.js +9 -1
- package/esm/src/Release.js +21 -4
- package/esm/src/deps.js +1 -1
- package/esm/src/parser.js +24 -5
- package/esm/test/changelog.custom.type.md +0 -1
- package/esm/test/changelog.expected.linted.md +208 -0
- package/esm/test/changelog.expected.md +6 -4
- package/esm/test/changelog.md +7 -3
- package/esm/test/empty.expected.md +0 -1
- package/package.json +13 -8
- package/script/_dnt.polyfills.js +16 -0
- package/script/_dnt.shims.js +66 -0
- package/script/bin.js +144 -0
- package/script/deps/deno.land/std@0.173.0/_util/asserts.js +27 -0
- package/script/deps/deno.land/std@0.173.0/_util/os.js +44 -0
- package/script/deps/deno.land/std@0.173.0/flags/mod.js +368 -0
- package/script/deps/deno.land/std@0.173.0/path/_constants.js +49 -0
- package/script/deps/deno.land/std@0.173.0/path/_interface.js +4 -0
- package/script/deps/deno.land/std@0.173.0/path/_util.js +125 -0
- package/script/deps/deno.land/std@0.173.0/path/common.js +40 -0
- package/script/deps/deno.land/std@0.173.0/path/glob.js +391 -0
- package/script/deps/deno.land/std@0.173.0/path/mod.js +63 -0
- package/script/deps/deno.land/std@0.173.0/path/posix.js +539 -0
- package/script/deps/deno.land/std@0.173.0/path/separator.js +8 -0
- package/script/deps/deno.land/std@0.173.0/path/win32.js +1007 -0
- package/script/deps/deno.land/std@0.173.0/semver/mod.js +1458 -0
- package/script/deps/deno.land/std@0.51.0/fs/eol.js +34 -0
- package/script/deps/deno.land/x/ini@v2.1.0/ini.js +256 -0
- package/script/deps/deno.land/x/ini@v2.1.0/mod.js +17 -0
- package/script/mod.js +15 -0
- package/{umd → script}/package.json +0 -0
- package/script/src/Change.js +51 -0
- package/script/src/Changelog.js +148 -0
- package/script/src/Release.js +227 -0
- package/script/src/deps.js +9 -0
- package/script/src/parser.js +184 -0
- package/{umd → script}/test/changelog.custom.type.md +0 -1
- package/script/test/changelog.expected.linted.md +208 -0
- package/{umd → script}/test/changelog.expected.md +6 -4
- package/{umd → script}/test/changelog.md +7 -3
- package/{umd → script}/test/empty.expected.md +0 -1
- package/types/_dnt.polyfills.d.ts +11 -0
- package/types/_dnt.shims.d.ts +0 -4
- package/types/bin.d.ts +1 -1
- package/types/deps/deno.land/std@0.173.0/_util/asserts.d.ts +10 -0
- package/types/deps/deno.land/std@0.173.0/_util/os.d.ts +4 -0
- package/types/deps/deno.land/std@0.173.0/flags/mod.d.ts +166 -0
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_constants.d.ts +0 -0
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_interface.d.ts +1 -1
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_util.d.ts +0 -0
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/common.d.ts +0 -0
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/glob.d.ts +10 -5
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/mod.d.ts +0 -0
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/posix.d.ts +9 -5
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/separator.d.ts +0 -0
- package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/win32.d.ts +7 -5
- package/types/deps/deno.land/std@0.173.0/semver/mod.d.ts +398 -0
- package/types/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.d.ts +0 -0
- package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.d.ts +0 -0
- package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.d.ts +0 -0
- package/types/mod.d.ts +1 -0
- package/types/src/Changelog.d.ts +1 -0
- package/types/src/Release.d.ts +2 -0
- package/types/src/deps.d.ts +1 -1
- package/esm/deps/deno_land/std_0.120.0/_util/assert.js +0 -13
- package/esm/deps/deno_land/std_0.120.0/path/_interface.js +0 -3
- package/esm/deps/deno_land/std_0.120.0/path/mod.js +0 -14
- package/types/deps/deno_land/std_0.120.0/_util/assert.d.ts +0 -5
- package/types/deps/deno_land/std_0.120.0/_util/os.d.ts +0 -3
- package/types/deps/deno_land/std_0.120.0/flags/mod.d.ts +0 -50
- package/types/deps/deno_land/x/semver_v1.4.0/mod.d.ts +0 -116
- package/umd/_dnt.shims.js +0 -76
- package/umd/bin.js +0 -145
- package/umd/deps/deno_land/std_0.120.0/_util/assert.js +0 -28
- package/umd/deps/deno_land/std_0.120.0/_util/os.js +0 -47
- package/umd/deps/deno_land/std_0.120.0/flags/mod.js +0 -269
- package/umd/deps/deno_land/std_0.120.0/path/_constants.js +0 -58
- package/umd/deps/deno_land/std_0.120.0/path/_interface.js +0 -14
- package/umd/deps/deno_land/std_0.120.0/path/_util.js +0 -134
- package/umd/deps/deno_land/std_0.120.0/path/common.js +0 -50
- package/umd/deps/deno_land/std_0.120.0/path/glob.js +0 -397
- package/umd/deps/deno_land/std_0.120.0/path/mod.js +0 -51
- package/umd/deps/deno_land/std_0.120.0/path/posix.js +0 -538
- package/umd/deps/deno_land/std_0.120.0/path/separator.js +0 -18
- package/umd/deps/deno_land/std_0.120.0/path/win32.js +0 -1008
- package/umd/deps/deno_land/std_0.51.0/fs/eol.js +0 -44
- package/umd/deps/deno_land/x/ini_v2.1.0/ini.js +0 -262
- package/umd/deps/deno_land/x/ini_v2.1.0/mod.js +0 -23
- package/umd/deps/deno_land/x/semver_v1.4.0/mod.js +0 -1578
- package/umd/mod.js +0 -24
- package/umd/src/Change.js +0 -61
- package/umd/src/Changelog.js +0 -150
- package/umd/src/Release.js +0 -220
- package/umd/src/deps.js +0 -19
- 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/
|
|
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
|
|
507
|
-
* @param path to determine
|
|
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,
|
|
641
|
-
//
|
|
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
|
|
651
|
+
// Try to match the explicit suffix
|
|
647
652
|
if (code === ext.charCodeAt(extIdx)) {
|
|
648
653
|
if (--extIdx === -1) {
|
|
649
|
-
// We matched
|
|
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
|
-
//
|
|
656
|
-
//
|
|
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 "
|
|
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 "
|
|
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")
|