@ms-cloudpack/path-utilities 3.1.6 → 3.1.8

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/isFolder.js CHANGED
@@ -4,7 +4,7 @@ export async function isFolder(itemPath) {
4
4
  const stat = await fsPromises.stat(itemPath);
5
5
  return stat.isDirectory();
6
6
  }
7
- catch (e) {
7
+ catch {
8
8
  /* no-op */
9
9
  }
10
10
  return false;
@@ -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,OAAO,CAAC,EAAE,CAAC;QACX,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 (e) {\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,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"]}
@@ -3,7 +3,7 @@ export function isFolderSync(itemPath) {
3
3
  try {
4
4
  return fs.lstatSync(itemPath)?.isDirectory();
5
5
  }
6
- catch (e) {
6
+ catch {
7
7
  /* no-op */
8
8
  }
9
9
  return false;
@@ -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,OAAO,CAAC,EAAE,CAAC;QACX,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 (e) {\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,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"]}
package/lib/resolve.js CHANGED
@@ -23,7 +23,7 @@ export async function resolve(packageName, parentPath) {
23
23
  }
24
24
  });
25
25
  }
26
- catch (e) {
26
+ catch {
27
27
  promiseResolve(undefined);
28
28
  }
29
29
  });
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,WAAmB,EAAE,UAAkB;IACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAEjE,OAAO,IAAI,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;QACpC,IAAI,CAAC;YACH,cAAc,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE;gBACxG,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;oBACzB,cAAc,CAAC,SAAS,CAAC,CAAC;gBAC5B,CAAC;qBAAM,CAAC;oBACN,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,cAAc,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from 'path';\nimport resolvePackage from 'resolve';\n\n/**\n * Resolves a package name given the parent path. This uses the `resolve` package (which does not\n * respect exports maps) to resolve `${packageName}/package.json`.\n *\n * (To resolve a path respecting exports maps, use `resolveModule` instead.)\n *\n * @param packageName - The package name.\n * @param parentPath - The parent path.\n * @returns The resolved absolute path to the package root, or undefined if it couldn't be resolved.\n */\nexport async function resolve(packageName: string, parentPath: string): Promise<string | undefined> {\n const packageRootImport = path.join(packageName, 'package.json');\n\n return new Promise((promiseResolve) => {\n try {\n resolvePackage(packageRootImport, { basedir: parentPath, preserveSymlinks: false }, (err, resolvedPath) => {\n if (err || !resolvedPath) {\n promiseResolve(undefined);\n } else {\n promiseResolve(path.dirname(resolvedPath));\n }\n });\n } catch (e) {\n promiseResolve(undefined);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,SAAS,CAAC;AAErC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,WAAmB,EAAE,UAAkB;IACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAEjE,OAAO,IAAI,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;QACpC,IAAI,CAAC;YACH,cAAc,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE;gBACxG,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;oBACzB,cAAc,CAAC,SAAS,CAAC,CAAC;gBAC5B,CAAC;qBAAM,CAAC;oBACN,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,cAAc,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from 'path';\nimport resolvePackage from 'resolve';\n\n/**\n * Resolves a package name given the parent path. This uses the `resolve` package (which does not\n * respect exports maps) to resolve `${packageName}/package.json`.\n *\n * (To resolve a path respecting exports maps, use `resolveModule` instead.)\n *\n * @param packageName - The package name.\n * @param parentPath - The parent path.\n * @returns The resolved absolute path to the package root, or undefined if it couldn't be resolved.\n */\nexport async function resolve(packageName: string, parentPath: string): Promise<string | undefined> {\n const packageRootImport = path.join(packageName, 'package.json');\n\n return new Promise((promiseResolve) => {\n try {\n resolvePackage(packageRootImport, { basedir: parentPath, preserveSymlinks: false }, (err, resolvedPath) => {\n if (err || !resolvedPath) {\n promiseResolve(undefined);\n } else {\n promiseResolve(path.dirname(resolvedPath));\n }\n });\n } catch {\n promiseResolve(undefined);\n }\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/path-utilities",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "Path utilities for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "workspace-tools": "^0.38.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@ms-cloudpack/common-types": "^0.24.20",
34
+ "@ms-cloudpack/common-types": "^0.25.1",
35
35
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
36
36
  "@ms-cloudpack/scripts": "^0.0.1",
37
37
  "@ms-cloudpack/test-utilities": "^0.5.0"