From b6f37281dee58457c4cc793728a0057106e0d3eb Mon Sep 17 00:00:00 2001 From: "Alexis H. Munsayac" Date: Fri, 8 Sep 2023 21:26:19 +0800 Subject: [PATCH] Remove cross JSON methods --- packages/seroval/src/core/cross/index.ts | 72 ++++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/seroval/src/core/cross/index.ts b/packages/seroval/src/core/cross/index.ts index 9cd539b5..5ea2edc5 100644 --- a/packages/seroval/src/core/cross/index.ts +++ b/packages/seroval/src/core/cross/index.ts @@ -2,7 +2,7 @@ import { Feature } from '../compat'; import { ROOT_REFERENCE, } from '../keys'; -import type { SerovalNode } from '../types'; +// import type { SerovalNode } from '../types'; import parseAsync from './async'; import type { CrossParserContextOptions, @@ -73,44 +73,44 @@ export async function crossSerializeAsync( ); } -export interface SerovalCrossJSON { - t: SerovalNode; - f: number; -} +// export interface SerovalCrossJSON { +// t: SerovalNode; +// f: number; +// } -export function toCrossJSON( - source: T, - options?: CrossParserContextOptions, -): SerovalCrossJSON { - const ctx = createCrossParserContext(options); - return { - t: parseSync(ctx, source), - f: ctx.features, - }; -} +// export function toCrossJSON( +// source: T, +// options?: CrossParserContextOptions, +// ): SerovalCrossJSON { +// const ctx = createCrossParserContext(options); +// return { +// t: parseSync(ctx, source), +// f: ctx.features, +// }; +// } -export async function toCrossJSONAsync( - source: T, - options?: CrossParserContextOptions, -): Promise { - const ctx = createCrossParserContext(options); - return { - t: await parseAsync(ctx, source), - f: ctx.features, - }; -} +// export async function toCrossJSONAsync( +// source: T, +// options?: CrossParserContextOptions, +// ): Promise { +// const ctx = createCrossParserContext(options); +// return { +// t: await parseAsync(ctx, source), +// f: ctx.features, +// }; +// } -export function compileCrossJSON(source: SerovalCrossJSON): string { - const serial = createCrossSerializerContext({ - features: source.f, - }); - const result = crossSerializeTree(serial, source.t); - return finalize( - serial, - source.t.i, - result, - ); -} +// export function compileCrossJSON(source: SerovalCrossJSON): string { +// const serial = createCrossSerializerContext({ +// features: source.f, +// }); +// const result = crossSerializeTree(serial, source.t); +// return finalize( +// serial, +// source.t.i, +// result, +// ); +// } // export function fromJSON(source: SerovalJSON): T { // const serial = createDeserializerContext({