Skip to content

Code smell: bindingifyAddon always creates a function and pass it to rust #7514

@hyf0

Description

@hyf0

Maybe we should make an issue to track these two FIXME comments.

Originally posted by @sapphi-red in #7487 (comment)

banner: bindingifyAddon(banner),
footer: bindingifyAddon(footer),
intro: bindingifyAddon(intro),
outro: bindingifyAddon(outro),

function bindingifyAddon(
configAddon: OutputOptions[AddonKeys],
): BindingOutputOptions[AddonKeys] {
return async (chunk) => {
if (typeof configAddon === 'function') {
return configAddon(transformRenderedChunk(chunk));
}
return configAddon || '';
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions