New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

beauty-amp-core

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beauty-amp-core - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

README.md

61

beauty-amp-core.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc