Skip to content

Commit

Permalink
Apply prettier on processor.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedziolkaMichal committed Nov 26, 2022
1 parent 846eb15 commit 669e585
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ function getJSExampleHeightByLineCount(lineCount) {
* @returns {String} jsExample - The example wrapped into code tag
*/
function preprocessJSExample(exampleCode) {
const height = getHeightByLineCount(exampleCode, getJSExampleHeightByLineCount);
const height = getHeightByLineCount(
exampleCode,
getJSExampleHeightByLineCount
);
return `<pre><code id="static-js" data-height="${height}">${exampleCode}</code></pre>`;
}

Expand All @@ -117,8 +120,8 @@ function preprocessJSExample(exampleCode) {
* @return {String} height - BOB class name used for setting height
*/
export function getJSPageHeight(sourcePath) {
const exampleCode = fse.readFileSync(sourcePath, 'utf8');
return getHeightByLineCount(exampleCode, getJSExampleHeightByLineCount);
const exampleCode = fse.readFileSync(sourcePath, "utf8");
return getHeightByLineCount(exampleCode, getJSExampleHeightByLineCount);
}

/**
Expand Down Expand Up @@ -158,8 +161,8 @@ function preprocessWatExample(watCode, jsCode) {
* @return {Number} height - BOB class name used for setting height
*/
export function getWatPageHeight(watSrc) {
const watCode = fse.readFileSync(watSrc, 'utf8');
return getHeightByLineCount(watCode, getWatExampleHeightByLineCount);
const watCode = fse.readFileSync(watSrc, "utf8");
return getHeightByLineCount(watCode, getWatExampleHeightByLineCount);
}

/**
Expand All @@ -169,8 +172,8 @@ export function getWatPageHeight(watSrc) {
* @return {String} - BOB class name used for setting height
*/
function getHeightByLineCount(sourceCode, linesToHeightFunc) {
const lineCount = (sourceCode.match(/\n/g) || []).length + 1;
return linesToHeightFunc(lineCount);
const lineCount = (sourceCode.match(/\n/g) || []).length + 1;
return linesToHeightFunc(lineCount);
}

/**
Expand Down

0 comments on commit 669e585

Please sign in to comment.