leetgo
leetgo copied to clipboard
Added pre submit code modifiers
added modifiers for modifying code just before submission
example usage:
kotlin:
out_dir: src
post-modifiers:
- script: |
function modify(code) {
return `class Solution {\n ${code.split('\n').join('\n ')}\n}`;
}
modifiers:
- name: removeUselessComments
- script: |
function modify(code) {
const functionBodyMatch = code.match(/class Solution \{([\s\S]+)\}/);
if (functionBodyMatch) {
return functionBodyMatch[1].trim();
}
return '';
}