export function convertDynamicModifiersConfigs(modifiers) {
    const parser = {};
    const schema = {};
    const serializer = {};
    modifiers.forEach((modifier) => {
        switch (modifier.type) {
            case 'parserToken': {
                const { tokenName, process } = modifier;
                parser[tokenName] = parser[tokenName] || {};
                parser[tokenName].processToken = parser[tokenName].processToken || [];
                parser[tokenName].processToken?.push(process);
                break;
            }
            case 'parserNodeAttrs': {
                const { tokenName, process } = modifier;
                parser[tokenName] = parser[tokenName] || {};
                parser[tokenName].processNodeAttrs = parser[tokenName].processNodeAttrs || [];
                parser[tokenName].processNodeAttrs?.push(process);
                break;
            }
            case 'parserNode': {
                const { nodeName, process } = modifier;
                parser[nodeName] = parser[nodeName] || {};
                parser[nodeName].processNode = parser[nodeName].processNode || [];
                parser[nodeName].processNode?.push(process);
                break;
            }
            case 'serializerNode': {
                const { nodeName, process } = modifier;
                serializer[nodeName] = serializer[nodeName] || {};
                serializer[nodeName].processNode = serializer[nodeName].processNode || [];
                serializer[nodeName].processNode?.push(process);
                break;
            }
            case 'schemaNodeSpec': {
                const { nodeName, allowedAttrs } = modifier;
                schema[nodeName] = { allowedAttrs };
                break;
            }
        }
    });
    return { parser, schema, serializer };
}
//# sourceMappingURL=dynamicModifiers.js.map
