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

@botmock/export

Package Overview
Dependencies
Maintainers
5
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botmock/export - npm Package Compare versions

Comparing version 0.7.1 to 0.8.0

24

lib/write/index.js

@@ -72,2 +72,9 @@ "use strict";

_transformMd.set(this, (data, options) => {
let LG;
(function (LG) {
LG["OPEN_BRACE"] = "[";
LG["CLOSE_BRACE"] = "]";
LG["IF"] = "IF";
LG["ELSE_IF"] = "ELSEIF";
})(LG || (LG = {}));
let MD;

@@ -86,2 +93,19 @@ (function (MD) {

}
else if (values.hasOwnProperty("brace")) {
const [firstKey] = Object.keys(values.brace);
values = `${LG.OPEN_BRACE}${firstKey}\n\tAttachments = \${${values[firstKey]}()}${LG.CLOSE_BRACE}${os_1.EOL}`;
}
else if (values.hasOwnProperty("conditions")) {
values = values.conditions.reduce((str, conditionTuple, i) => {
let conditionType;
if (i === 0) {
conditionType = LG.IF;
}
else {
conditionType = LG.ELSE_IF;
}
const [condition, response] = conditionTuple;
return `${str}- ${conditionType}: ${condition}${os_1.EOL}\t- ${response}${os_1.EOL}`;
}, "");
}
else {

@@ -88,0 +112,0 @@ const keys = Object.keys(values);

4

package.json
{
"name": "@botmock/export",
"version": "0.7.1",
"version": "0.8.0",
"description": "",

@@ -49,3 +49,3 @@ "contributors": [

"devDependencies": {
"@types/jest": "25.2.3",
"@types/jest": "26.0.3",
"jest": "26.1.0",

@@ -52,0 +52,0 @@ "pascal-case": "3.1.1",

@@ -139,3 +139,9 @@ import { stringify } from "yaml";

*/
#transformMd = <T = LowLevelAsset<any>["data"]>(data: T, options?: { shouldUseH1: boolean; }): string => {
#transformMd = <T = LowLevelAsset<any>["data"]>(data: T, options?: { shouldUseH1?: boolean; }): string => {
enum LG {
OPEN_BRACE = "[",
CLOSE_BRACE = "]",
IF = "IF",
ELSE_IF = "ELSEIF",
}
enum MD {

@@ -149,5 +155,21 @@ H1 = "#",

return Object.keys(object).reduce((str, key) => {
let values: unknown = object[key];
let values: any = object[key];
if (Array.isArray(values)) {
values = values.map(value => ` ${MD.L2} ${value}`).join(EOL);
} else if (values.hasOwnProperty("brace")) {
const [firstKey] = Object.keys(values.brace);
values = `${LG.OPEN_BRACE}${firstKey}\n\tAttachments = \${${values[firstKey]}()}${LG.CLOSE_BRACE}${EOL}`;
} else if (values.hasOwnProperty("conditions")) {
// @ts-ignore
values = values.conditions.reduce((str: string, conditionTuple: [string, string], i) => {
let conditionType: LG;
if (i === 0) {
conditionType = LG.IF;
} else {
conditionType = LG.ELSE_IF;
}
const [condition, response] = conditionTuple;
return `${str}- ${conditionType}: ${condition}${EOL}\t- ${response}${EOL}`;
}, "");
} else {

@@ -169,2 +191,5 @@ const keys = Object.keys(values as object);

#transformLg = <T = LowLevelAsset<any>["data"]>(data: T): string => {
// const braces = Object.keys(data).reduce((dataset, key) => {
// return {}
// }, {})
const raw = this.#transformMd(data, { shouldUseH1: true });

@@ -171,0 +196,0 @@ return raw;

Sorry, the diff of this file is not supported yet

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