Skip to content

Commit 7c4487c

Browse files
author
KIvanow
committed
RI-6231 - lint issues fixed
1 parent 51c0758 commit 7c4487c

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/rejson-details/RejsonDetails.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from 'uiSrc/slices/browser/rejson'
1010
import { RedisResponseBuffer } from 'uiSrc/slices/interfaces'
1111

12-
import { getBrackets, isRealArray, isRealObject, parseJsonData, wrapPath } from '../utils'
12+
import { getBrackets, isRealArray, isRealObject, wrapPath } from '../utils'
1313
import { BaseProps, ObjectTypes } from '../interfaces'
1414
import RejsonDynamicTypes from '../rejson-dynamic-types'
1515
import { AddItem } from '../components'
@@ -35,7 +35,6 @@ const RejsonDetails = (props: BaseProps) => {
3535
const handleFetchVisualisationResults = (path: string, forceRetrieve = false) =>
3636
dispatch<any>(fetchVisualisationResults(path, forceRetrieve))
3737

38-
3938
const handleAppendRejsonArrayItemAction = (keyName: RedisResponseBuffer, path: string, data: string) => {
4039
dispatch(appendReJSONArrayItemAction(keyName, path, data, length))
4140
}

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/rejson-scalar/RejsonScalar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react'
22
import { useDispatch } from 'react-redux'
33
import cx from 'classnames'
44

5-
import { isNull, isString } from 'lodash'
65
import { setReJSONDataAction } from 'uiSrc/slices/browser/rejson'
76
import InlineItemEditor from 'uiSrc/components/inline-item-editor/InlineItemEditor'
87
import PopoverDelete from 'uiSrc/pages/browser/components/popover-delete/PopoverDelete'

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/utils/utils.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,22 @@ describe('JSONUtils', () => {
183183
const bigIntValue = BigInt('9007199254740991')
184184
expect(stringifyScalarValue(bigIntValue)).toBe('9007199254740991')
185185
})
186-
186+
187187
it('should wrap string values in quotes', () => {
188188
expect(stringifyScalarValue('hello')).toBe('"hello"')
189189
expect(stringifyScalarValue('')).toBe('""')
190190
})
191-
191+
192192
it('should convert null to "null" string', () => {
193193
expect(stringifyScalarValue(null as any)).toBe('null')
194194
})
195-
195+
196196
it('should convert numbers to string representation', () => {
197197
expect(stringifyScalarValue(42)).toBe('42')
198198
expect(stringifyScalarValue(-123.456)).toBe('-123.456')
199199
expect(stringifyScalarValue(0)).toBe('0')
200200
})
201-
201+
202202
it('should convert boolean values to string representation', () => {
203203
expect(stringifyScalarValue(true)).toBe('true')
204204
expect(stringifyScalarValue(false)).toBe('false')

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/utils/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ const JSONParser = JSONBigInt({
7373

7474
const safeJSONParse = (value: string) => {
7575
// Pre-process the string to handle scientific notation
76-
const preprocessed = value.replace(/-?\d+\.?\d*e[+-]?\d+/gi, (match) => {
76+
const preprocessed = value.replace(/-?\d+\.?\d*e[+-]?\d+/gi, (match) =>
7777
// Wrap scientific notation numbers in quotes to prevent BigInt conversion
78-
return `"${match}"`
79-
});
80-
78+
`"${match}"`)
79+
8180
return JSONParser.parse(preprocessed, (_key: string, value: any) => {
8281
// Convert quoted scientific notation back to numbers
8382
if (typeof value === 'string' && /^-?\d+\.?\d*e[+-]?\d+$/i.test(value)) {

redisinsight/ui/src/slices/browser/rejson.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Nullable,
1414
} from 'uiSrc/utils'
1515
import successMessages from 'uiSrc/components/notifications/success-messages'
16+
import { parseJsonData } from 'uiSrc/pages/browser/modules/key-details/components/rejson-details/utils'
1617

1718
import {
1819
GetRejsonRlResponseDto,
@@ -23,7 +24,6 @@ import { refreshKeyInfoAction } from './keys'
2324
import { InitialStateRejson, RedisResponseBuffer } from '../interfaces'
2425
import { addErrorNotification, addMessageNotification } from '../app/notifications'
2526
import { AppDispatch, RootState } from '../store'
26-
import { parseJsonData } from 'uiSrc/pages/browser/modules/key-details/components/rejson-details/utils'
2727

2828
const JSON_LENGTH_TO_FORCE_RETRIEVE = 200
2929

0 commit comments

Comments
 (0)