@lvce-editor/editor-worker 19.79.0 → 19.79.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.
package/dist/diff-sdk.js CHANGED
@@ -15954,7 +15954,7 @@ const applyWorkspaceEdit = async (editor, changes) => {
15954
15954
  // Registered through wrapCommand, so validation and the edit share the
15955
15955
  // document's command queue with typing and edits from other callers.
15956
15956
  const compareAndSetText = async (editor, uri, expectedText, text, applicationId) => {
15957
- if (!applicationId || editor.applicationId !== applicationId || editor.uri !== uri) {
15957
+ if (applicationId === '' || editor.applicationId !== applicationId || editor.uri !== uri) {
15958
15958
  throw new Error('The editor document no longer belongs to this application and URI');
15959
15959
  }
15960
15960
  if (typeof expectedText !== 'string' || typeof text !== 'string') {
@@ -16218,7 +16218,7 @@ const getLanguageByExtension = (languages, extensionLower) => {
16218
16218
  };
16219
16219
  const getLanguageByFileName = (languages, fileNameLower) => {
16220
16220
  for (const language of languages) {
16221
- if (language && language.fileNames && Array.isArray(language.fileNames) && language.fileNames.includes(fileNameLower)) {
16221
+ if (Array.isArray(language?.fileNames) && language.fileNames.some(fileName => typeof fileName === 'string' && fileName.toLowerCase() === fileNameLower)) {
16222
16222
  return language.id;
16223
16223
  }
16224
16224
  }
@@ -16405,7 +16405,7 @@ const applyWorkspaceEdit = async (editor, changes) => {
16405
16405
  // Registered through wrapCommand, so validation and the edit share the
16406
16406
  // document's command queue with typing and edits from other callers.
16407
16407
  const compareAndSetText = async (editor, uri, expectedText, text, applicationId) => {
16408
- if (!applicationId || editor.applicationId !== applicationId || editor.uri !== uri) {
16408
+ if (applicationId === '' || editor.applicationId !== applicationId || editor.uri !== uri) {
16409
16409
  throw new Error('The editor document no longer belongs to this application and URI');
16410
16410
  }
16411
16411
  if (typeof expectedText !== 'string' || typeof text !== 'string') {
@@ -16669,7 +16669,7 @@ const getLanguageByExtension = (languages, extensionLower) => {
16669
16669
  };
16670
16670
  const getLanguageByFileName = (languages, fileNameLower) => {
16671
16671
  for (const language of languages) {
16672
- if (language && language.fileNames && Array.isArray(language.fileNames) && language.fileNames.includes(fileNameLower)) {
16672
+ if (Array.isArray(language?.fileNames) && language.fileNames.some(fileName => typeof fileName === 'string' && fileName.toLowerCase() === fileNameLower)) {
16673
16673
  return language.id;
16674
16674
  }
16675
16675
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.79.0",
3
+ "version": "19.79.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"