beauty-amp-core
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -6,9 +6,17 @@ const _ = require('lodash'); | ||
const beautifierSetup = { | ||
let setup = { | ||
ampscript: { | ||
capitalizeAndOrNot:true, | ||
capitalizeIfFor:true, | ||
capitalizeSet:true, | ||
capitalizeVar:true, | ||
maxParametersPerLine: 4 | ||
}, | ||
editor: { | ||
insertSpaces: true, | ||
tabSize: 4 | ||
} | ||
}; | ||
const editorSetup = { | ||
}; | ||
const logger = new Logger(); | ||
let logger = new Logger(); | ||
@@ -100,21 +108,5 @@ module.exports = { | ||
* @param {Array} lines text of your code as an Array. | ||
* @return {Array} Array of lines. | ||
* @return {String} Code as string. [subject to future change] | ||
*/ | ||
beautify(lines, setup, editorSetup) { | ||
if (!setup) { | ||
setup = { | ||
capitalizeAndOrNot:true, | ||
capitalizeIfFor:true, | ||
capitalizeSet:true, | ||
capitalizeVar:true, | ||
maxParametersPerLine: 4 | ||
}; | ||
} | ||
if (!editorSetup) { | ||
editorSetup = { | ||
insertSpaces: true, | ||
tabSize: 4 | ||
} | ||
}; | ||
beautify(lines) { | ||
// Cut blanks lines from start and end: | ||
@@ -125,3 +117,3 @@ logger.log("getCodeBlocks"); | ||
logger.log("getCodeBlocks"); | ||
const blocks = this.getCodeBlocks(lines, undefined, setup, editorSetup); | ||
const blocks = this.getCodeBlocks(lines, undefined, setup.ampscript, setup.editor); | ||
// process nesting of the blocks: | ||
@@ -139,4 +131,4 @@ logger.log("processNesting"); | ||
* Setup the logger. | ||
* @param {Object} beautifier | ||
* @param {Object} editor | ||
* @param {Object} ampscript - currently unsupported | ||
* @param {Object} editor - currently unsupported | ||
* @param {Object} logs | ||
@@ -146,5 +138,18 @@ * {string|Number} logLevel - Log level | ||
*/ | ||
setup(beautifier, editor, logs) { | ||
setup(ampscript, editor, logs) { | ||
// default: | ||
// setup.ampscript = { | ||
// capitalizeAndOrNot:true, | ||
// capitalizeIfFor:true, | ||
// capitalizeSet:true, | ||
// capitalizeVar:true, | ||
// maxParametersPerLine: 4 | ||
// }; | ||
// // default: | ||
// setup.editor = { | ||
// insertSpaces: true, | ||
// tabSize: 4 | ||
// }; | ||
logger.setup(logs); | ||
@@ -151,0 +156,0 @@ } |
@@ -0,1 +1,3 @@ | ||
BSD 4-Clause License | ||
Copyright (c) 2021, Filip Bostik (FiB) | ||
@@ -2,0 +4,0 @@ All rights reserved. |
{ | ||
"name": "beauty-amp-core", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Beautify (prettify) AMPscript for Marketing Cloud - prettifying library only.", | ||
@@ -5,0 +5,0 @@ "publisher": "FiB", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
36205
7
930
1
55