refactor: move encode functions

This commit is contained in:
Johann Schopplich
2025-10-29 11:13:02 +01:00
parent 78d2a67347
commit b034c4455e
5 changed files with 9 additions and 9 deletions

View File

@@ -5,8 +5,8 @@ import type {
JsonPrimitive,
JsonValue,
ResolvedEncodeOptions,
} from './types'
import { LIST_ITEM_MARKER } from './constants'
} from '../types'
import { LIST_ITEM_MARKER } from '../constants'
import {
isArrayOfArrays,
isArrayOfObjects,

View File

@@ -3,7 +3,7 @@ import type {
JsonObject,
JsonPrimitive,
JsonValue,
} from './types'
} from '../types'
// #region Normalization (unknown → JsonValue)

View File

@@ -1,4 +1,4 @@
import type { JsonPrimitive } from './types'
import type { JsonPrimitive } from '../types'
import {
BACKSLASH,
COMMA,
@@ -8,7 +8,7 @@ import {
LIST_ITEM_MARKER,
NULL_LITERAL,
TRUE_LITERAL,
} from './constants'
} from '../constants'
// #region Primitive encoding

View File

@@ -1,5 +1,5 @@
import type { Depth } from './types'
import { LIST_ITEM_PREFIX } from './constants'
import type { Depth } from '../types'
import { LIST_ITEM_PREFIX } from '../constants'
export class LineWriter {
private readonly lines: string[] = []

View File

@@ -8,8 +8,8 @@ import type {
import { DEFAULT_DELIMITER } from './constants'
import { decodeValueFromLines } from './decode/decoders'
import { LineCursor, toParsedLines } from './decode/scanner'
import { encodeValue } from './encoders'
import { normalizeValue } from './normalize'
import { encodeValue } from './encode/encoders'
import { normalizeValue } from './encode/normalize'
export { DEFAULT_DELIMITER, DELIMITERS } from './constants'
export type {