Skip to content

Commit

Permalink
fix: update all dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drops Node v6 support.
  • Loading branch information
gajus committed Aug 30, 2020
1 parent fc2c35b commit fab800a
Show file tree
Hide file tree
Showing 49 changed files with 317 additions and 318 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- node
- 8
- 6
script:
- export NODE_ENV=test
- npm run build
Expand Down
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@
"url": "http://gajus.com"
},
"dependencies": {
"ajv": "^6.10.2",
"lodash": "^4.17.19",
"slice-ansi": "^2.1.0",
"string-width": "^3.0.0"
"ajv": "^6.12.4",
"lodash": "^4.17.20",
"slice-ansi": "^4.0.0",
"string-width": "^4.2.0"
},
"description": "Formats data into a string table.",
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.4",
"@babel/node": "^7.5.0",
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/preset-env": "^7.5.4",
"@babel/register": "^7.4.4",
"ajv-cli": "^3.0.0",
"ajv-keywords": "^3.4.1",
"babel-plugin-istanbul": "^5.1.4",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.4",
"@babel/node": "^7.10.5",
"@babel/plugin-transform-flow-strip-types": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/register": "^7.10.5",
"ajv-cli": "^3.2.1",
"ajv-keywords": "^3.5.2",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-export-default-name": "^2.0.4",
"chai": "^4.2.0",
"chalk": "^2.4.2",
"coveralls": "^3.0.5",
"eslint": "^5.13.0",
"eslint-config-canonical": "^16.1.0",
"flow-bin": "^0.102.0",
"flow-copy-source": "^2.0.7",
"gitdown": "^3.1.1",
"husky": "^3.0.0",
"mocha": "^6.1.4",
"nyc": "^14.1.1",
"semantic-release": "^15.13.18",
"sinon": "^7.3.2"
"chalk": "^4.1.0",
"coveralls": "^3.1.0",
"eslint": "^7.7.0",
"eslint-config-canonical": "^23.0.1",
"flow-bin": "^0.132.0",
"flow-copy-source": "^2.0.9",
"gitdown": "^3.1.3",
"husky": "^4.2.5",
"mocha": "^8.1.3",
"nyc": "^15.1.0",
"semantic-release": "^17.1.1",
"sinon": "^9.0.3"
},
"engines": {
"node": ">=6.0.0"
"node": ">=8.0.0"
},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion src/alignString.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import stringWidth from 'string-width';
const alignments = [
'left',
'right',
'center'
'center',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion src/alignTableData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import alignString from './alignString';

/**
* @param {table~row[]} rows
* @param {Object} config
* @param {object} config
* @returns {table~row[]}
*/
export default (rows, config) => {
Expand Down
2 changes: 1 addition & 1 deletion src/calculateCellWidthIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default (cells) => {
return Math.max(
...value.split('\n').map((line) => {
return stringWidth(line);
})
}),
);
});
};
2 changes: 1 addition & 1 deletion src/calculateRowHeightIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import calculateCellHeight from './calculateCellHeight';
* Calculates the vertical row span index.
*
* @param {Array[]} rows
* @param {Object} config
* @param {object} config
* @returns {number[]}
*/
export default (rows, config) => {
Expand Down
26 changes: 13 additions & 13 deletions src/createStream.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import _ from 'lodash';
import makeStreamConfig from './makeStreamConfig';
import drawRow from './drawRow';
import alignTableData from './alignTableData';
import calculateRowHeightIndex from './calculateRowHeightIndex';
import {
drawBorderBottom,
drawBorderJoin,
drawBorderTop
drawBorderTop,
} from './drawBorder';
import stringifyTableData from './stringifyTableData';
import truncateTableData from './truncateTableData';
import drawRow from './drawRow';
import makeStreamConfig from './makeStreamConfig';
import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex';
import alignTableData from './alignTableData';
import padTableData from './padTableData';
import calculateRowHeightIndex from './calculateRowHeightIndex';
import stringifyTableData from './stringifyTableData';
import truncateTableData from './truncateTableData';

/**
* @param {Array} data
* @param {Object} config
* @param {object} config
* @returns {Array}
*/
const prepareData = (data, config) => {
Expand All @@ -37,7 +37,7 @@ const prepareData = (data, config) => {
/**
* @param {string[]} row
* @param {number[]} columnWidthIndex
* @param {Object} config
* @param {object} config
* @returns {undefined}
*/
const create = (row, columnWidthIndex, config) => {
Expand All @@ -63,7 +63,7 @@ const create = (row, columnWidthIndex, config) => {
/**
* @param {string[]} row
* @param {number[]} columnWidthIndex
* @param {Object} config
* @param {object} config
* @returns {undefined}
*/
const append = (row, columnWidthIndex, config) => {
Expand All @@ -90,8 +90,8 @@ const append = (row, columnWidthIndex, config) => {
};

/**
* @param {Object} userConfig
* @returns {Object}
* @param {object} userConfig
* @returns {object}
*/
export default (userConfig = {}) => {
const config = makeStreamConfig(userConfig);
Expand Down Expand Up @@ -122,6 +122,6 @@ export default (userConfig = {}) => {
} else {
return append(row, columnWidthIndex, config);
}
}
},
};
};
8 changes: 4 additions & 4 deletions src/drawBorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const drawBorderTop = (columnSizeIndex, parts) => {
body: parts.topBody,
join: parts.topJoin,
left: parts.topLeft,
right: parts.topRight
right: parts.topRight,
});

if (border === '\n') {
Expand Down Expand Up @@ -67,7 +67,7 @@ const drawBorderJoin = (columnSizeIndex, parts) => {
body: parts.joinBody,
join: parts.joinJoin,
left: parts.joinLeft,
right: parts.joinRight
right: parts.joinRight,
});
};

Expand All @@ -89,13 +89,13 @@ const drawBorderBottom = (columnSizeIndex, parts) => {
body: parts.bottomBody,
join: parts.bottomJoin,
left: parts.bottomLeft,
right: parts.bottomRight
right: parts.bottomRight,
});
};

