Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

table

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

table - npm Package Compare versions

Comparing version
6.0.7
to
6.0.8
+5
-5
dist/alignString.js

@@ -8,5 +8,5 @@ "use strict";

var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
var _isNumberObject = _interopRequireDefault(require("is-number-object"));
var _isString2 = _interopRequireDefault(require("lodash/isString"));
var _isString = _interopRequireDefault(require("is-string"));

@@ -67,7 +67,7 @@ var _stringWidth = _interopRequireDefault(require("string-width"));

const alignString = (subject, containerWidth, alignment) => {
if (!(0, _isString2.default)(subject)) {
if (!(0, _isString.default)(subject)) {
throw new TypeError('Subject parameter value must be a string.');
}
if (!(0, _isNumber2.default)(containerWidth)) {
if (!(0, _isNumberObject.default)(containerWidth)) {
throw new TypeError('Container width parameter value must be a number.');

@@ -83,3 +83,3 @@ }

if (!(0, _isString2.default)(alignment)) {
if (!(0, _isString.default)(alignment)) {
throw new TypeError('Alignment parameter value must be a string.');

@@ -86,0 +86,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/alignString.js"],"names":["alignments","alignLeft","subject","width","repeat","alignRight","alignCenter","halfWidth","Math","floor","containerWidth","alignment","TypeError","subjectWidth","Error","includes","availableWidth"],"mappings":";;;;;;;;;;;AACA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,MADiB,EAEjB,OAFiB,EAGjB,QAHiB,CAAnB;AAMA;AACA;AACA;AACA;AACA;;AACA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAUC,KAAV,KAAoB;AACpC,SAAOD,OAAO,GAAG,IAAIE,MAAJ,CAAWD,KAAX,CAAjB;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;;;AACA,MAAME,UAAU,GAAG,CAACH,OAAD,EAAUC,KAAV,KAAoB;AACrC,SAAO,IAAI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;AACtB,WAAO,IAAIT,MAAJ,CAAWM,cAAX,CAAP;AACD;;AAED,QAAMM,cAAc,GAAGN,cAAc,GAAGG,YAAxC;;AAEA,MAAIF,SAAS,KAAK,MAAlB,EAA0B;AACxB,WAAOV,SAAS,CAACC,OAAD,EAAUc,cAAV,CAAhB;AACD;;AAED,MAAIL,SAAS,KAAK,OAAlB,EAA2B;AACzB,WAAON,UAAU,CAACH,OAAD,EAAUc,cAAV,CAAjB;AACD;;AAED,SAAOV,WAAW,CAACJ,OAAD,EAAUc,cAAV,CAAlB;AACD,C","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\n\nconst alignments = [\n 'left',\n 'right',\n 'center',\n];\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignLeft = (subject, width) => {\n return subject + ' '.repeat(width);\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignRight = (subject, width) => {\n return ' '.repeat(width) + subject;\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignCenter = (subject, width) => {\n let halfWidth;\n\n halfWidth = width / 2;\n\n if (width % 2 === 0) {\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth);\n } else {\n halfWidth = Math.floor(halfWidth);\n\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);\n }\n};\n\n/**\n * Pads a string to the left and/or right to position the subject\n * text in a desired alignment within a container.\n *\n * @param {string} subject\n * @param {number} containerWidth\n * @param {string} alignment One of the valid options (left, right, center).\n * @returns {string}\n */\nexport default (subject, containerWidth, alignment) => {\n if (!_.isString(subject)) {\n throw new TypeError('Subject parameter value must be a string.');\n }\n\n if (!_.isNumber(containerWidth)) {\n throw new TypeError('Container width parameter value must be a number.');\n }\n\n const subjectWidth = stringWidth(subject);\n\n if (subjectWidth > containerWidth) {\n // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject);\n\n throw new Error('Subject parameter value width cannot be greater than the container width.');\n }\n\n if (!_.isString(alignment)) {\n throw new TypeError('Alignment parameter value must be a string.');\n }\n\n if (!alignments.includes(alignment)) {\n throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');\n }\n\n if (subjectWidth === 0) {\n return ' '.repeat(containerWidth);\n }\n\n const availableWidth = containerWidth - subjectWidth;\n\n if (alignment === 'left') {\n return alignLeft(subject, availableWidth);\n }\n\n if (alignment === 'right') {\n return alignRight(subject, availableWidth);\n }\n\n return alignCenter(subject, availableWidth);\n};\n"],"file":"alignString.js"}
{"version":3,"sources":["../src/alignString.js"],"names":["alignments","alignLeft","subject","width","repeat","alignRight","alignCenter","halfWidth","Math","floor","containerWidth","alignment","TypeError","subjectWidth","Error","includes","availableWidth"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,MADiB,EAEjB,OAFiB,EAGjB,QAHiB,CAAnB;AAMA;AACA;AACA;AACA;AACA;;AACA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAUC,KAAV,KAAoB;AACpC,SAAOD,OAAO,GAAG,IAAIE,MAAJ,CAAWD,KAAX,CAAjB;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;;;AACA,MAAME,UAAU,GAAG,CAACH,OAAD,EAAUC,KAAV,KAAoB;AACrC,SAAO,IAAIC,MAAJ,CAAWD,KAAX,IAAoBD,OAA3B;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;;;AACA,MAAMI,WAAW,GAAG,CAACJ,OAAD,EAAUC,KAAV,KAAoB;AACtC,MAAII,SAAJ;AAEAA,EAAAA,SAAS,GAAGJ,KAAK,GAAG,CAApB;;AAEA,MAAIA,KAAK,GAAG,CAAR,KAAc,CAAlB,EAAqB;AACnB,WAAO,IAAIC,MAAJ,CAAWG,SAAX,IAAwBL,OAAxB,GAAkC,IAAIE,MAAJ,CAAWG,SAAX,CAAzC;AACD,GAFD,MAEO;AACLA,IAAAA,SAAS,GAAGC,IAAI,CAACC,KAAL,CAAWF,SAAX,CAAZ;AAEA,WAAO,IAAIH,MAAJ,CAAWG,SAAX,IAAwBL,OAAxB,GAAkC,IAAIE,MAAJ,CAAWG,SAAS,GAAG,CAAvB,CAAzC;AACD;AACF,CAZD;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;qBACgBL,O,EAASQ,c,EAAgBC,S,KAAc;AACrD,MAAI,CAAC,uBAAST,OAAT,CAAL,EAAwB;AACtB,UAAM,IAAIU,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAED,MAAI,CAAC,6BAASF,cAAT,CAAL,EAA+B;AAC7B,UAAM,IAAIE,SAAJ,CAAc,mDAAd,CAAN;AACD;;AAED,QAAMC,YAAY,GAAG,0BAAYX,OAAZ,CAArB;;AAEA,MAAIW,YAAY,GAAGH,cAAnB,EAAmC;AACjC;AAEA,UAAM,IAAII,KAAJ,CAAU,2EAAV,CAAN;AACD;;AAED,MAAI,CAAC,uBAASH,SAAT,CAAL,EAA0B;AACxB,UAAM,IAAIC,SAAJ,CAAc,6CAAd,CAAN;AACD;;AAED,MAAI,CAACZ,UAAU,CAACe,QAAX,CAAoBJ,SAApB,CAAL,EAAqC;AACnC,UAAM,IAAIG,KAAJ,CAAU,4FAAV,CAAN;AACD;;AAED,MAAID,YAAY,KAAK,CAArB,EAAwB;AACtB,WAAO,IAAIT,MAAJ,CAAWM,cAAX,CAAP;AACD;;AAED,QAAMM,cAAc,GAAGN,cAAc,GAAGG,YAAxC;;AAEA,MAAIF,SAAS,KAAK,MAAlB,EAA0B;AACxB,WAAOV,SAAS,CAACC,OAAD,EAAUc,cAAV,CAAhB;AACD;;AAED,MAAIL,SAAS,KAAK,OAAlB,EAA2B;AACzB,WAAON,UAAU,CAACH,OAAD,EAAUc,cAAV,CAAjB;AACD;;AAED,SAAOV,WAAW,CAACJ,OAAD,EAAUc,cAAV,CAAlB;AACD,C","sourcesContent":["import isNumber from 'is-number-object';\nimport isString from 'is-string';\nimport stringWidth from 'string-width';\n\nconst alignments = [\n 'left',\n 'right',\n 'center',\n];\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignLeft = (subject, width) => {\n return subject + ' '.repeat(width);\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignRight = (subject, width) => {\n return ' '.repeat(width) + subject;\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nconst alignCenter = (subject, width) => {\n let halfWidth;\n\n halfWidth = width / 2;\n\n if (width % 2 === 0) {\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth);\n } else {\n halfWidth = Math.floor(halfWidth);\n\n return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);\n }\n};\n\n/**\n * Pads a string to the left and/or right to position the subject\n * text in a desired alignment within a container.\n *\n * @param {string} subject\n * @param {number} containerWidth\n * @param {string} alignment One of the valid options (left, right, center).\n * @returns {string}\n */\nexport default (subject, containerWidth, alignment) => {\n if (!isString(subject)) {\n throw new TypeError('Subject parameter value must be a string.');\n }\n\n if (!isNumber(containerWidth)) {\n throw new TypeError('Container width parameter value must be a number.');\n }\n\n const subjectWidth = stringWidth(subject);\n\n if (subjectWidth > containerWidth) {\n // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject);\n\n throw new Error('Subject parameter value width cannot be greater than the container width.');\n }\n\n if (!isString(alignment)) {\n throw new TypeError('Alignment parameter value must be a string.');\n }\n\n if (!alignments.includes(alignment)) {\n throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');\n }\n\n if (subjectWidth === 0) {\n return ' '.repeat(containerWidth);\n }\n\n const availableWidth = containerWidth - subjectWidth;\n\n if (alignment === 'left') {\n return alignLeft(subject, availableWidth);\n }\n\n if (alignment === 'right') {\n return alignRight(subject, availableWidth);\n }\n\n return alignCenter(subject, availableWidth);\n};\n"],"file":"alignString.js"}

@@ -8,3 +8,3 @@ "use strict";

var _isString2 = _interopRequireDefault(require("lodash/isString"));
var _isString = _interopRequireDefault(require("is-string"));

@@ -22,3 +22,3 @@ var _wrapCell = _interopRequireDefault(require("./wrapCell"));

const calculateCellHeight = (value, columnWidth, useWrapWord = false) => {
if (!(0, _isString2.default)(value)) {
if (!(0, _isString.default)(value)) {
throw new TypeError('Value must be a string.');

@@ -25,0 +25,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","TypeError","Number","isInteger","Error","length"],"mappings":";;;;;;;;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;6BACgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAAC,wBAAWF,KAAX,CAAL,EAAwB;AACtB,UAAM,IAAIG,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBJ,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAIE,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIF,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIK,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,SAAO,uBAASN,KAAT,EAAgBC,WAAhB,EAA6BC,WAA7B,EAA0CK,MAAjD;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!_.isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n return wrapCell(value, columnWidth, useWrapWord).length;\n};\n"],"file":"calculateCellHeight.js"}
{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","TypeError","Number","isInteger","Error","length"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;6BACgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAAC,uBAASF,KAAT,CAAL,EAAsB;AACpB,UAAM,IAAIG,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBJ,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAIE,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIF,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIK,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,SAAO,uBAASN,KAAT,EAAgBC,WAAhB,EAA6BC,WAA7B,EAA0CK,MAAjD;AACD,C","sourcesContent":["import isString from 'is-string';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n return wrapCell(value, columnWidth, useWrapWord).length;\n};\n"],"file":"calculateCellHeight.js"}

@@ -8,8 +8,6 @@ "use strict";

var _max2 = _interopRequireDefault(require("lodash/max"));
var _isBooleanObject = _interopRequireDefault(require("is-boolean-object"));
var _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean"));
var _isNumberObject = _interopRequireDefault(require("is-number-object"));
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
var _calculateCellHeight = _interopRequireDefault(require("./calculateCellHeight"));

@@ -32,7 +30,7 @@

cells.forEach((value, index1) => {
if (!(0, _isNumber2.default)(config.columns[index1].width)) {
if (!(0, _isNumberObject.default)(config.columns[index1].width)) {
throw new TypeError('column[index].width must be a number.');
}
if (!(0, _isBoolean2.default)(config.columns[index1].wrapWord)) {
if (!(0, _isBooleanObject.default)(config.columns[index1].wrapWord)) {
throw new TypeError('column[index].wrapWord must be a boolean.');

@@ -43,3 +41,3 @@ }

});
rowSpanIndex.push((0, _max2.default)(cellHeightIndex));
rowSpanIndex.push(Math.max(...cellHeightIndex));
});

@@ -46,0 +44,0 @@ return rowSpanIndex;

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/calculateRowHeightIndex.js"],"names":["rows","config","tableWidth","length","rowSpanIndex","forEach","cells","cellHeightIndex","Array","fill","value","index1","columns","width","TypeError","wrapWord","push"],"mappings":";;;;;;;;;;;;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;iCACgBA,I,EAAMC,M,KAAW;AAC/B,QAAMC,UAAU,GAAGF,IAAI,CAAC,CAAD,CAAJ,CAAQG,MAA3B;AAEA,QAAMC,YAAY,GAAG,EAArB;AAEAJ,EAAAA,IAAI,CAACK,OAAL,CAAcC,KAAD,IAAW;AACtB,UAAMC,eAAe,GAAG,IAAIC,KAAJ,CAAUN,UAAV,EAAsBO,IAAtB,CAA2B,CAA3B,CAAxB;AAEAH,IAAAA,KAAK,CAACD,OAAN,CAAc,CAACK,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAI,CAAC,wBAAWV,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlC,CAAL,EAA+C;AAC7C,cAAM,IAAIC,SAAJ,CAAc,uCAAd,CAAN;AACD;;AAED,UAAI,CAAC,yBAAYb,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAnC,CAAL,EAAmD;AACjD,cAAM,IAAID,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAEDP,MAAAA,eAAe,CAACI,MAAD,CAAf,GAA0B,kCAAoBD,KAApB,EAA2BT,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlD,EAAyDZ,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAhF,CAA1B;AACD,KAVD;AAYAX,IAAAA,YAAY,CAACY,IAAb,CAAkB,mBAAMT,eAAN,CAAlB;AACD,GAhBD;AAkBA,SAAOH,YAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport calculateCellHeight from './calculateCellHeight';\n\n/**\n * Calculates the vertical row span index.\n *\n * @param {Array[]} rows\n * @param {object} config\n * @returns {number[]}\n */\nexport default (rows, config) => {\n const tableWidth = rows[0].length;\n\n const rowSpanIndex = [];\n\n rows.forEach((cells) => {\n const cellHeightIndex = new Array(tableWidth).fill(1);\n\n cells.forEach((value, index1) => {\n if (!_.isNumber(config.columns[index1].width)) {\n throw new TypeError('column[index].width must be a number.');\n }\n\n if (!_.isBoolean(config.columns[index1].wrapWord)) {\n throw new TypeError('column[index].wrapWord must be a boolean.');\n }\n\n cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord);\n });\n\n rowSpanIndex.push(_.max(cellHeightIndex));\n });\n\n return rowSpanIndex;\n};\n"],"file":"calculateRowHeightIndex.js"}
{"version":3,"sources":["../src/calculateRowHeightIndex.js"],"names":["rows","config","tableWidth","length","rowSpanIndex","forEach","cells","cellHeightIndex","Array","fill","value","index1","columns","width","TypeError","wrapWord","push","Math","max"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;iCACgBA,I,EAAMC,M,KAAW;AAC/B,QAAMC,UAAU,GAAGF,IAAI,CAAC,CAAD,CAAJ,CAAQG,MAA3B;AAEA,QAAMC,YAAY,GAAG,EAArB;AAEAJ,EAAAA,IAAI,CAACK,OAAL,CAAcC,KAAD,IAAW;AACtB,UAAMC,eAAe,GAAG,IAAIC,KAAJ,CAAUN,UAAV,EAAsBO,IAAtB,CAA2B,CAA3B,CAAxB;AAEAH,IAAAA,KAAK,CAACD,OAAN,CAAc,CAACK,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAI,CAAC,6BAASV,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAhC,CAAL,EAA6C;AAC3C,cAAM,IAAIC,SAAJ,CAAc,uCAAd,CAAN;AACD;;AAED,UAAI,CAAC,8BAAUb,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAjC,CAAL,EAAiD;AAC/C,cAAM,IAAID,SAAJ,CAAc,2CAAd,CAAN;AACD;;AAEDP,MAAAA,eAAe,CAACI,MAAD,CAAf,GAA0B,kCAAoBD,KAApB,EAA2BT,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBE,KAAlD,EAAyDZ,MAAM,CAACW,OAAP,CAAeD,MAAf,EAAuBI,QAAhF,CAA1B;AACD,KAVD;AAYAX,IAAAA,YAAY,CAACY,IAAb,CAAkBC,IAAI,CAACC,GAAL,CAAS,GAAGX,eAAZ,CAAlB;AACD,GAhBD;AAkBA,SAAOH,YAAP;AACD,C","sourcesContent":["import isBoolean from 'is-boolean-object';\nimport isNumber from 'is-number-object';\nimport calculateCellHeight from './calculateCellHeight';\n\n/**\n * Calculates the vertical row span index.\n *\n * @param {Array[]} rows\n * @param {object} config\n * @returns {number[]}\n */\nexport default (rows, config) => {\n const tableWidth = rows[0].length;\n\n const rowSpanIndex = [];\n\n rows.forEach((cells) => {\n const cellHeightIndex = new Array(tableWidth).fill(1);\n\n cells.forEach((value, index1) => {\n if (!isNumber(config.columns[index1].width)) {\n throw new TypeError('column[index].width must be a number.');\n }\n\n if (!isBoolean(config.columns[index1].wrapWord)) {\n throw new TypeError('column[index].wrapWord must be a boolean.');\n }\n\n cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord);\n });\n\n rowSpanIndex.push(Math.max(...cellHeightIndex));\n });\n\n return rowSpanIndex;\n};\n"],"file":"calculateRowHeightIndex.js"}

@@ -8,4 +8,2 @@ "use strict";

var _mapValues2 = _interopRequireDefault(require("lodash/mapValues"));
var _alignTableData = _interopRequireDefault(require("./alignTableData"));

@@ -101,5 +99,5 @@

const config = (0, _makeStreamConfig.default)(userConfig);
const columnWidthIndex = Object.values((0, _mapValues2.default)(config.columns, column => {
const columnWidthIndex = Object.values(config.columns).map(column => {
return column.width + column.paddingLeft + column.paddingRight;
}));
});
let empty;

@@ -106,0 +104,0 @@ empty = true;

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/createStream.js"],"names":["prepareData","data","config","rows","rowHeightIndex","create","row","columnWidthIndex","body","map","literalRow","border","join","output","trimEnd","process","stdout","write","append","bottom","userConfig","Object","values","columns","column","width","paddingLeft","paddingRight","empty","length","columnCount","Error"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACpC,MAAIC,IAAJ;AAEAA,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEAE,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBC,MAAxB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBD,IAAxB,EAA8BD,MAA9B,CAAvB;AAEAC,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCC,cAAjC,EAAiDF,MAAjD,CAAP;AACAC,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBD,MAArB,CAAP;AACAC,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBD,MAAnB,CAAP;AAEA,SAAOC,IAAP;AACD,CAdD;AAgBA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,MAAM,GAAG,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,KAAmC;AAChD,QAAMC,IAAI,GAAGH,WAAW,CAAC,CAACM,GAAD,CAAD,EAAQJ,MAAR,CAAxB;AAEA,QAAMM,IAAI,GAAGL,IAAI,CAACM,GAAL,CAAUC,UAAD,IAAgB;AACpC,WAAO,sBAAQA,UAAR,EAAoBR,MAAM,CAACS,MAA3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AACA;AACA;;;sBACgBO,UAAU,GAAG,E,KAAO;AAClC,QAAMlB,MAAM,GAAG,+BAAiBkB,UAAjB,CAAf;AAEA,QAAMb,gBAAgB,GAAGc,MAAM,CAACC,MAAP,CAAc,yBAAYpB,MAAM,CAACqB,OAAnB,EAA6BC,MAAD,IAAY;AAC7E,WAAOA,MAAM,CAACC,KAAP,GAAeD,MAAM,CAACE,WAAtB,GAAoCF,MAAM,CAACG,YAAlD;AACD,GAFsC,CAAd,CAAzB;AAIA,MAAIC,KAAJ;AAEAA,EAAAA,KAAK,GAAG,IAAR;AAEA,SAAO;AACL;AACJ;AACA;AACA;AACIX,IAAAA,KAAK,EAAGX,GAAD,IAAS;AACd,UAAIA,GAAG,CAACuB,MAAJ,KAAe3B,MAAM,CAAC4B,WAA1B,EAAuC;AACrC,cAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAED,UAAIH,KAAJ,EAAW;AACTA,QAAAA,KAAK,GAAG,KAAR;AAEA,eAAOvB,MAAM,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD,OAJD,MAIO;AACL,eAAOgB,MAAM,CAACZ,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD;AACF;AAjBI,GAAP;AAmBD,C","sourcesContent":["import _ from 'lodash';\nimport alignTableData from './alignTableData';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\nimport {\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop,\n} from './drawBorder';\nimport drawRow from './drawRow';\nimport makeStreamConfig from './makeStreamConfig';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport padTableData from './padTableData';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\n\n/**\n * @param {Array} data\n * @param {object} config\n * @returns {Array}\n */\nconst prepareData = (data, config) => {\n let rows;\n\n rows = stringifyTableData(data);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n return rows;\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {object} config\n * @returns {undefined}\n */\nconst create = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output;\n\n output = '';\n\n output += drawBorderTop(columnWidthIndex, config.border);\n output += body;\n output += drawBorderBottom(columnWidthIndex, config.border);\n\n output = output.trimEnd();\n\n process.stdout.write(output);\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {object} config\n * @returns {undefined}\n */\nconst append = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output = '';\n const bottom = drawBorderBottom(columnWidthIndex, config.border);\n\n if (bottom !== '\\n') {\n output = '\\r\\u001B[K';\n }\n\n output += drawBorderJoin(columnWidthIndex, config.border);\n output += body;\n output += bottom;\n\n output = output.trimEnd();\n\n process.stdout.write(output);\n};\n\n/**\n * @param {object} userConfig\n * @returns {object}\n */\nexport default (userConfig = {}) => {\n const config = makeStreamConfig(userConfig);\n\n const columnWidthIndex = Object.values(_.mapValues(config.columns, (column) => {\n return column.width + column.paddingLeft + column.paddingRight;\n }));\n\n let empty;\n\n empty = true;\n\n return {\n /**\n * @param {string[]} row\n * @returns {undefined}\n */\n write: (row) => {\n if (row.length !== config.columnCount) {\n throw new Error('Row cell count does not match the config.columnCount.');\n }\n\n if (empty) {\n empty = false;\n\n return create(row, columnWidthIndex, config);\n } else {\n return append(row, columnWidthIndex, config);\n }\n },\n };\n};\n"],"file":"createStream.js"}
{"version":3,"sources":["../src/createStream.js"],"names":["prepareData","data","config","rows","rowHeightIndex","create","row","columnWidthIndex","body","map","literalRow","border","join","output","trimEnd","process","stdout","write","append","bottom","userConfig","Object","values","columns","column","width","paddingLeft","paddingRight","empty","length","columnCount","Error"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACpC,MAAIC,IAAJ;AAEAA,EAAAA,IAAI,GAAG,iCAAmBF,IAAnB,CAAP;AAEAE,EAAAA,IAAI,GAAG,gCAAkBF,IAAlB,EAAwBC,MAAxB,CAAP;AAEA,QAAME,cAAc,GAAG,sCAAwBD,IAAxB,EAA8BD,MAA9B,CAAvB;AAEAC,EAAAA,IAAI,GAAG,yCAA2BA,IAA3B,EAAiCC,cAAjC,EAAiDF,MAAjD,CAAP;AACAC,EAAAA,IAAI,GAAG,6BAAeA,IAAf,EAAqBD,MAArB,CAAP;AACAC,EAAAA,IAAI,GAAG,2BAAaA,IAAb,EAAmBD,MAAnB,CAAP;AAEA,SAAOC,IAAP;AACD,CAdD;AAgBA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,MAAM,GAAG,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,KAAmC;AAChD,QAAMC,IAAI,GAAGH,WAAW,CAAC,CAACM,GAAD,CAAD,EAAQJ,MAAR,CAAxB;AAEA,QAAMM,IAAI,GAAGL,IAAI,CAACM,GAAL,CAAUC,UAAD,IAAgB;AACpC,WAAO,sBAAQA,UAAR,EAAoBR,MAAM,CAACS,MAA3B,CAAP;AACD,GAFY,EAEVC,IAFU,CAEL,EAFK,CAAb;AAIA,MAAIC,MAAJ;AAEAA,EAAAA,MAAM,GAAG,EAAT;AAEAA,EAAAA,MAAM,IAAI,+BAAcN,gBAAd,EAAgCL,MAAM,CAACS,MAAvC,CAAV;AACAE,EAAAA,MAAM,IAAIL,IAAV;AACAK,EAAAA,MAAM,IAAI,kCAAiBN,gBAAjB,EAAmCL,MAAM,CAACS,MAA1C,CAA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D;AACD,GAFwB,CAAzB;AAIA,MAAIC,KAAJ;AAEAA,EAAAA,KAAK,GAAG,IAAR;AAEA,SAAO;AACL;AACJ;AACA;AACA;AACIX,IAAAA,KAAK,EAAGX,GAAD,IAAS;AACd,UAAIA,GAAG,CAACuB,MAAJ,KAAe3B,MAAM,CAAC4B,WAA1B,EAAuC;AACrC,cAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;AACD;;AAED,UAAIH,KAAJ,EAAW;AACTA,QAAAA,KAAK,GAAG,KAAR;AAEA,eAAOvB,MAAM,CAACC,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD,OAJD,MAIO;AACL,eAAOgB,MAAM,CAACZ,GAAD,EAAMC,gBAAN,EAAwBL,MAAxB,CAAb;AACD;AACF;AAjBI,GAAP;AAmBD,C","sourcesContent":["import alignTableData from './alignTableData';\nimport calculateRowHeightIndex from './calculateRowHeightIndex';\nimport {\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop,\n} from './drawBorder';\nimport drawRow from './drawRow';\nimport makeStreamConfig from './makeStreamConfig';\nimport mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';\nimport padTableData from './padTableData';\nimport stringifyTableData from './stringifyTableData';\nimport truncateTableData from './truncateTableData';\n\n/**\n * @param {Array} data\n * @param {object} config\n * @returns {Array}\n */\nconst prepareData = (data, config) => {\n let rows;\n\n rows = stringifyTableData(data);\n\n rows = truncateTableData(data, config);\n\n const rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n return rows;\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {object} config\n * @returns {undefined}\n */\nconst create = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output;\n\n output = '';\n\n output += drawBorderTop(columnWidthIndex, config.border);\n output += body;\n output += drawBorderBottom(columnWidthIndex, config.border);\n\n output = output.trimEnd();\n\n process.stdout.write(output);\n};\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {object} config\n * @returns {undefined}\n */\nconst append = (row, columnWidthIndex, config) => {\n const rows = prepareData([row], config);\n\n const body = rows.map((literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n let output = '';\n const bottom = drawBorderBottom(columnWidthIndex, config.border);\n\n if (bottom !== '\\n') {\n output = '\\r\\u001B[K';\n }\n\n output += drawBorderJoin(columnWidthIndex, config.border);\n output += body;\n output += bottom;\n\n output = output.trimEnd();\n\n process.stdout.write(output);\n};\n\n/**\n * @param {object} userConfig\n * @returns {object}\n */\nexport default (userConfig = {}) => {\n const config = makeStreamConfig(userConfig);\n\n const columnWidthIndex = Object.values(config.columns).map((column) => {\n return column.width + column.paddingLeft + column.paddingRight;\n });\n\n let empty;\n\n empty = true;\n\n return {\n /**\n * @param {string[]} row\n * @returns {undefined}\n */\n write: (row) => {\n if (row.length !== config.columnCount) {\n throw new Error('Row cell count does not match the config.columnCount.');\n }\n\n if (empty) {\n empty = false;\n\n return create(row, columnWidthIndex, config);\n } else {\n return append(row, columnWidthIndex, config);\n }\n },\n };\n};\n"],"file":"createStream.js"}

@@ -8,8 +8,4 @@ "use strict";

var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
var _times2 = _interopRequireDefault(require("lodash/times"));
var _calculateMaximumColumnWidthIndex = _interopRequireDefault(require("./calculateMaximumColumnWidthIndex"));

@@ -45,4 +41,5 @@

const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex.default)(rows);
(0, _times2.default)(rows[0].length, index => {
if ((0, _isUndefined2.default)(columns[index])) {
for (let index = 0; index < rows[0].length; index++) {
if (typeof columns[index] === 'undefined') {
columns[index] = {};

@@ -59,3 +56,4 @@ }

}, columnDefault, columns[index]);
});
}
return columns;

@@ -75,3 +73,3 @@ };

(0, _validateConfig.default)('config.json', userConfig);
const config = (0, _cloneDeep2.default)(userConfig);
const config = (0, _lodash.default)(userConfig);
config.border = makeBorder(config.border);

@@ -78,0 +76,0 @@ config.columns = makeColumns(rows, config.columns, config.columnDefault);

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/makeConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","rows","columns","columnDefault","maximumColumnWidthIndex","length","index","alignment","paddingLeft","paddingRight","truncate","Number","POSITIVE_INFINITY","width","wrapWord","userConfig","config","drawHorizontalLine","singleLine","undefined"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,WAAW,GAAG,CAACC,IAAD,EAAOC,OAAO,GAAG,EAAjB,EAAqBC,aAAa,GAAG,EAArC,KAA4C;AAC9D,QAAMC,uBAAuB,GAAG,+CAAiCH,IAAjC,CAAhC;AAEA,uBAAQA,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAhB,EAAyBC,KAAD,IAAW;AACjC,QAAI,2BAAcJ,OAAO,CAACI,KAAD,CAArB,CAAJ,EAAmC;AACjCJ,MAAAA,OAAO,CAACI,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDJ,IAAAA,OAAO,CAACI,KAAD,CAAP,GAAiBR,MAAM,CAACC,MAAP,CAAc;AAC7BQ,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,MAAM,CAACC,iBAJY;AAK7BC,MAAAA,KAAK,EAAET,uBAAuB,CAACE,KAAD,CALD;AAM7BQ,MAAAA,QAAQ,EAAE;AANmB,KAAd,EAOdX,aAPc,EAOCD,OAAO,CAACI,KAAD,CAPR,CAAjB;AAQD,GAbD;AAeA,SAAOJ,OAAP;AACD,CAnBD;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;oBACgBD,I,EAAMc,UAAU,GAAG,E,KAAO;AACxC,+BAAe,aAAf,EAA8BA,UAA9B;AAEA,QAAMC,MAAM,GAAG,yBAAYD,UAAZ,CAAf;AAEAC,EAAAA,MAAM,CAACnB,MAAP,GAAgBD,UAAU,CAACoB,MAAM,CAACnB,MAAR,CAA1B;AACAmB,EAAAA,MAAM,CAACd,OAAP,GAAiBF,WAAW,CAACC,IAAD,EAAOe,MAAM,CAACd,OAAd,EAAuBc,MAAM,CAACb,aAA9B,CAA5B;;AAEA,MAAI,CAACa,MAAM,CAACC,kBAAZ,EAAgC;AAC9B;AACJ;AACA;AACID,IAAAA,MAAM,CAACC,kBAAP,GAA4B,MAAM;AAChC,aAAO,IAAP;AACD,KAFD;AAGD;;AAED,MAAID,MAAM,CAACE,UAAP,KAAsBC,SAA1B,EAAqC;AACnCH,IAAAA,MAAM,CAACE,UAAP,GAAoB,KAApB;AACD;;AAED,SAAOF,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {object} border\n * @returns {object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {object} columns\n * @param {object} columnDefault\n * @returns {object}\n */\nconst makeColumns = (rows, columns = {}, columnDefault = {}) => {\n const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);\n\n _.times(rows[0].length, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Number.POSITIVE_INFINITY,\n width: maximumColumnWidthIndex[index],\n wrapWord: false,\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {object} userConfig\n * @returns {object}\n */\nexport default (rows, userConfig = {}) => {\n validateConfig('config.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(rows, config.columns, config.columnDefault);\n\n if (!config.drawHorizontalLine) {\n /**\n * @returns {boolean}\n */\n config.drawHorizontalLine = () => {\n return true;\n };\n }\n\n if (config.singleLine === undefined) {\n config.singleLine = false;\n }\n\n return config;\n};\n"],"file":"makeConfig.js"}
{"version":3,"sources":["../src/makeConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","rows","columns","columnDefault","maximumColumnWidthIndex","index","length","alignment","paddingLeft","paddingRight","truncate","Number","POSITIVE_INFINITY","width","wrapWord","userConfig","config","drawHorizontalLine","singleLine","undefined"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,WAAW,GAAG,CAACC,IAAD,EAAOC,OAAO,GAAG,EAAjB,EAAqBC,aAAa,GAAG,EAArC,KAA4C;AAC9D,QAAMC,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AP,KAAsBC,SAA1B,EAAqC;AACnCH,IAAAA,MAAM,CAACE,UAAP,GAAoB,KAApB;AACD;;AAED,SAAOF,MAAP;AACD,C","sourcesContent":["import cloneDeep from 'lodash.clonedeep';\nimport calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {object} border\n * @returns {object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {object} columns\n * @param {object} columnDefault\n * @returns {object}\n */\nconst makeColumns = (rows, columns = {}, columnDefault = {}) => {\n const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);\n\n for (let index = 0; index < rows[0].length; index++) {\n if (typeof columns[index] === 'undefined') {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Number.POSITIVE_INFINITY,\n width: maximumColumnWidthIndex[index],\n wrapWord: false,\n }, columnDefault, columns[index]);\n }\n\n return columns;\n};\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {Array[]} rows\n * @param {object} userConfig\n * @returns {object}\n */\nexport default (rows, userConfig = {}) => {\n validateConfig('config.json', userConfig);\n\n const config = cloneDeep(userConfig);\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(rows, config.columns, config.columnDefault);\n\n if (!config.drawHorizontalLine) {\n /**\n * @returns {boolean}\n */\n config.drawHorizontalLine = () => {\n return true;\n };\n }\n\n if (config.singleLine === undefined) {\n config.singleLine = false;\n }\n\n return config;\n};\n"],"file":"makeConfig.js"}

@@ -8,8 +8,4 @@ "use strict";

var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
var _times2 = _interopRequireDefault(require("lodash/times"));
var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters"));

@@ -42,4 +38,4 @@

const makeColumns = (columnCount, columns = {}, columnDefault = {}) => {
(0, _times2.default)(columnCount, index => {
if ((0, _isUndefined2.default)(columns[index])) {
for (let index = 0; index < columnCount; index++) {
if (typeof columns[index] === 'undefined') {
columns[index] = {};

@@ -55,3 +51,4 @@ }

}, columnDefault, columns[index]);
});
}
return columns;

@@ -87,3 +84,3 @@ };

(0, _validateConfig.default)('streamConfig.json', userConfig);
const config = (0, _cloneDeep2.default)(userConfig);
const config = (0, _lodash.default)(userConfig);

@@ -90,0 +87,0 @@ if (!config.columnDefault || !config.columnDefault.width) {

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/makeStreamConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","columnCount","columns","columnDefault","index","alignment","paddingLeft","paddingRight","truncate","Number","POSITIVE_INFINITY","wrapWord","userConfig","config","width","Error"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAAoB,WAApB,CAAlB,EAAoDF,MAApD,CAAP;AACD,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,WAAW,GAAG,CAACC,WAAD,EAAcC,OAAO,GAAG,EAAxB,EAA4BC,aAAa,GAAG,EAA5C,KAAmD;AACrE,uBAAQF,WAAR,EAAsBG,KAAD,IAAW;AAC9B,QAAI,2BAAcF,OAAO,CAACE,KAAD,CAArB,CAAJ,EAAmC;AACjCF,MAAAA,OAAO,CAACE,KAAD,CAAP,GAAiB,EAAjB;AACD;;AAEDF,IAAAA,OAAO,CAACE,KAAD,CAAP,GAAiBN,MAAM,CAACC,MAAP,CAAc;AAC7BM,MAAAA,SAAS,EAAE,MADkB;AAE7BC,MAAAA,WAAW,EAAE,CAFgB;AAG7BC,MAAAA,YAAY,EAAE,CAHe;AAI7BC,MAAAA,QAAQ,EAAEC,MAAM,CAACC,iBAJY;AAK7BC,MAAAA,QAAQ,EAAE;AALmB,KAAd,EAMdR,aANc,EAMCD,OAAO,CAACE,KAAD,CANR,CAAjB;AAOD,GAZD;AAcA,SAAOF,OAAP;AACD,CAhBD;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;0BACgBU,UAAU,GAAG,E,KAAO;AAClC,+BAAe,mBAAf,EAAoCA,UAApC;AAEA,QAAMC,MAAM,GAAG,yBAAYD,UAAZ,CAAf;;AAEA,MAAI,CAACC,MAAM,CAACV,aAAR,IAAyB,CAACU,MAAM,CAACV,aAAP,CAAqBW,KAAnD,EAA0D;AACxD,UAAM,IAAIC,KAAJ,CAAU,iEAAV,CAAN;AACD;;AAED,MAAI,CAACF,MAAM,CAACZ,WAAZ,EAAyB;AACvB,UAAM,IAAIc,KAAJ,CAAU,kCAAV,CAAN;AACD;;AAEDF,EAAAA,MAAM,CAAChB,MAAP,GAAgBD,UAAU,CAACiB,MAAM,CAAChB,MAAR,CAA1B;AACAgB,EAAAA,MAAM,CAACX,OAAP,GAAiBF,WAAW,CAACa,MAAM,CAACZ,WAAR,EAAqBY,MAAM,CAACX,OAA5B,EAAqCW,MAAM,CAACV,aAA5C,CAA5B;AAEA,SAAOU,MAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {object} border\n * @returns {object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {number} columnCount\n * @param {object} columns\n * @param {object} columnDefault\n * @returns {object}\n */\nconst makeColumns = (columnCount, columns = {}, columnDefault = {}) => {\n _.times(columnCount, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Number.POSITIVE_INFINITY,\n wrapWord: false,\n }, columnDefault, columns[index]);\n });\n\n return columns;\n};\n\n/**\n * @typedef {object} columnConfig\n * @property {string} alignment\n * @property {number} width\n * @property {number} truncate\n * @property {number} paddingLeft\n * @property {number} paddingRight\n */\n\n/**\n * @typedef {object} streamConfig\n * @property {columnConfig} columnDefault\n * @property {object} border\n * @property {columnConfig[]}\n * @property {number} columnCount Number of columns in the table (required).\n */\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {streamConfig} userConfig\n * @returns {object}\n */\nexport default (userConfig = {}) => {\n validateConfig('streamConfig.json', userConfig);\n\n const config = _.cloneDeep(userConfig);\n\n if (!config.columnDefault || !config.columnDefault.width) {\n throw new Error('Must provide config.columnDefault.width when creating a stream.');\n }\n\n if (!config.columnCount) {\n throw new Error('Must provide config.columnCount.');\n }\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault);\n\n return config;\n};\n"],"file":"makeStreamConfig.js"}
{"version":3,"sources":["../src/makeStreamConfig.js"],"names":["makeBorder","border","Object","assign","makeColumns","columnCount","columns","columnDefault","index","alignment","paddingLeft","paddingRight","truncate","Number","POSITIVE_INFINITY","wrapWord","userConfig","config","width","Error"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAACC,MAAM,GAAG,EAAV,KAAiB;AAClC,SAAOC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,kCAA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F,EAAAA,MAAM,CAAChB,MAAP,GAAgBD,UAAU,CAACiB,MAAM,CAAChB,MAAR,CAA1B;AACAgB,EAAAA,MAAM,CAACX,OAAP,GAAiBF,WAAW,CAACa,MAAM,CAACZ,WAAR,EAAqBY,MAAM,CAACX,OAA5B,EAAqCW,MAAM,CAACV,aAA5C,CAA5B;AAEA,SAAOU,MAAP;AACD,C","sourcesContent":["import cloneDeep from 'lodash.clonedeep';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {object} border\n * @returns {object}\n */\nconst makeBorder = (border = {}) => {\n return Object.assign({}, getBorderCharacters('honeywell'), border);\n};\n\n/**\n * Creates a configuration for every column using default\n * values for the missing configuration properties.\n *\n * @param {number} columnCount\n * @param {object} columns\n * @param {object} columnDefault\n * @returns {object}\n */\nconst makeColumns = (columnCount, columns = {}, columnDefault = {}) => {\n for (let index = 0; index < columnCount; index++) {\n if (typeof columns[index] === 'undefined') {\n columns[index] = {};\n }\n\n columns[index] = Object.assign({\n alignment: 'left',\n paddingLeft: 1,\n paddingRight: 1,\n truncate: Number.POSITIVE_INFINITY,\n wrapWord: false,\n }, columnDefault, columns[index]);\n }\n\n return columns;\n};\n\n/**\n * @typedef {object} columnConfig\n * @property {string} alignment\n * @property {number} width\n * @property {number} truncate\n * @property {number} paddingLeft\n * @property {number} paddingRight\n */\n\n/**\n * @typedef {object} streamConfig\n * @property {columnConfig} columnDefault\n * @property {object} border\n * @property {columnConfig[]}\n * @property {number} columnCount Number of columns in the table (required).\n */\n\n/**\n * Makes a new configuration object out of the userConfig object\n * using default values for the missing configuration properties.\n *\n * @param {streamConfig} userConfig\n * @returns {object}\n */\nexport default (userConfig = {}) => {\n validateConfig('streamConfig.json', userConfig);\n\n const config = cloneDeep(userConfig);\n\n if (!config.columnDefault || !config.columnDefault.width) {\n throw new Error('Must provide config.columnDefault.width when creating a stream.');\n }\n\n if (!config.columnCount) {\n throw new Error('Must provide config.columnCount.');\n }\n\n config.border = makeBorder(config.border);\n config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault);\n\n return config;\n};\n"],"file":"makeStreamConfig.js"}

@@ -8,6 +8,4 @@ "use strict";

var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
var _lodash = _interopRequireDefault(require("lodash.flatten"));
var _times2 = _interopRequireDefault(require("lodash/times"));
var _wrapCell = _interopRequireDefault(require("./wrapCell"));

@@ -26,3 +24,3 @@

const mappedRows = unmappedRows.map((cells, index0) => {
const rowHeight = (0, _times2.default)(rowHeightIndex[index0], () => {
const rowHeight = Array.from(new Array(rowHeightIndex[index0]), () => {
return new Array(tableWidth).fill('');

@@ -41,3 +39,3 @@ }); // rowHeight

});
return (0, _flatten2.default)(mappedRows);
return (0, _lodash.default)(mappedRows);
};

@@ -44,0 +42,0 @@

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","Array","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2"],"mappings":";;;;;;;;;;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;oCACgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAG,qBAAQR,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAIE,KAAJ,CAAUP,UAAV,EAAsBQ,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;AAEAJ,IAAAA,KAAK,CAACK,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBX,MAAM,CAACc,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8Cf,MAAM,CAACc,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCX,QAAAA,SAAS,CAACW,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOV,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAO,uBAAUJ,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = _.times(rowHeightIndex[index0], () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n cellLines.forEach((cellLine, index2) => {\n rowHeight[index2][index1] = cellLine;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"}
{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","Array","from","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;oCACgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAGC,KAAK,CAACC,IAAN,CAAW,IAAID,KAAJ,CAAUT,cAAc,CAACO,MAAD,CAAxB,CAAX,EAA8C,MAAM;AACpE,aAAO,IAAIE,KAAJ,CAAUP,UAAV,EAAsBS,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;AAEAL,IAAAA,KAAK,CAACM,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBZ,MAAM,CAACe,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8ChB,MAAM,CAACe,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCZ,QAAAA,SAAS,CAACY,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOX,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAO,qBAAQJ,UAAR,CAAP;AACD,C","sourcesContent":["import flatten from 'lodash.flatten';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = Array.from(new Array(rowHeightIndex[index0]), () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n cellLines.forEach((cellLine, index2) => {\n rowHeight[index2][index1] = cellLine;\n });\n });\n\n return rowHeight;\n });\n\n return flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"}

@@ -8,3 +8,3 @@ "use strict";

var _truncate2 = _interopRequireDefault(require("lodash/truncate"));
var _lodash = _interopRequireDefault(require("lodash.truncate"));

@@ -22,3 +22,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

return cells.map((content, index) => {
return (0, _truncate2.default)(content, {
return (0, _lodash.default)(content, {
length: config.columns[index].truncate

@@ -25,0 +25,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/truncateTableData.js"],"names":["rows","config","map","cells","content","index","length","columns","truncate"],"mappings":";;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;2BACgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,OAAD,EAAUC,KAAV,KAAoB;AACnC,aAAO,wBAAWD,OAAX,EAAoB;AACzBE,QAAAA,MAAM,EAAEL,MAAM,CAACM,OAAP,CAAeF,KAAf,EAAsBG;AADL,OAApB,CAAP;AAGD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import _ from 'lodash';\n\n/**\n * @todo Make it work with ASCII content.\n * @param {table~row[]} rows\n * @param {object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((content, index) => {\n return _.truncate(content, {\n length: config.columns[index].truncate,\n });\n });\n });\n};\n"],"file":"truncateTableData.js"}
{"version":3,"sources":["../src/truncateTableData.js"],"names":["rows","config","map","cells","content","index","length","columns","truncate"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;2BACgBA,I,EAAMC,M,KAAW;AAC/B,SAAOD,IAAI,CAACE,GAAL,CAAUC,KAAD,IAAW;AACzB,WAAOA,KAAK,CAACD,GAAN,CAAU,CAACE,OAAD,EAAUC,KAAV,KAAoB;AACnC,aAAO,qBAASD,OAAT,EAAkB;AACvBE,QAAAA,MAAM,EAAEL,MAAM,CAACM,OAAP,CAAeF,KAAf,EAAsBG;AADP,OAAlB,CAAP;AAGD,KAJM,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import truncate from 'lodash.truncate';\n\n/**\n * @todo Make it work with ASCII content.\n * @param {table~row[]} rows\n * @param {object} config\n * @returns {table~row[]}\n */\nexport default (rows, config) => {\n return rows.map((cells) => {\n return cells.map((content, index) => {\n return truncate(content, {\n length: config.columns[index].truncate,\n });\n });\n });\n};\n"],"file":"truncateTableData.js"}

@@ -12,4 +12,2 @@ "use strict";

// eslint-disable-next-line import/default
/**

@@ -16,0 +14,0 @@ * @param {string} schemaId

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/validateConfig.js"],"names":["schemaId","config","validate","validators","errors","map","error","dataPath","message","params","schemaPath","console","log","Error"],"mappings":";;;;;;;AACA;;;;AADA;;AAGA;AACA;AACA;AACA;AACA;wBACgBA,Q,EAAUC,MAAM,GAAG,E,KAAO;AACxC,QAAMC,QAAQ,GAAGC,oBAAWH,QAAX,CAAjB;;AACA,MAAI,CAACE,QAAQ,CAACD,MAAD,CAAb,EAAuB;AACrB,UAAMG,MAAM,GAAGF,QAAQ,CAACE,MAAT,CAAgBC,GAAhB,CAAqBC,KAAD,IAAW;AAC5C,aAAO;AACLC,QAAAA,QAAQ,EAAED,KAAK,CAACC,QADX;AAELC,QAAAA,OAAO,EAAEF,KAAK,CAACE,OAFV;AAGLC,QAAAA,MAAM,EAAEH,KAAK,CAACG,MAHT;AAILC,QAAAA,UAAU,EAAEJ,KAAK,CAACI;AAJb,OAAP;AAMD,KAPc,CAAf;AASA;;AACAC,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBX,MAAtB;AACAU,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBR,MAAtB;AACA;;AAEA,UAAM,IAAIS,KAAJ,CAAU,iBAAV,CAAN;AACD;AACF,C","sourcesContent":["// eslint-disable-next-line import/default\nimport validators from '../dist/validators';\n\n/**\n * @param {string} schemaId\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (schemaId, config = {}) => {\n const validate = validators[schemaId];\n if (!validate(config)) {\n const errors = validate.errors.map((error) => {\n return {\n dataPath: error.dataPath,\n message: error.message,\n params: error.params,\n schemaPath: error.schemaPath,\n };\n });\n\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('errors', errors);\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"file":"validateConfig.js"}
{"version":3,"sources":["../src/validateConfig.js"],"names":["schemaId","config","validate","validators","errors","map","error","dataPath","message","params","schemaPath","console","log","Error"],"mappings":";;;;;;;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;wBACgBA,Q,EAAUC,MAAM,GAAG,E,KAAO;AACxC,QAAMC,QAAQ,GAAGC,oBAAWH,QAAX,CAAjB;;AACA,MAAI,CAACE,QAAQ,CAACD,MAAD,CAAb,EAAuB;AACrB,UAAMG,MAAM,GAAGF,QAAQ,CAACE,MAAT,CAAgBC,GAAhB,CAAqBC,KAAD,IAAW;AAC5C,aAAO;AACLC,QAAAA,QAAQ,EAAED,KAAK,CAACC,QADX;AAELC,QAAAA,OAAO,EAAEF,KAAK,CAACE,OAFV;AAGLC,QAAAA,MAAM,EAAEH,KAAK,CAACG,MAHT;AAILC,QAAAA,UAAU,EAAEJ,KAAK,CAACI;AAJb,OAAP;AAMD,KAPc,CAAf;AASA;;AACAC,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBX,MAAtB;AACAU,IAAAA,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsBR,MAAtB;AACA;;AAEA,UAAM,IAAIS,KAAJ,CAAU,iBAAV,CAAN;AACD;AACF,C","sourcesContent":["import validators from '../dist/validators';\n\n/**\n * @param {string} schemaId\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (schemaId, config = {}) => {\n const validate = validators[schemaId];\n if (!validate(config)) {\n const errors = validate.errors.map((error) => {\n return {\n dataPath: error.dataPath,\n message: error.message,\n params: error.params,\n schemaPath: error.schemaPath,\n };\n });\n\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('errors', errors);\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"file":"validateConfig.js"}

@@ -77,2 +77,3 @@ "use strict";

};
const func8 = Object.prototype.hasOwnProperty;
const schema16 = {

@@ -83,3 +84,3 @@ "type": "string"

function validate46(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -93,9 +94,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "string"
},
message: "should be string"
message: "must be string"
};

@@ -114,3 +115,3 @@ if (vErrors === null) {

function validate45(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -124,11 +125,11 @@ parentDataProperty,

for (const key0 in data) {
if (!(schema15.properties.hasOwnProperty(key0))) {
if (!(func8.call(schema15.properties, key0))) {
const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -145,3 +146,3 @@ if (vErrors === null) {

if (!(validate46(data.topBody, {
dataPath: dataPath + "/topBody",
instancePath: instancePath + "/topBody",
parentData: data,

@@ -157,3 +158,3 @@ parentDataProperty: "topBody",

if (!(validate46(data.topJoin, {
dataPath: dataPath + "/topJoin",
instancePath: instancePath + "/topJoin",
parentData: data,

@@ -169,3 +170,3 @@ parentDataProperty: "topJoin",

if (!(validate46(data.topLeft, {
dataPath: dataPath + "/topLeft",
instancePath: instancePath + "/topLeft",
parentData: data,

@@ -181,3 +182,3 @@ parentDataProperty: "topLeft",

if (!(validate46(data.topRight, {
dataPath: dataPath + "/topRight",
instancePath: instancePath + "/topRight",
parentData: data,

@@ -193,3 +194,3 @@ parentDataProperty: "topRight",

if (!(validate46(data.bottomBody, {
dataPath: dataPath + "/bottomBody",
instancePath: instancePath + "/bottomBody",
parentData: data,

@@ -205,3 +206,3 @@ parentDataProperty: "bottomBody",

if (!(validate46(data.bottomJoin, {
dataPath: dataPath + "/bottomJoin",
instancePath: instancePath + "/bottomJoin",
parentData: data,

@@ -217,3 +218,3 @@ parentDataProperty: "bottomJoin",

if (!(validate46(data.bottomLeft, {
dataPath: dataPath + "/bottomLeft",
instancePath: instancePath + "/bottomLeft",
parentData: data,

@@ -229,3 +230,3 @@ parentDataProperty: "bottomLeft",

if (!(validate46(data.bottomRight, {
dataPath: dataPath + "/bottomRight",
instancePath: instancePath + "/bottomRight",
parentData: data,

@@ -241,3 +242,3 @@ parentDataProperty: "bottomRight",

if (!(validate46(data.bodyLeft, {
dataPath: dataPath + "/bodyLeft",
instancePath: instancePath + "/bodyLeft",
parentData: data,

@@ -253,3 +254,3 @@ parentDataProperty: "bodyLeft",

if (!(validate46(data.bodyRight, {
dataPath: dataPath + "/bodyRight",
instancePath: instancePath + "/bodyRight",
parentData: data,

@@ -265,3 +266,3 @@ parentDataProperty: "bodyRight",

if (!(validate46(data.bodyJoin, {
dataPath: dataPath + "/bodyJoin",
instancePath: instancePath + "/bodyJoin",
parentData: data,

@@ -277,3 +278,3 @@ parentDataProperty: "bodyJoin",

if (!(validate46(data.joinBody, {
dataPath: dataPath + "/joinBody",
instancePath: instancePath + "/joinBody",
parentData: data,

@@ -289,3 +290,3 @@ parentDataProperty: "joinBody",

if (!(validate46(data.joinLeft, {
dataPath: dataPath + "/joinLeft",
instancePath: instancePath + "/joinLeft",
parentData: data,

@@ -301,3 +302,3 @@ parentDataProperty: "joinLeft",

if (!(validate46(data.joinRight, {
dataPath: dataPath + "/joinRight",
instancePath: instancePath + "/joinRight",
parentData: data,

@@ -313,3 +314,3 @@ parentDataProperty: "joinRight",

if (!(validate46(data.joinJoin, {
dataPath: dataPath + "/joinJoin",
instancePath: instancePath + "/joinJoin",
parentData: data,

@@ -325,9 +326,9 @@ parentDataProperty: "joinJoin",

const err1 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -379,6 +380,6 @@ if (vErrors === null) {

};
const func0 = require("ajv/dist/compile/equal");
const func0 = require("ajv/dist/runtime/equal").default;
function validate64(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -394,9 +395,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -415,9 +416,9 @@ if (vErrors === null) {

const err1 = {
instancePath: instancePath + "/alignment",
schemaPath: "#/properties/alignment/type",
keyword: "type",
dataPath: dataPath + "/alignment",
schemaPath: "#/properties/alignment/type",
params: {
type: "string"
},
message: "should be string"
message: "must be string"
};

@@ -433,9 +434,9 @@ if (vErrors === null) {

const err2 = {
instancePath: instancePath + "/alignment",
schemaPath: "#/properties/alignment/enum",
keyword: "enum",
dataPath: dataPath + "/alignment",
schemaPath: "#/properties/alignment/enum",
params: {
allowedValues: schema18.properties.alignment.enum
},
message: "should be equal to one of the allowed values"
message: "must be equal to one of the allowed values"
};

@@ -454,9 +455,9 @@ if (vErrors === null) {

const err3 = {
instancePath: instancePath + "/width",
schemaPath: "#/properties/width/type",
keyword: "type",
dataPath: dataPath + "/width",
schemaPath: "#/properties/width/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -474,9 +475,9 @@ if (vErrors === null) {

const err4 = {
instancePath: instancePath + "/wrapWord",
schemaPath: "#/properties/wrapWord/type",
keyword: "type",
dataPath: dataPath + "/wrapWord",
schemaPath: "#/properties/wrapWord/type",
params: {
type: "boolean"
},
message: "should be boolean"
message: "must be boolean"
};

@@ -495,9 +496,9 @@ if (vErrors === null) {

const err5 = {
instancePath: instancePath + "/truncate",
schemaPath: "#/properties/truncate/type",
keyword: "type",
dataPath: dataPath + "/truncate",
schemaPath: "#/properties/truncate/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -516,9 +517,9 @@ if (vErrors === null) {

const err6 = {
instancePath: instancePath + "/paddingLeft",
schemaPath: "#/properties/paddingLeft/type",
keyword: "type",
dataPath: dataPath + "/paddingLeft",
schemaPath: "#/properties/paddingLeft/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -537,9 +538,9 @@ if (vErrors === null) {

const err7 = {
instancePath: instancePath + "/paddingRight",
schemaPath: "#/properties/paddingRight/type",
keyword: "type",
dataPath: dataPath + "/paddingRight",
schemaPath: "#/properties/paddingRight/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -556,9 +557,9 @@ if (vErrors === null) {

const err8 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -577,3 +578,3 @@ if (vErrors === null) {

function validate63(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -589,9 +590,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -609,3 +610,3 @@ if (vErrors === null) {

if (!(validate64(data[key1], {
dataPath: dataPath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
parentData: data,

@@ -622,9 +623,9 @@ parentDataProperty: key1,

const err1 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -643,3 +644,3 @@ if (vErrors === null) {

function validate67(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -655,9 +656,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -676,9 +677,9 @@ if (vErrors === null) {

const err1 = {
instancePath: instancePath + "/alignment",
schemaPath: "#/properties/alignment/type",
keyword: "type",
dataPath: dataPath + "/alignment",
schemaPath: "#/properties/alignment/type",
params: {
type: "string"
},
message: "should be string"
message: "must be string"
};

@@ -694,9 +695,9 @@ if (vErrors === null) {

const err2 = {
instancePath: instancePath + "/alignment",
schemaPath: "#/properties/alignment/enum",
keyword: "enum",
dataPath: dataPath + "/alignment",
schemaPath: "#/properties/alignment/enum",
params: {
allowedValues: schema18.properties.alignment.enum
},
message: "should be equal to one of the allowed values"
message: "must be equal to one of the allowed values"
};

@@ -715,9 +716,9 @@ if (vErrors === null) {

const err3 = {
instancePath: instancePath + "/width",
schemaPath: "#/properties/width/type",
keyword: "type",
dataPath: dataPath + "/width",
schemaPath: "#/properties/width/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -735,9 +736,9 @@ if (vErrors === null) {

const err4 = {
instancePath: instancePath + "/wrapWord",
schemaPath: "#/properties/wrapWord/type",
keyword: "type",
dataPath: dataPath + "/wrapWord",
schemaPath: "#/properties/wrapWord/type",
params: {
type: "boolean"
},
message: "should be boolean"
message: "must be boolean"
};

@@ -756,9 +757,9 @@ if (vErrors === null) {

const err5 = {
instancePath: instancePath + "/truncate",
schemaPath: "#/properties/truncate/type",
keyword: "type",
dataPath: dataPath + "/truncate",
schemaPath: "#/properties/truncate/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -777,9 +778,9 @@ if (vErrors === null) {

const err6 = {
instancePath: instancePath + "/paddingLeft",
schemaPath: "#/properties/paddingLeft/type",
keyword: "type",
dataPath: dataPath + "/paddingLeft",
schemaPath: "#/properties/paddingLeft/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -798,9 +799,9 @@ if (vErrors === null) {

const err7 = {
instancePath: instancePath + "/paddingRight",
schemaPath: "#/properties/paddingRight/type",
keyword: "type",
dataPath: dataPath + "/paddingRight",
schemaPath: "#/properties/paddingRight/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -817,9 +818,9 @@ if (vErrors === null) {

const err8 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -838,3 +839,3 @@ if (vErrors === null) {

function validate43(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -851,9 +852,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -870,3 +871,3 @@ if (vErrors === null) {

if (!(validate45(data.border, {
dataPath: dataPath + "/border",
instancePath: instancePath + "/border",
parentData: data,

@@ -882,3 +883,3 @@ parentDataProperty: "border",

if (!(validate63(data.columns, {
dataPath: dataPath + "/columns",
instancePath: instancePath + "/columns",
parentData: data,

@@ -894,3 +895,3 @@ parentDataProperty: "columns",

if (!(validate67(data.columnDefault, {
dataPath: dataPath + "/columnDefault",
instancePath: instancePath + "/columnDefault",
parentData: data,

@@ -907,5 +908,5 @@ parentDataProperty: "columnDefault",

const err1 = {
instancePath: instancePath + "/drawHorizontalLine",
schemaPath: "#/properties/drawHorizontalLine/typeof",
keyword: "typeof",
dataPath: dataPath + "/drawHorizontalLine",
schemaPath: "#/properties/drawHorizontalLine/typeof",
params: {},

@@ -925,5 +926,5 @@ message: "should pass \"typeof\" keyword validation"

const err2 = {
instancePath: instancePath + "/singleLine",
schemaPath: "#/properties/singleLine/typeof",
keyword: "typeof",
dataPath: dataPath + "/singleLine",
schemaPath: "#/properties/singleLine/typeof",
params: {},

@@ -942,9 +943,9 @@ message: "should pass \"typeof\" keyword validation"

const err3 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -984,3 +985,3 @@ if (vErrors === null) {

function validate70(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -994,11 +995,11 @@ parentDataProperty,

for (const key0 in data) {
if (!(schema15.properties.hasOwnProperty(key0))) {
if (!(func8.call(schema15.properties, key0))) {
const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -1015,3 +1016,3 @@ if (vErrors === null) {

if (!(validate46(data.topBody, {
dataPath: dataPath + "/topBody",
instancePath: instancePath + "/topBody",
parentData: data,

@@ -1027,3 +1028,3 @@ parentDataProperty: "topBody",

if (!(validate46(data.topJoin, {
dataPath: dataPath + "/topJoin",
instancePath: instancePath + "/topJoin",
parentData: data,

@@ -1039,3 +1040,3 @@ parentDataProperty: "topJoin",

if (!(validate46(data.topLeft, {
dataPath: dataPath + "/topLeft",
instancePath: instancePath + "/topLeft",
parentData: data,

@@ -1051,3 +1052,3 @@ parentDataProperty: "topLeft",

if (!(validate46(data.topRight, {
dataPath: dataPath + "/topRight",
instancePath: instancePath + "/topRight",
parentData: data,

@@ -1063,3 +1064,3 @@ parentDataProperty: "topRight",

if (!(validate46(data.bottomBody, {
dataPath: dataPath + "/bottomBody",
instancePath: instancePath + "/bottomBody",
parentData: data,

@@ -1075,3 +1076,3 @@ parentDataProperty: "bottomBody",

if (!(validate46(data.bottomJoin, {
dataPath: dataPath + "/bottomJoin",
instancePath: instancePath + "/bottomJoin",
parentData: data,

@@ -1087,3 +1088,3 @@ parentDataProperty: "bottomJoin",

if (!(validate46(data.bottomLeft, {
dataPath: dataPath + "/bottomLeft",
instancePath: instancePath + "/bottomLeft",
parentData: data,

@@ -1099,3 +1100,3 @@ parentDataProperty: "bottomLeft",

if (!(validate46(data.bottomRight, {
dataPath: dataPath + "/bottomRight",
instancePath: instancePath + "/bottomRight",
parentData: data,

@@ -1111,3 +1112,3 @@ parentDataProperty: "bottomRight",

if (!(validate46(data.bodyLeft, {
dataPath: dataPath + "/bodyLeft",
instancePath: instancePath + "/bodyLeft",
parentData: data,

@@ -1123,3 +1124,3 @@ parentDataProperty: "bodyLeft",

if (!(validate46(data.bodyRight, {
dataPath: dataPath + "/bodyRight",
instancePath: instancePath + "/bodyRight",
parentData: data,

@@ -1135,3 +1136,3 @@ parentDataProperty: "bodyRight",

if (!(validate46(data.bodyJoin, {
dataPath: dataPath + "/bodyJoin",
instancePath: instancePath + "/bodyJoin",
parentData: data,

@@ -1147,3 +1148,3 @@ parentDataProperty: "bodyJoin",

if (!(validate46(data.joinBody, {
dataPath: dataPath + "/joinBody",
instancePath: instancePath + "/joinBody",
parentData: data,

@@ -1159,3 +1160,3 @@ parentDataProperty: "joinBody",

if (!(validate46(data.joinLeft, {
dataPath: dataPath + "/joinLeft",
instancePath: instancePath + "/joinLeft",
parentData: data,

@@ -1171,3 +1172,3 @@ parentDataProperty: "joinLeft",

if (!(validate46(data.joinRight, {
dataPath: dataPath + "/joinRight",
instancePath: instancePath + "/joinRight",
parentData: data,

@@ -1183,3 +1184,3 @@ parentDataProperty: "joinRight",

if (!(validate46(data.joinJoin, {
dataPath: dataPath + "/joinJoin",
instancePath: instancePath + "/joinJoin",
parentData: data,

@@ -1195,9 +1196,9 @@ parentDataProperty: "joinJoin",

const err1 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -1216,3 +1217,3 @@ if (vErrors === null) {

function validate87(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -1228,9 +1229,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -1248,3 +1249,3 @@ if (vErrors === null) {

if (!(validate64(data[key1], {
dataPath: dataPath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
parentData: data,

@@ -1261,9 +1262,9 @@ parentDataProperty: key1,

const err1 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -1282,3 +1283,3 @@ if (vErrors === null) {

function validate90(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -1294,9 +1295,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -1315,9 +1316,9 @@ if (vErrors === null) {

const err1 = {
instancePath: instancePath + "/alignment",
schemaPath: "#/properties/alignment/type",
keyword: "type",
dataPath: dataPath + "/alignment",
schemaPath: "#/properties/alignment/type",
params: {
type: "string"
},
message: "should be string"
message: "must be string"
};

@@ -1333,9 +1334,9 @@ if (vErrors === null) {

const err2 = {
instancePath: instancePath + "/alignment",
schemaPath: "#/properties/alignment/enum",
keyword: "enum",
dataPath: dataPath + "/alignment",
schemaPath: "#/properties/alignment/enum",
params: {
allowedValues: schema18.properties.alignment.enum
},
message: "should be equal to one of the allowed values"
message: "must be equal to one of the allowed values"
};

@@ -1354,9 +1355,9 @@ if (vErrors === null) {

const err3 = {
instancePath: instancePath + "/width",
schemaPath: "#/properties/width/type",
keyword: "type",
dataPath: dataPath + "/width",
schemaPath: "#/properties/width/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -1374,9 +1375,9 @@ if (vErrors === null) {

const err4 = {
instancePath: instancePath + "/wrapWord",
schemaPath: "#/properties/wrapWord/type",
keyword: "type",
dataPath: dataPath + "/wrapWord",
schemaPath: "#/properties/wrapWord/type",
params: {
type: "boolean"
},
message: "should be boolean"
message: "must be boolean"
};

@@ -1395,9 +1396,9 @@ if (vErrors === null) {

const err5 = {
instancePath: instancePath + "/truncate",
schemaPath: "#/properties/truncate/type",
keyword: "type",
dataPath: dataPath + "/truncate",
schemaPath: "#/properties/truncate/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -1416,9 +1417,9 @@ if (vErrors === null) {

const err6 = {
instancePath: instancePath + "/paddingLeft",
schemaPath: "#/properties/paddingLeft/type",
keyword: "type",
dataPath: dataPath + "/paddingLeft",
schemaPath: "#/properties/paddingLeft/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -1437,9 +1438,9 @@ if (vErrors === null) {

const err7 = {
instancePath: instancePath + "/paddingRight",
schemaPath: "#/properties/paddingRight/type",
keyword: "type",
dataPath: dataPath + "/paddingRight",
schemaPath: "#/properties/paddingRight/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -1456,9 +1457,9 @@ if (vErrors === null) {

const err8 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -1477,3 +1478,3 @@ if (vErrors === null) {

function validate69(data, {
dataPath = "",
instancePath = "",
parentData,

@@ -1490,9 +1491,9 @@ parentDataProperty,

const err0 = {
instancePath,
schemaPath: "#/additionalProperties",
keyword: "additionalProperties",
dataPath,
schemaPath: "#/additionalProperties",
params: {
additionalProperty: key0
},
message: "should NOT have additional properties"
message: "must NOT have additional properties"
};

@@ -1509,3 +1510,3 @@ if (vErrors === null) {

if (!(validate70(data.border, {
dataPath: dataPath + "/border",
instancePath: instancePath + "/border",
parentData: data,

@@ -1521,3 +1522,3 @@ parentDataProperty: "border",

if (!(validate87(data.columns, {
dataPath: dataPath + "/columns",
instancePath: instancePath + "/columns",
parentData: data,

@@ -1533,3 +1534,3 @@ parentDataProperty: "columns",

if (!(validate90(data.columnDefault, {
dataPath: dataPath + "/columnDefault",
instancePath: instancePath + "/columnDefault",
parentData: data,

@@ -1547,9 +1548,9 @@ parentDataProperty: "columnDefault",

const err1 = {
instancePath: instancePath + "/columnCount",
schemaPath: "#/properties/columnCount/type",
keyword: "type",
dataPath: dataPath + "/columnCount",
schemaPath: "#/properties/columnCount/type",
params: {
type: "number"
},
message: "should be number"
message: "must be number"
};

@@ -1566,9 +1567,9 @@ if (vErrors === null) {

const err2 = {
instancePath,
schemaPath: "#/type",
keyword: "type",
dataPath,
schemaPath: "#/type",
params: {
type: "object"
},
message: "should be object"
message: "must be object"
};

@@ -1575,0 +1576,0 @@ if (vErrors === null) {

@@ -8,4 +8,9 @@ {

"dependencies": {
"ajv": "^7.0.2",
"lodash": "^4.17.20",
"ajv": "^8.0.1",
"is-boolean-object": "^1.1.0",
"is-number-object": "^1.0.4",
"is-string": "^1.0.5",
"lodash.clonedeep": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.truncate": "^4.4.2",
"slice-ansi": "^4.0.0",

@@ -22,6 +27,5 @@ "string-width": "^4.2.0"

"@babel/register": "^7.12.10",
"ajv-cli": "^4.0.1",
"ajv-keywords": "^4.0.0",
"ajv-cli": "^5.0.0",
"ajv-keywords": "^5.0.0",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-export-default-name": "^2.1.0",

@@ -38,2 +42,5 @@ "chai": "^4.2.0",

"js-beautify": "^1.13.0",
"lodash.mapvalues": "^4.6.0",
"lodash.random": "^3.2.0",
"lodash.sample": "^4.2.1",
"mocha": "^8.2.1",

@@ -87,3 +94,3 @@ "nyc": "^15.1.0",

},
"version": "6.0.7"
"version": "6.0.8"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet