Comparing version 3.8.3 to 4.0.1
@@ -106,4 +106,2 @@ 'use strict'; | ||
return alignCenter(subject, availableWidth); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -38,4 +38,2 @@ 'use strict'; | ||
}); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -47,4 +47,2 @@ 'use strict'; | ||
return _lodash2.default.ceil((0, _stringWidth2.default)(value) / columnWidth); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -27,4 +27,2 @@ 'use strict'; | ||
}); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -41,4 +41,2 @@ 'use strict'; | ||
return columns; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -48,4 +48,2 @@ 'use strict'; | ||
return rowSpanIndex; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -157,4 +157,2 @@ 'use strict'; | ||
}; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -21,4 +21,2 @@ 'use strict'; | ||
return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -61,4 +61,2 @@ 'use strict'; | ||
return output; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -126,4 +126,2 @@ 'use strict'; | ||
throw new Error('Unknown border template "' + name + '".'); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.getBorderCharacters = exports.createStream = undefined; | ||
exports.getBorderCharacters = exports.createStream = exports.table = undefined; | ||
@@ -22,4 +22,4 @@ var _table = require('./table'); | ||
exports.table = _table2.default; | ||
exports.createStream = _createStream2.default; | ||
exports.getBorderCharacters = _getBorderCharacters2.default; | ||
exports.default = _table2.default; | ||
exports.getBorderCharacters = _getBorderCharacters2.default; |
@@ -99,4 +99,2 @@ 'use strict'; | ||
return config; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -107,4 +107,2 @@ 'use strict'; | ||
return config; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -57,4 +57,2 @@ 'use strict'; | ||
return _lodash2.default.flatten(mappedRows); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -26,4 +26,2 @@ 'use strict'; | ||
}); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -23,4 +23,2 @@ 'use strict'; | ||
}); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -133,4 +133,2 @@ 'use strict'; | ||
return (0, _drawTable2.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -27,4 +27,2 @@ 'use strict'; | ||
}); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -57,4 +57,2 @@ 'use strict'; | ||
}); | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -46,4 +46,2 @@ 'use strict'; | ||
return chunks; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -56,4 +56,2 @@ 'use strict'; | ||
return chunks; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
@@ -21,3 +21,2 @@ { | ||
"babel-core": "^6.14.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-istanbul": "^2.0.3", | ||
@@ -61,3 +60,3 @@ "babel-preset-es2015-node4": "^2.1.0", | ||
"scripts": { | ||
"build": "rm -fr ./dist && babel --copy-files ./src --out-dir ./dist && npm run make-validators", | ||
"build": "rm -fr ./dist && NODE_ENV=production babel --copy-files ./src --out-dir ./dist && npm run make-validators", | ||
"lint": "npm run build && eslint ./src ./tests", | ||
@@ -70,3 +69,3 @@ "make-readme": "gitdown ./.README/README.md --output-file ./README.md", | ||
}, | ||
"version": "3.8.3" | ||
"version": "4.0.1" | ||
} |
@@ -1,2 +0,3 @@ | ||
<h1 id="table">Table</h1> | ||
<a name="table"></a> | ||
# Table | ||
@@ -25,3 +26,4 @@ [![Travis build status](http://img.shields.io/travis/gajus/table/master.svg?style=flat)](https://travis-ci.org/gajus/table) | ||
<h2 id="table-features">Features</h2> | ||
<a name="table-features"></a> | ||
## Features | ||
@@ -36,3 +38,4 @@ * Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. | ||
<h2 id="table-usage">Usage</h2> | ||
<a name="table-usage"></a> | ||
## Usage | ||
@@ -42,4 +45,9 @@ Table data is described using an array (rows) of array (cells). | ||
```js | ||
import table from 'table'; | ||
import { | ||
table | ||
} from 'table'; | ||
// Using commonjs? | ||
// const {table} = require('table'); | ||
let data, | ||
@@ -131,3 +139,4 @@ output; | ||
<h3 id="table-usage-cell-content-alignment">Cell Content Alignment</h3> | ||
<a name="table-usage-cell-content-alignment"></a> | ||
### Cell Content Alignment | ||
@@ -181,3 +190,4 @@ `{string} config.columns[{number}].alignment` property controls content horizontal alignment within a cell. | ||
<h3 id="table-usage-column-width">Column Width</h3> | ||
<a name="table-usage-column-width"></a> | ||
### Column Width | ||
@@ -220,3 +230,4 @@ `{number} config.columns[{number}].width` property restricts column width to a fixed width. | ||
<h3 id="table-usage-custom-border">Custom Border</h3> | ||
<a name="table-usage-custom-border"></a> | ||
### Custom Border | ||
@@ -274,3 +285,4 @@ `{object} config.border` property describes characters used to draw the table border. | ||
<h3 id="table-usage-draw-horizontal-line">Draw Horizontal Line</h3> | ||
<a name="table-usage-draw-horizontal-line"></a> | ||
### Draw Horizontal Line | ||
@@ -321,3 +333,4 @@ `{function} config.drawHorizontalLine` property is a function that is called for every non-content row in the table. The result of the function `{boolean}` determines whether a row is drawn. | ||
<h3 id="table-usage-padding-cell-content">Padding Cell Content</h3> | ||
<a name="table-usage-padding-cell-content"></a> | ||
### Padding Cell Content | ||
@@ -366,3 +379,4 @@ `{number} config.columns[{number}].paddingLeft` and `{number} config.columns[{number}].paddingRight` properties control content padding within a cell. Property value represents a number of whitespaces used to pad the content. | ||
<h3 id="table-usage-predefined-border-templates">Predefined Border Templates</h3> | ||
<a name="table-usage-predefined-border-templates"></a> | ||
### Predefined Border Templates | ||
@@ -372,3 +386,4 @@ You can load one of the predefined border templates using `getBorderCharacters` function. | ||
```js | ||
import table, { | ||
import { | ||
table, | ||
getBorderCharacters | ||
@@ -436,3 +451,4 @@ } from 'table'; | ||
<h4 id="table-usage-predefined-border-templates-borderless-table">Borderless Table</h4> | ||
<a name="table-usage-predefined-border-templates-borderless-table"></a> | ||
#### Borderless Table | ||
@@ -466,3 +482,4 @@ Simply using "void" border character template creates a table with a lot of unnecessary spacing. | ||
<h3 id="table-usage-streaming">Streaming</h3> | ||
<a name="table-usage-streaming"></a> | ||
### Streaming | ||
@@ -547,3 +564,4 @@ `table` package exports `createStream` function used to draw a table and append rows. | ||
![Streaming random data.](./.README/streaming-random.gif) | ||
<h3 id="table-usage-text-truncation">Text Truncation</h3> | ||
<a name="table-usage-text-truncation"></a> | ||
### Text Truncation | ||
@@ -587,3 +605,4 @@ To handle a content that overflows the container width, `table` package implements [text wrapping](#table-usage-text-wrapping). However, sometimes you may want to truncate content that is too long to be displayed in the table. | ||
<h3 id="table-usage-text-wrapping">Text Wrapping</h3> | ||
<a name="table-usage-text-wrapping"></a> | ||
### Text Wrapping | ||
@@ -590,0 +609,0 @@ `table` package implements auto text wrapping, i.e. text that has width greater than the container width will be separated into multiple lines, e.g. |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
import _ from 'lodash'; | ||
import chalk from 'chalk'; | ||
import table, { | ||
getBorderCharacters | ||
import { | ||
table, | ||
getBorderCharacters | ||
} from './../../../src'; | ||
@@ -6,0 +7,0 @@ |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
import _ from 'lodash'; | ||
import table, { | ||
getBorderCharacters | ||
import { | ||
table, | ||
getBorderCharacters | ||
} from './../../../src'; | ||
@@ -5,0 +6,0 @@ import expectTable from './expectTable'; |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
@@ -1,2 +0,4 @@ | ||
import table from './../../../src'; | ||
import { | ||
table | ||
} from './../../../src'; | ||
import expectTable from './expectTable'; | ||
@@ -3,0 +5,0 @@ |
@@ -29,3 +29,3 @@ /* eslint-disable max-nested-callbacks */ | ||
describe('subject is lesser than the chunk size', () => { | ||
it('returns subject in a single chunk', () => { | ||
it.skip('returns subject in a single chunk', () => { | ||
expect(wrapString(chalk.red('aaa'), 3)).to.deep.equal([ | ||
@@ -37,3 +37,3 @@ '\u001b[31m\u001b[31m\u001b[31m\u001b[31m\u001b[31maaa\u001b[39m' | ||
describe('subject is larger than the chunk size', () => { | ||
it('returns subject sliced into multiple chunks', () => { | ||
it.skip('returns subject sliced into multiple chunks', () => { | ||
expect(wrapString(chalk.red('aaabbbc'), 3)).to.deep.equal([ | ||
@@ -40,0 +40,0 @@ '\u001b[31m\u001b[31m\u001b[31m\u001b[31m\u001b[31maaa\u001b[39m', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15
672
158236
4339