@gent-js/gent
Version:
template-based data generator.
14 lines (13 loc) • 663 B
JavaScript
class CommandDocumentFragmentImpl {
contextualStringOut;
constructor(structuredCommandExpression, commandManager, documentOptions) {
const commandOptions = structuredCommandExpression.options;
this.contextualStringOut = commandManager.getCommandContextualStringOut(structuredCommandExpression.name, commandOptions, documentOptions);
}
toString(context) {
return this.contextualStringOut(context);
}
}
export function createCommandDocumentFragment(structuredCommandExpression, commandManager, documentOptions) {
return new CommandDocumentFragmentImpl(structuredCommandExpression, commandManager, documentOptions);
}