Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/node_modules/table/dist/truncateTableData.js.flow')
-rw-r--r--assets/node_modules/table/dist/truncateTableData.js.flow17
1 files changed, 17 insertions, 0 deletions
diff --git a/assets/node_modules/table/dist/truncateTableData.js.flow b/assets/node_modules/table/dist/truncateTableData.js.flow
new file mode 100644
index 0000000..1052c92
--- /dev/null
+++ b/assets/node_modules/table/dist/truncateTableData.js.flow
@@ -0,0 +1,17 @@
+import _ from 'lodash';
+
+/**
+ * @todo Make it work with ASCII content.
+ * @param {table~row[]} rows
+ * @param {Object} config
+ * @returns {table~row[]}
+ */
+export default (rows, config) => {
+ return rows.map((cells) => {
+ return cells.map((content, index) => {
+ return _.truncate(content, {
+ length: config.columns[index].truncate
+ });
+ });
+ });
+};