export {
drawBorder,
drawBorderBottom,
drawBorderJoin,
drawBorderTop
drawBorderTop,
};
2 changes: 1 addition & 1 deletion src/drawRow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @typedef {Object} drawRow~border
* @typedef {object} drawRow~border
* @property {string} bodyLeft
* @property {string} bodyRight
* @property {string} bodyJoin
Expand Down
4 changes: 2 additions & 2 deletions src/drawTable.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
drawBorderTop,
drawBorderJoin,
drawBorderBottom
drawBorderBottom,
} from './drawBorder';
import drawRow from './drawRow';

/**
* @param {Array} rows
* @param {Object} border
* @param {object} border
* @param {Array} columnSizeIndex
* @param {Array} rowSpanIndex
* @param {Function} drawHorizontalLine
Expand Down
10 changes: 5 additions & 5 deletions src/getBorderCharacters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable sort-keys */
/* eslint-disable sort-keys-fix/sort-keys-fix */

/**
* @typedef border
Expand Down Expand Up @@ -43,7 +43,7 @@ export default (name) => {
joinBody: '─',
joinLeft: '╟',
joinRight: '╢',
joinJoin: '┼'
joinJoin: '┼',
};
}

Expand All @@ -66,7 +66,7 @@ export default (name) => {
joinBody: '─',
joinLeft: '├',
joinRight: '┤',
joinJoin: '┼'
joinJoin: '┼',
};
}

Expand All @@ -89,7 +89,7 @@ export default (name) => {
joinBody: '-',
joinLeft: '|',
joinRight: '|',
joinJoin: '|'
joinJoin: '|',
};
}

Expand All @@ -112,7 +112,7 @@ export default (name) => {
joinBody: '',
joinLeft: '',
joinRight: '',
joinJoin: ''
joinJoin: '',
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import table from './table';
import createStream from './createStream';
import getBorderCharacters from './getBorderCharacters';
import table from './table';

export {
table,
createStream,
getBorderCharacters
getBorderCharacters,
};
18 changes: 9 additions & 9 deletions src/makeConfig.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import _ from 'lodash';
import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';
import getBorderCharacters from './getBorderCharacters';
import validateConfig from './validateConfig';
import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';

/**
* Merges user provided border characters with the default border ("honeywell") characters.
*
* @param {Object} border
* @returns {Object}
* @param {object} border
* @returns {object}
*/
const makeBorder = (border = {}) => {
return Object.assign({}, getBorderCharacters('honeywell'), border);
Expand All @@ -18,9 +18,9 @@ const makeBorder = (border = {}) => {
* values for the missing configuration properties.
*
* @param {Array[]} rows
* @param {Object} columns
* @param {Object} columnDefault
* @returns {Object}
* @param {object} columns
* @param {object} columnDefault
* @returns {object}
*/
const makeColumns = (rows, columns = {}, columnDefault = {}) => {
const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);
Expand All @@ -36,7 +36,7 @@ const makeColumns = (rows, columns = {}, columnDefault = {}) => {
paddingRight: 1,
truncate: Infinity,
width: maximumColumnWidthIndex[index],
wrapWord: false
wrapWord: false,
}, columnDefault, columns[index]);
});

Expand All @@ -48,8 +48,8 @@ const makeColumns = (rows, columns = {}, columnDefault = {}) => {
* using default values for the missing configuration properties.
*
* @param {Array[]} rows
* @param {Object} userConfig
* @returns {Object}
* @param {object} userConfig
* @returns {object}
*/
export default (rows, userConfig = {}) => {
validateConfig('config.json', userConfig);
Expand Down
Loading

0 comments on commit fab800a

Please sign in to comment.