@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 +4 -1
- package/lib/isFile.d.ts.map +1 -1
- package/lib/isFile.js +6 -4
- package/lib/isFile.js.map +1 -1
- package/lib/isFileSync.d.ts +4 -1
- package/lib/isFileSync.d.ts.map +1 -1
- package/lib/isFileSync.js +7 -5
- package/lib/isFileSync.js.map +1 -1
- package/lib/isFolder.d.ts +3 -0
- package/lib/isFolder.d.ts.map +1 -1
- package/lib/isFolder.js +4 -2
- package/lib/isFolder.js.map +1 -1
- package/lib/isFolderSync.d.ts +3 -0
- package/lib/isFolderSync.d.ts.map +1 -1
- package/lib/isFolderSync.js +6 -3
- package/lib/isFolderSync.js.map +1 -1
- package/package.json +1 -1
package/lib/isFile.d.ts
CHANGED
package/lib/isFile.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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(
|
|
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
|
|
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"]}
|
package/lib/isFileSync.d.ts
CHANGED
package/lib/isFileSync.d.ts.map
CHANGED
|
@@ -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,
|
|
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 {
|
|
2
|
-
|
|
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 =
|
|
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
|
package/lib/isFileSync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isFileSync.js","sourceRoot":"","sources":["../src/isFileSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
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
package/lib/isFolder.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
11
|
+
return false;
|
|
9
12
|
}
|
|
10
|
-
return false;
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=isFolder.js.map
|
package/lib/isFolder.js.map
CHANGED
|
@@ -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,
|
|
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"]}
|
package/lib/isFolderSync.d.ts
CHANGED
|
@@ -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,
|
|
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"}
|
package/lib/isFolderSync.js
CHANGED
|
@@ -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.
|
|
8
|
+
return fs.statSync(itemPath)?.isDirectory();
|
|
5
9
|
}
|
|
6
10
|
catch {
|
|
7
|
-
|
|
11
|
+
return false;
|
|
8
12
|
}
|
|
9
|
-
return false;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=isFolderSync.js.map
|
package/lib/isFolderSync.js.map
CHANGED
|
@@ -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,
|
|
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"]}
|