@lvce-editor/explorer-view 7.30.1 → 7.30.2
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.
|
@@ -8020,12 +8020,17 @@ const getExplorerVirtualDom = (visibleItems, focusedIndex, root, isWide, focused
|
|
|
8020
8020
|
return dom;
|
|
8021
8021
|
};
|
|
8022
8022
|
|
|
8023
|
+
const RE_SENTENCE_END = /[.!?]$/;
|
|
8023
8024
|
const getMissingFolderMessage = root => {
|
|
8024
8025
|
if (root) {
|
|
8025
8026
|
return `Could not open "${root}" because the folder does not exist. It may have been moved or deleted.`;
|
|
8026
8027
|
}
|
|
8027
8028
|
return 'Could not open folder because the folder does not exist. It may have been moved or deleted.';
|
|
8028
8029
|
};
|
|
8030
|
+
const toSentence = message => {
|
|
8031
|
+
const normalized = `${message[0].toUpperCase()}${message.slice(1)}`;
|
|
8032
|
+
return RE_SENTENCE_END.test(normalized) ? normalized : `${normalized}.`;
|
|
8033
|
+
};
|
|
8029
8034
|
const getLoadErrorMessage = state => {
|
|
8030
8035
|
const {
|
|
8031
8036
|
errorCode,
|
|
@@ -8037,9 +8042,9 @@ const getLoadErrorMessage = state => {
|
|
|
8037
8042
|
if (errorCode === 'ENOENT') {
|
|
8038
8043
|
return getMissingFolderMessage(root);
|
|
8039
8044
|
}
|
|
8040
|
-
const code = errorCode ? ` (error code: ${errorCode})` : '';
|
|
8041
8045
|
const reason = errorMessage || 'an unexpected error occurred';
|
|
8042
|
-
|
|
8046
|
+
const code = errorCode ? ` Error code: ${errorCode}.` : '';
|
|
8047
|
+
return `Could not open folder. ${toSentence(reason)}${code}`;
|
|
8043
8048
|
}
|
|
8044
8049
|
return '';
|
|
8045
8050
|
};
|