Graceful Monkey-patching.
UNDER HEAVY CONSTRUCTION
Monkey-patching is a way to override or extend the behaviour of a method without changing its original source code.
Override
var myMonkey = obj: patchTarget method: 'sum' linesDelimiter: '\n' before: doItBefore after: doItAfter body: regexps: '/\)\n/g': addSemiQuoteFn // add ';' after each ')' '/\{/g': ' ' // add space before each'{' positions: 1: '// injection to line one' 5: '// injection to line five' 2: lineTwoInjectionFunc '6,10': '// Injection to line 6 column 10' '2,3': lineTwoColumnThreeInjectionFunc ; //...myMonkey;// ...
References
Special thanks to Thai Pangsakulyanont and his article.
LICENSE
MIT: https://github.com/se-panfilov/monkey-punch/blob/master/LICENSE