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, JsonPrimitive,
JsonValue, JsonValue,
ResolvedEncodeOptions, ResolvedEncodeOptions,
} from './types' } from '../types'
import { LIST_ITEM_MARKER } from './constants' import { LIST_ITEM_MARKER } from '../constants'
import { import {
isArrayOfArrays, isArrayOfArrays,
isArrayOfObjects, isArrayOfObjects,

View File

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

View File

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

View File

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

View File

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