yaml-unist-parser
Version:
A YAML parser that produces output compatible with unist
13 lines (11 loc) • 618 B
JavaScript
import { extractComments } from "../utils/extract-comments.mjs";
import { createQuoteValue } from "../factories/quote-value.mjs";
//#region src/transforms/quote-value.ts
function transformAstQuoteValue(quoteValue, srcToken, context, props) {
for (const token of extractComments(srcToken.end, context))
// istanbul ignore next -- @preserve
throw new Error(`Unexpected token type in quote value end: ${token.type}`);
return createQuoteValue(context.transformRange(quoteValue.range), context.transformContentProperties(quoteValue, props.tokens), quoteValue.source);
}
//#endregion
export { transformAstQuoteValue };