@lvce-editor/file-system-process 5.16.0 → 5.17.0
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 +7 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1894,6 +1894,12 @@ const getFileHashes = async uris => {
|
|
|
1894
1894
|
await flush();
|
|
1895
1895
|
return hashes;
|
|
1896
1896
|
};
|
|
1897
|
+
const getFileSize = async uri => {
|
|
1898
|
+
assertUri(uri);
|
|
1899
|
+
const path = fileURLToPath(uri);
|
|
1900
|
+
const stats = await fs.stat(path);
|
|
1901
|
+
return stats.size;
|
|
1902
|
+
};
|
|
1897
1903
|
const writeFile = async (uri, content, encoding = Utf8) => {
|
|
1898
1904
|
try {
|
|
1899
1905
|
assertUri(uri);
|
|
@@ -2042,9 +2048,6 @@ const rename = async (oldUri, newUri) => {
|
|
|
2042
2048
|
throw new VError(error, `Failed to rename "${oldUri}" to "${newUri}"`);
|
|
2043
2049
|
}
|
|
2044
2050
|
};
|
|
2045
|
-
const getPathSeparator = () => {
|
|
2046
|
-
return '/';
|
|
2047
|
-
};
|
|
2048
2051
|
const isReadonly = async uri => {
|
|
2049
2052
|
assertUri(uri);
|
|
2050
2053
|
const path = fileURLToPath(uri);
|
|
@@ -2163,8 +2166,8 @@ const commandMap = {
|
|
|
2163
2166
|
'FileSystem.forceRemove': forceRemove,
|
|
2164
2167
|
'FileSystem.getFileHash': getFileHash,
|
|
2165
2168
|
'FileSystem.getFileHashes': getFileHashes,
|
|
2169
|
+
'FileSystem.getFileSize': getFileSize,
|
|
2166
2170
|
'FileSystem.getFolderSize': getFolderSize,
|
|
2167
|
-
'FileSystem.getPathSeparator': getPathSeparator,
|
|
2168
2171
|
'FileSystem.isReadonly': isReadonly,
|
|
2169
2172
|
'FileSystem.mkdir': mkdir,
|
|
2170
2173
|
'FileSystem.readDirWithFileTypes': readDirWithFileTypes,
|