@uipath/filesystem 1.204.0-preview.255 → 1.205.0-preview.256

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/browser.d.ts CHANGED
@@ -24,6 +24,7 @@ export declare class BrowserFileSystem implements IFileSystem {
24
24
  private acquireInMemoryLock;
25
25
  rm(path: string): Promise<void>;
26
26
  rename(oldPath: string, newPath: string): Promise<void>;
27
+ isSymbolicLink(_filePath: string): Promise<boolean>;
27
28
  realpath(filePath: string): Promise<string>;
28
29
  getTempDir(): Promise<string>;
29
30
  copyDirectory(sourcePath: string, destPath: string): Promise<void>;
@@ -1536,10 +1536,16 @@ class BrowserFileSystem {
1536
1536
  if (dir && dir !== "/") {
1537
1537
  await this.mkdir(dir);
1538
1538
  }
1539
- const existing = await this.readFile(filePath, "utf-8");
1540
- const head = existing ?? "";
1541
- const tail = typeof data === "string" ? data : new TextDecoder().decode(data);
1542
- await fs.promises.writeFile(filePath, head + tail);
1539
+ if (typeof data === "string") {
1540
+ const existing2 = await this.readFile(filePath, "utf-8");
1541
+ await fs.promises.writeFile(filePath, (existing2 ?? "") + data);
1542
+ return;
1543
+ }
1544
+ const existing = await this.readFile(filePath) ?? new Uint8Array;
1545
+ const joined = new Uint8Array(existing.byteLength + data.byteLength);
1546
+ joined.set(existing, 0);
1547
+ joined.set(data, existing.byteLength);
1548
+ await fs.promises.writeFile(filePath, joined);
1543
1549
  }
1544
1550
  async readdir(path) {
1545
1551
  try {
@@ -1690,6 +1696,9 @@ class BrowserFileSystem {
1690
1696
  const fs = this.getFs();
1691
1697
  await fs.promises.rename(oldPath, newPath);
1692
1698
  }
1699
+ async isSymbolicLink(_filePath) {
1700
+ return false;
1701
+ }
1693
1702
  async realpath(filePath) {
1694
1703
  return filePath;
1695
1704
  }
@@ -1769,4 +1778,4 @@ export {
1769
1778
  setFileSystem
1770
1779
  };
1771
1780
 
1772
- //# debugId=F4DF2394664FC23064756E2164756E21
1781
+ //# debugId=65377F2FB7FB18AE64756E2164756E21
package/dist/index.js CHANGED
@@ -848,6 +848,16 @@ class NodeFileSystem {
848
848
  async rename(oldPath, newPath) {
849
849
  await fs6.rename(oldPath, newPath);
850
850
  }
851
+ async isSymbolicLink(filePath) {
852
+ try {
853
+ return (await fs6.lstat(filePath)).isSymbolicLink();
854
+ } catch (error) {
855
+ if (this.isEnoent(error) || this.hasErrnoCode(error, "ENOTDIR")) {
856
+ return false;
857
+ }
858
+ throw error;
859
+ }
860
+ }
851
861
  async realpath(filePath) {
852
862
  try {
853
863
  return await fs6.realpath(filePath);
@@ -906,4 +916,4 @@ export {
906
916
  setFileSystem
907
917
  };
908
918
 
909
- //# debugId=CF805A08073AA6DB64756E2164756E21
919
+ //# debugId=D8F48A1283BC33FA64756E2164756E21
@@ -75,6 +75,16 @@ export interface IFileSystem {
75
75
  * platforms / backends without symlink semantics (browser).
76
76
  */
77
77
  realpath(path: string): Promise<string>;
78
+ /**
79
+ * Whether the entry at `path` is a symbolic link, judged WITHOUT
80
+ * following it (`lstat`) — so a dangling link answers true. False for a
81
+ * path with no entry. Backends without symlinks (browser, memory) always
82
+ * answer false.
83
+ *
84
+ * Optional so existing implementations and test doubles stay valid; a
85
+ * caller treats a backend without it as one that has no links.
86
+ */
87
+ isSymbolicLink?(path: string): Promise<boolean>;
78
88
  getTempDir(): Promise<string>;
79
89
  copyDirectory(sourcePath: string, destPath: string): Promise<void>;
80
90
  path: IPath;
package/dist/node.d.ts CHANGED
@@ -18,6 +18,7 @@ export declare class NodeFileSystem implements IFileSystem {
18
18
  private createLockRelease;
19
19
  rm(filePath: string): Promise<void>;
20
20
  rename(oldPath: string, newPath: string): Promise<void>;
21
+ isSymbolicLink(filePath: string): Promise<boolean>;
21
22
  realpath(filePath: string): Promise<string>;
22
23
  getTempDir(): Promise<string>;
23
24
  copyDirectory(sourcePath: string, destPath: string): Promise<void>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/filesystem",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.204.0-preview.255",
5
+ "version": "1.205.0-preview.256",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/UiPath/cli.git",
@@ -38,5 +38,5 @@
38
38
  "mihaigirleanu",
39
39
  "vlad-uipath"
40
40
  ],
41
- "gitHead": "699c58dabb59414557755a8933bcbe40aa420df3"
41
+ "gitHead": "63740c6cbb7ff282fa9118cc16a148eb030b245f"
42
42
  }