diff --git a/src/lib/components/controls/createAutoScrollHandler.ts b/src/lib/components/controls/createAutoScrollHandler.ts index fdb0636f..a8d8c358 100644 --- a/src/lib/components/controls/createAutoScrollHandler.ts +++ b/src/lib/components/controls/createAutoScrollHandler.ts @@ -18,8 +18,8 @@ export function createAutoScrollHandler(scrollableElement: Element) { return diff < 20 ? AUTO_SCROLL_SPEED_SLOW : diff < 50 - ? AUTO_SCROLL_SPEED_NORMAL - : AUTO_SCROLL_SPEED_FAST + ? AUTO_SCROLL_SPEED_NORMAL + : AUTO_SCROLL_SPEED_FAST } function autoScrollCallback() { diff --git a/src/lib/components/modes/tablemode/TableModeWelcome.svelte b/src/lib/components/modes/tablemode/TableModeWelcome.svelte index fd5951be..034d4f85 100644 --- a/src/lib/components/modes/tablemode/TableModeWelcome.svelte +++ b/src/lib/components/modes/tablemode/TableModeWelcome.svelte @@ -31,12 +31,12 @@ $: documentType = hasNestedArrays ? 'Object with nested arrays' : isEmptyDocument - ? 'An empty document' - : isJSONObject(json) - ? 'An object' - : isJSONArray(json) - ? 'An empty array' // note: can also be an array with objects but without properties - : `A ${valueType(json, parser)}` + ? 'An empty document' + : isJSONObject(json) + ? 'An object' + : isJSONArray(json) + ? 'An empty array' // note: can also be an array with objects but without properties + : `A ${valueType(json, parser)}`
diff --git a/src/lib/components/modes/treemode/contextmenu/TreeContextMenu.svelte b/src/lib/components/modes/treemode/contextmenu/TreeContextMenu.svelte index 5fe2bfff..b38a8cc8 100644 --- a/src/lib/components/modes/treemode/contextmenu/TreeContextMenu.svelte +++ b/src/lib/components/modes/treemode/contextmenu/TreeContextMenu.svelte @@ -65,8 +65,8 @@ $: editValueText = Array.isArray(focusValue) ? 'Edit array' : isObject(focusValue) - ? 'Edit object' - : 'Edit value' + ? 'Edit object' + : 'Edit value' $: hasSelectionContents = hasJson && diff --git a/src/lib/logic/actions.ts b/src/lib/logic/actions.ts index 844f29ab..4659b35d 100644 --- a/src/lib/logic/actions.ts +++ b/src/lib/logic/actions.ts @@ -460,8 +460,8 @@ export function onRemoveRow({ rowIndex < (patchedJson as JSONArray).length ? rowIndex : rowIndex > 0 - ? rowIndex - 1 - : undefined + ? rowIndex - 1 + : undefined const newSelection = newRowIndex !== undefined diff --git a/src/lib/logic/operations.ts b/src/lib/logic/operations.ts index 3666c0a5..92cffd98 100644 --- a/src/lib/logic/operations.ts +++ b/src/lib/logic/operations.ts @@ -559,8 +559,8 @@ export function createNewValue( return Array.isArray(value) ? [] : isObject(value) - ? undefined // leave object as is, will recurse into it - : '' + ? undefined // leave object as is, will recurse into it + : '' }) } else { // just a primitive value diff --git a/src/lib/logic/search.ts b/src/lib/logic/search.ts index 9b521dd0..1744b999 100644 --- a/src/lib/logic/search.ts +++ b/src/lib/logic/search.ts @@ -42,11 +42,11 @@ export function updateSearchResult( matchingActiveIndex !== -1 ? matchingActiveIndex : previousResult?.activeIndex !== undefined && - previousResult?.activeIndex < newResultItems.length - ? previousResult?.activeIndex - : newResultItems.length > 0 - ? 0 - : -1 + previousResult?.activeIndex < newResultItems.length + ? previousResult?.activeIndex + : newResultItems.length > 0 + ? 0 + : -1 const items: ExtendedSearchResultItem[] = newResultItems.map((item, index) => { return { ...item, active: index === activeIndex } @@ -68,8 +68,8 @@ export function searchNext(searchResult: SearchResult): SearchResult { searchResult.activeIndex < searchResult.items.length - 1 ? searchResult.activeIndex + 1 : searchResult.items.length > 0 - ? 0 - : -1 + ? 0 + : -1 const nextActiveItem = searchResult.items[nextActiveIndex] diff --git a/src/lib/logic/selection.ts b/src/lib/logic/selection.ts index 9c3d0fe6..042bde0c 100644 --- a/src/lib/logic/selection.ts +++ b/src/lib/logic/selection.ts @@ -331,8 +331,8 @@ export function getSelectionDown( return nextPathAfter !== null ? createValueSelection(nextPathAfter, false) : nextPath !== null - ? createValueSelection(nextPath, false) - : null + ? createValueSelection(nextPath, false) + : null } return null diff --git a/src/lib/plugins/query/javascriptQueryLanguage.ts b/src/lib/plugins/query/javascriptQueryLanguage.ts index a2b57b78..3fedd3c1 100644 --- a/src/lib/plugins/query/javascriptQueryLanguage.ts +++ b/src/lib/plugins/query/javascriptQueryLanguage.ts @@ -32,8 +32,8 @@ function createQuery(json: JSONValue, queryOptions: QueryLanguageOptions): strin typeof filterValue === 'string' ? `'${filter.value}'` : isInteger(filter.value) && !Number.isSafeInteger(filterValue) - ? `${filter.value}n` // bigint - : filter.value + ? `${filter.value}n` // bigint + : filter.value queryParts.push(` .filter(${actualValueGetter} ${filter.relation} ${filterValueStr})\n`) } diff --git a/src/lib/plugins/query/lodashQueryLanguage.ts b/src/lib/plugins/query/lodashQueryLanguage.ts index 3de07124..d5d60c44 100644 --- a/src/lib/plugins/query/lodashQueryLanguage.ts +++ b/src/lib/plugins/query/lodashQueryLanguage.ts @@ -38,8 +38,8 @@ function createQuery(json: JSONValue, queryOptions: QueryLanguageOptions): strin typeof filterValue === 'string' ? `'${filter.value}'` : isInteger(filter.value) && !Number.isSafeInteger(filterValue) - ? `${filter.value}n` // bigint - : filter.value + ? `${filter.value}n` // bigint + : filter.value queryParts.push(` .filter(${actualValueGetter} ${filter.relation} ${filterValueStr})\n`) } diff --git a/src/lib/utils/pathUtils.ts b/src/lib/utils/pathUtils.ts index f7c06453..8c725357 100644 --- a/src/lib/utils/pathUtils.ts +++ b/src/lib/utils/pathUtils.ts @@ -14,8 +14,8 @@ export function stringifyJSONPath(path: JSONPath): string { return integerNumberRegex.test(p) ? '[' + p + ']' : /[.[\]]/.test(p) || p === '' // match any character . or [ or ] and handle an empty string - ? '["' + escapeQuotes(p) + '"]' - : (index > 0 ? '.' : '') + p + ? '["' + escapeQuotes(p) + '"]' + : (index > 0 ? '.' : '') + p }) .join('') } @@ -104,8 +104,8 @@ export function createLodashPropertySelector(path: JSONPath): string { return path.length === 0 ? '' : path.every((prop) => integerNumberRegex.test(prop) || javaScriptPropertyRegex.test(prop)) - ? "'" + path.map(stringifyLodashProperty).join('').replace(/^\./, '') + "'" - : JSON.stringify(path) + ? "'" + path.map(stringifyLodashProperty).join('').replace(/^\./, '') + "'" + : JSON.stringify(path) } /**