优化构架

This commit is contained in:
2026-08-03 18:49:18 +08:00
parent 1241d11c01
commit 44c33a6280
133 changed files with 651 additions and 603 deletions
+15
View File
@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest'
import { parseApiJsonResponse, parseJsonWithSafeIntegers } from '@chongchong/shared'
describe('safe integer API parsing', () => {
it('preserves backend long IDs as strings', () => {
expect(parseJsonWithSafeIntegers('{"id":2082674456475418625,"page":1}')).toEqual({
id: '2082674456475418625',
page: 1,
})
})
it('leaves non-JSON responses untouched', () => {
expect(parseApiJsonResponse('plain text')).toBe('plain text')
})
})