@adviser/cement 0.4.4 → 0.4.5

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/index.cjs CHANGED
@@ -3579,7 +3579,11 @@ var pathOpsImpl = class {
3579
3579
  __privateAdd(this, _pathOpsImpl_instances);
3580
3580
  }
3581
3581
  join(...paths) {
3582
- return paths.map((i) => i.replace(/\/+$/, "")).join("/");
3582
+ const parts = __privateMethod(this, _pathOpsImpl_instances, parts_fn).call(this, paths.filter((i) => i).join("/"));
3583
+ if (parts.dirname === "" || parts.dirname === ".") {
3584
+ return parts.basename ? parts.basename : ".";
3585
+ }
3586
+ return parts.dirname + "/" + parts.basename;
3583
3587
  }
3584
3588
  dirname(path) {
3585
3589
  return __privateMethod(this, _pathOpsImpl_instances, parts_fn).call(this, path).dirname;
@@ -3590,14 +3594,18 @@ var pathOpsImpl = class {
3590
3594
  };
3591
3595
  _pathOpsImpl_instances = new WeakSet();
3592
3596
  parts_fn = function(path) {
3597
+ path = path.replace(/\/+/g, "/").replace(/(\/\.\/)+/g, "/").replace(/\/+$/, "");
3593
3598
  const splitted = path.split("/");
3594
- const last = splitted.pop();
3595
- if (splitted.length && last === "") {
3596
- return __privateMethod(this, _pathOpsImpl_instances, parts_fn).call(this, this.join(...splitted));
3599
+ if (splitted.length === 1) {
3600
+ return {
3601
+ dirname: ".",
3602
+ basename: splitted[0] === "." ? "" : splitted[0]
3603
+ };
3597
3604
  }
3605
+ const basename = splitted.pop();
3598
3606
  return {
3599
- dirname: this.join(...splitted),
3600
- basename: last != null ? last : ""
3607
+ dirname: splitted.join("/").replace(/^\.\//, ""),
3608
+ basename
3601
3609
  };
3602
3610
  };
3603
3611
  var pathOps = new pathOpsImpl();