mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-29 23:34:10 +08:00
refactor: move encode functions
This commit is contained in:
@@ -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,
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
JsonObject,
|
||||
JsonPrimitive,
|
||||
JsonValue,
|
||||
} from './types'
|
||||
} from '../types'
|
||||
|
||||
// #region Normalization (unknown → JsonValue)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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[] = []
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user