@stryke/path 0.15.1 → 0.15.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.
package/dist/append.cjs CHANGED
@@ -10,6 +10,6 @@ var _isParentPath = require("./is-parent-path.cjs");
10
10
  var _joinPaths = require("./join-paths.cjs");
11
11
  var _slash = require("./slash.cjs");
12
12
  function appendPath(r, o = (0, _cwd.cwd)()) {
13
- return (0, _slash.slash)((0, _isParentPath.isParentPath)(r, o) ? r : (0, _joinPaths.joinPaths)(r, o));
13
+ return (0, _slash.slash)((0, _isParentPath.isParentPath)(r, o) ? r : (0, _joinPaths.joinPaths)(o, r));
14
14
  }
15
15
  const append = exports.append = appendPath;
package/dist/append.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  /**
2
- * Append the base path from the beginning of the given path.
2
+ * If not already a parent path, append the base path from the beginning of the given child path.
3
3
  *
4
4
  * @example
5
5
  * ```ts
6
- * appendPath("/home/user/project/src/index.ts", "/home/user/project");
7
- * // returns "src/index.ts"
6
+ * appendPath("src/index.ts", "/home/user/project");
7
+ * // returns "/home/user/project/src/index.ts"
8
+ *
9
+ * appendPath("/user/dev/app.ts", "/user/dev");
10
+ * // returns "/user/dev/app.ts"
8
11
  * ```
9
12
  *
10
13
  * @param childPath - The child path to append to the {@link parentPath}
package/dist/append.mjs CHANGED
@@ -1 +1 @@
1
- import{cwd as t}from"./cwd";import{isParentPath as n}from"./is-parent-path";import{joinPaths as p}from"./join-paths";import{slash as i}from"./slash";export function appendPath(r,o=t()){return i(n(r,o)?r:p(r,o))}export const append=appendPath;
1
+ import{cwd as t}from"./cwd";import{isParentPath as n}from"./is-parent-path";import{joinPaths as p}from"./join-paths";import{slash as i}from"./slash";export function appendPath(r,o=t()){return i(n(r,o)?r:p(o,r))}export const append=appendPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/path",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "type": "module",
5
5
  "description": "A package containing various utilities that expand the functionality of NodeJs's built-in `path` module",
6
6
  "repository": {
@@ -278,5 +278,5 @@
278
278
  "main": "./dist/index.cjs",
279
279
  "module": "./dist/index.mjs",
280
280
  "types": "./dist/index.d.ts",
281
- "gitHead": "af24fab80acc5cc13febfd819a367ba46ad8329b"
281
+ "gitHead": "e16d8342cedeaa690117587b41cfc439b61b38bb"
282
282
  }