@ms-cloudpack/path-utilities 3.2.0 → 3.2.1

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/lib/isFile.d.ts CHANGED
@@ -1,2 +1,5 @@
1
- export declare function isFile(filePath: string): Promise<boolean>;
1
+ /**
2
+ * Returns true if `itemPath` is a file or a symlink to a file.
3
+ */
4
+ export declare function isFile(itemPath: string): Promise<boolean>;
2
5
  //# sourceMappingURL=isFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFile.d.ts","sourceRoot":"","sources":["../src/isFile.ts"],"names":[],"mappings":"AAEA,wBAAsB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAS/D"}
1
+ {"version":3,"file":"isFile.d.ts","sourceRoot":"","sources":["../src/isFile.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D"}
package/lib/isFile.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import fsPromises from 'fs/promises';
2
- export async function isFile(filePath) {
2
+ /**
3
+ * Returns true if `itemPath` is a file or a symlink to a file.
4
+ */
5
+ export async function isFile(itemPath) {
3
6
  try {
4
- const stat = await fsPromises.stat(filePath);
7
+ const stat = await fsPromises.stat(itemPath);
5
8
  return stat.isFile();
6
9
  }
7
10
  catch {
8
- /* */
11
+ return false;
9
12
  }
10
- return false;
11
13
  }
12
14
  //# sourceMappingURL=isFile.js.map
package/lib/isFile.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"isFile.js","sourceRoot":"","sources":["../src/isFile.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,QAAgB;IAC3C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,KAAK;IACP,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import fsPromises from 'fs/promises';\n\nexport async function isFile(filePath: string): Promise<boolean> {\n try {\n const stat = await fsPromises.stat(filePath);\n return stat.isFile();\n } catch {\n /* */\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"isFile.js","sourceRoot":"","sources":["../src/isFile.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,QAAgB;IAC3C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import fsPromises from 'fs/promises';\n\n/**\n * Returns true if `itemPath` is a file or a symlink to a file.\n */\nexport async function isFile(itemPath: string): Promise<boolean> {\n try {\n const stat = await fsPromises.stat(itemPath);\n return stat.isFile();\n } catch {\n return false;\n }\n}\n"]}
@@ -1,2 +1,5 @@
1
- export declare function isFileSync(filePath: string): boolean;
1
+ /**
2
+ * Returns true if `itemPath` is a file or a symlink to a file.
3
+ */
4
+ export declare function isFileSync(itemPath: string): boolean;
2
5
  //# sourceMappingURL=isFileSync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFileSync.d.ts","sourceRoot":"","sources":["../src/isFileSync.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CASpD"}
1
+ {"version":3,"file":"isFileSync.d.ts","sourceRoot":"","sources":["../src/isFileSync.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOpD"}
package/lib/isFileSync.js CHANGED
@@ -1,12 +1,14 @@
1
- import { lstatSync } from 'fs';
2
- export function isFileSync(filePath) {
1
+ import { statSync } from 'fs';
2
+ /**
3
+ * Returns true if `itemPath` is a file or a symlink to a file.
4
+ */
5
+ export function isFileSync(itemPath) {
3
6
  try {
4
- const stat = lstatSync(filePath);
7
+ const stat = statSync(itemPath);
5
8
  return stat.isFile();
6
9
  }
7
10
  catch {
8
- /* */
11
+ return false;
9
12
  }
10
- return false;
11
13
  }
12
14
  //# sourceMappingURL=isFileSync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFileSync.js","sourceRoot":"","sources":["../src/isFileSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,KAAK;IACP,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { lstatSync } from 'fs';\n\nexport function isFileSync(filePath: string): boolean {\n try {\n const stat = lstatSync(filePath);\n return stat.isFile();\n } catch {\n /* */\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"isFileSync.js","sourceRoot":"","sources":["../src/isFileSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import { statSync } from 'fs';\n\n/**\n * Returns true if `itemPath` is a file or a symlink to a file.\n */\nexport function isFileSync(itemPath: string): boolean {\n try {\n const stat = statSync(itemPath);\n return stat.isFile();\n } catch {\n return false;\n }\n}\n"]}
package/lib/isFolder.d.ts CHANGED
@@ -1,2 +1,5 @@
1
+ /**
2
+ * Returns true if `itemPath` is a folder or a symlink to a folder.
3
+ */
1
4
  export declare function isFolder(itemPath: string): Promise<boolean>;
2
5
  //# sourceMappingURL=isFolder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFolder.d.ts","sourceRoot":"","sources":["../src/isFolder.ts"],"names":[],"mappings":"AAEA,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CASjE"}
1
+ {"version":3,"file":"isFolder.d.ts","sourceRoot":"","sources":["../src/isFolder.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOjE"}
package/lib/isFolder.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import fsPromises from 'fs/promises';
2
+ /**
3
+ * Returns true if `itemPath` is a folder or a symlink to a folder.
4
+ */
2
5
  export async function isFolder(itemPath) {
3
6
  try {
4
7
  const stat = await fsPromises.stat(itemPath);
5
8
  return stat.isDirectory();
6
9
  }
7
10
  catch {
8
- /* no-op */
11
+ return false;
9
12
  }
10
- return false;
11
13
  }
12
14
  //# sourceMappingURL=isFolder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFolder.js","sourceRoot":"","sources":["../src/isFolder.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import fsPromises from 'fs/promises';\n\nexport async function isFolder(itemPath: string): Promise<boolean> {\n try {\n const stat = await fsPromises.stat(itemPath);\n return stat.isDirectory();\n } catch {\n /* no-op */\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"isFolder.js","sourceRoot":"","sources":["../src/isFolder.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import fsPromises from 'fs/promises';\n\n/**\n * Returns true if `itemPath` is a folder or a symlink to a folder.\n */\nexport async function isFolder(itemPath: string): Promise<boolean> {\n try {\n const stat = await fsPromises.stat(itemPath);\n return stat.isDirectory();\n } catch {\n return false;\n }\n}\n"]}
@@ -1,2 +1,5 @@
1
+ /**
2
+ * Returns true if `itemPath` is a folder or a symlink to a folder.
3
+ */
1
4
  export declare function isFolderSync(itemPath: string): boolean;
2
5
  //# sourceMappingURL=isFolderSync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFolderSync.d.ts","sourceRoot":"","sources":["../src/isFolderSync.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQtD"}
1
+ {"version":3,"file":"isFolderSync.d.ts","sourceRoot":"","sources":["../src/isFolderSync.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAMtD"}
@@ -1,11 +1,14 @@
1
1
  import fs from 'fs';
2
+ /**
3
+ * Returns true if `itemPath` is a folder or a symlink to a folder.
4
+ */
5
+ // This is tested in isFolder.test.ts
2
6
  export function isFolderSync(itemPath) {
3
7
  try {
4
- return fs.lstatSync(itemPath)?.isDirectory();
8
+ return fs.statSync(itemPath)?.isDirectory();
5
9
  }
6
10
  catch {
7
- /* no-op */
11
+ return false;
8
12
  }
9
- return false;
10
13
  }
11
14
  //# sourceMappingURL=isFolderSync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFolderSync.js","sourceRoot":"","sources":["../src/isFolderSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import fs from 'fs';\n\nexport function isFolderSync(itemPath: string): boolean {\n try {\n return fs.lstatSync(itemPath)?.isDirectory();\n } catch {\n /* no-op */\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"isFolderSync.js","sourceRoot":"","sources":["../src/isFolderSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB;;GAEG;AACH,qCAAqC;AACrC,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import fs from 'fs';\n\n/**\n * Returns true if `itemPath` is a folder or a symlink to a folder.\n */\n// This is tested in isFolder.test.ts\nexport function isFolderSync(itemPath: string): boolean {\n try {\n return fs.statSync(itemPath)?.isDirectory();\n } catch {\n return false;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/path-utilities",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Path utilities for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",