nworks-plus 1.4.0 → 1.4.3

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/index.js CHANGED
@@ -818,7 +818,7 @@ async function request(opts, _retryCount = 0) {
818
818
  }
819
819
 
820
820
  // src/utils/sanitize.ts
821
- import { basename, resolve, sep } from "path";
821
+ import { posix, resolve, sep } from "path";
822
822
  import { randomBytes as randomBytes3 } from "crypto";
823
823
  function sanitizePathSegment(value) {
824
824
  if (!value || typeof value !== "string") {
@@ -834,7 +834,7 @@ function sanitizeFileName(name) {
834
834
  if (!name || typeof name !== "string") {
835
835
  throw new Error("File name must be a non-empty string");
836
836
  }
837
- const base = basename(name);
837
+ const base = posix.basename(name);
838
838
  return base.replace(/[\r\n"\\]/g, "_");
839
839
  }
840
840
  function validateLocalPath(filePath, allowedBase) {
@@ -1431,7 +1431,7 @@ import { Command as Command7 } from "commander";
1431
1431
 
1432
1432
  // src/api/drive.ts
1433
1433
  import { readFile as readFile4, stat as stat2 } from "fs/promises";
1434
- import { basename as basename2 } from "path";
1434
+ import { basename } from "path";
1435
1435
  var BASE_URL3 = "https://www.worksapis.com/v1.0";
1436
1436
  var MAX_UPLOAD_SIZE = 100 * 1024 * 1024;
1437
1437
  var ALLOWED_HOSTS = [
@@ -1475,7 +1475,7 @@ async function listFiles(userId = "me", folderId, count = 20, cursor, profile =
1475
1475
  return { files: data.files ?? [], responseMetaData: data.responseMetaData };
1476
1476
  }
1477
1477
  async function uploadFile(localPath, userId = "me", folderId, overwrite = false, profile = "default") {
1478
- const fileName = basename2(localPath);
1478
+ const fileName = basename(localPath);
1479
1479
  const safeName = sanitizeFileName(fileName);
1480
1480
  const fileStat = await stat2(localPath);
1481
1481
  const fileSize = fileStat.size;