shelving 1.193.1 → 1.193.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/util/path.d.ts +4 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.193.1",
3
+ "version": "1.193.2",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
package/util/path.d.ts CHANGED
@@ -3,12 +3,10 @@ import type { AnyCaller } from "./function.js";
3
3
  import type { Nullish } from "./null.js";
4
4
  /** Absolute path string starts with `/` slash. */
5
5
  export type AbsolutePath = `/` | `/${string}`;
6
- /** Base path string starts with `/` slash and ends with `/` */
7
- export type BasePath = `/` | `/${string}`;
8
6
  /** Relative path string is `.` dot, or starts with `./` dot slash. */
9
7
  export type RelativePath = `.` | `./` | `./${string}`;
10
- /** Simple path string like `a/b/c` */
11
- export type SimplePath = string;
8
+ /** Either an absolute or relative path. */
9
+ export type Path = AbsolutePath | RelativePath;
12
10
  /** Things that can be converted to a path. */
13
11
  export type PossiblePath = string;
14
12
  /** List of non-empty path segments. */
@@ -54,13 +52,13 @@ export declare function getPath(path: Nullish<PossiblePath>, base?: AbsolutePath
54
52
  * @param base Absolute path used for resolving relative paths in `possible`
55
53
  * @return Absolute path with a leading trailing slash, e.g. `/a/c/b`
56
54
  */
57
- export declare function requirePath(path: AbsolutePath | RelativePath, base?: AbsolutePath, caller?: AnyCaller): AbsolutePath;
55
+ export declare function requirePath(path: PossiblePath, base?: AbsolutePath, caller?: AnyCaller): AbsolutePath;
58
56
  /**
59
57
  * Match and strip a base path prefix from a path using segment-aware pathname rules.
60
58
  * - Both inputs must be absolute paths that begin with `/`.
61
59
  * - Returns `/` when the paths are an exact match.
62
60
  */
63
- export declare function matchPathPrefix(target: AbsolutePath | RelativePath, base: AbsolutePath, caller?: AnyCaller): AbsolutePath | undefined;
61
+ export declare function matchPathPrefix(target: PossiblePath, base: PossiblePath, caller?: AnyCaller): AbsolutePath | undefined;
64
62
  /** Is a target path active? */
65
63
  export declare function isPathActive(target: AbsolutePath, current: AbsolutePath): boolean;
66
64
  /** Is a target path proud (i.e. is the current path, or is a child of the current path)? */