diff --git a/package.json b/package.json index 80927b0..d57d434 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "omni18n", - "version": "1.1.14", + "version": "1.1.15", "exports": { ".": { "browser": { diff --git a/src/db/fileDb.ts b/src/db/fileDb.ts index bc587d4..8a1dad9 100644 --- a/src/db/fileDb.ts +++ b/src/db/fileDb.ts @@ -1,6 +1,6 @@ import { readFile, stat, writeFile } from 'node:fs/promises' import Defer from '../tools/defer' -import { WorkDictionary, type Locale, type TextKey, type Translation, type Zone } from '../types' +import type { WorkDictionary, Locale, TextKey, Translation, Zone } from '../types' import MemDB from './memDb' import serialization from './serialization' diff --git a/src/tools/cgpt-js.ts b/src/tools/cgpt-js.ts index 33f7416..30a94f4 100644 --- a/src/tools/cgpt-js.ts +++ b/src/tools/cgpt-js.ts @@ -244,7 +244,7 @@ export function parse(jsonString: string): JSONValue { return parseObject() } else if (jsonString[index] === '[') { return parseArray() - } else if (jsonString[index] === '"' || jsonString[index] === "'") { + } else if ('"\'`'.includes(jsonString[index])) { return parseString() } else { return parseLiteral() diff --git a/test/specifics.test.ts b/test/specifics.test.ts index 239b3f5..4fc17d7 100644 --- a/test/specifics.test.ts +++ b/test/specifics.test.ts @@ -119,9 +119,6 @@ describe('specifics', () => { '' ]) }) - test('errors', async () => { - // TODO test errors - }) test('fallbacks', async () => { misses.mockClear() const { Tp } = localStack({ @@ -260,7 +257,7 @@ line*/, isAdmin: true, hobbies: ["reading", "coding", "swimming"], address: {city: "New -York", country: "USA"/* -- */} +York", country: \`USA\`/* -- */} }` const expected = { name: 'John',