Skip to content

Commit

Permalink
refactor: rename lineProcessor -> processLine
Browse files Browse the repository at this point in the history
  • Loading branch information
Lodin committed Jan 31, 2022
1 parent f4208ad commit b4b294e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/rollup-plugin-inject-code.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = ({insertions, lineProcessor = (line) => line}) => ({
module.exports = ({insertions, processLine = (line) => line}) => ({
name: 'inject-code',
async generateBundle(_, assets) {
Object.entries(insertions).forEach(([chunkName, chunkInsertions]) => {
const chunk = assets[chunkName];

const lines = chunk.code.split('\n').map(lineProcessor);
const lines = chunk.code.split('\n').map(processLine);

for (const {line, code} of chunkInsertions) {
switch (line) {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
},
],
},
lineProcessor(line) {
processLine(line) {
return ` ${line}`;
},
}),
Expand Down

0 comments on commit b4b294e

Please sign in to comment.