From b3938fff53dbb15250353b61457e2e20240d3af2 Mon Sep 17 00:00:00 2001 From: Pavlo Paska Date: Sun, 16 Feb 2020 18:33:32 +0000 Subject: [PATCH] a mayor structure refactoring and PIVOT array implementation --- README.md | 5 +- index.html | 18 +-- package.json | 4 +- rollup.config.dev.js | 2 +- rollup.config.js | 2 +- src/_internals.ts | 13 ++ src/array.ts | 201 ------------------------- src/array/index.ts | 3 + src/{array-joins.ts => array/joins.ts} | 65 ++++---- src/array/stats.ts | 162 ++++++++++++++++++++ src/array/transform.ts | 104 +++++++++++++ src/data-pipe.ts | 47 +++--- src/examples/node-example.js | 2 +- src/index.ts | 10 +- src/models.ts | 2 - src/string/index.ts | 1 + src/string/stringUtils.ts | 7 + src/{ => tests}/array.spec.ts | 88 ++++++++++- src/{ => tests}/data-pipe.spec.ts | 6 +- src/{ => tests}/dsv-parser.spec.ts | 5 +- src/{ => tests}/table.spec.ts | 3 +- src/tests/utils-pipe.spec.ts | 26 ++++ src/types.ts | 13 ++ src/utils-pipe.spec.ts | 26 ---- src/utils-pipe.ts | 24 --- src/{ => utils}/dsv-parser.ts | 13 +- src/utils/index.ts | 3 + src/{ => utils}/table.ts | 0 src/{ => utils}/utils.ts | 14 +- tsconfig.json | 6 +- 30 files changed, 506 insertions(+), 369 deletions(-) create mode 100644 src/_internals.ts delete mode 100644 src/array.ts create mode 100644 src/array/index.ts rename src/{array-joins.ts => array/joins.ts} (76%) create mode 100644 src/array/stats.ts create mode 100644 src/array/transform.ts delete mode 100644 src/models.ts create mode 100644 src/string/index.ts create mode 100644 src/string/stringUtils.ts rename src/{ => tests}/array.spec.ts (57%) rename src/{ => tests}/data-pipe.spec.ts (93%) rename src/{ => tests}/dsv-parser.spec.ts (97%) rename src/{ => tests}/table.spec.ts (95%) create mode 100644 src/tests/utils-pipe.spec.ts create mode 100644 src/types.ts delete mode 100644 src/utils-pipe.spec.ts delete mode 100644 src/utils-pipe.ts rename src/{ => utils}/dsv-parser.ts (92%) create mode 100644 src/utils/index.ts rename src/{ => utils}/table.ts (100%) rename src/{ => utils}/utils.ts (89%) diff --git a/README.md b/README.md index 13d674b..fa44c6f 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,9 @@ npm install datapipe-js JavaScript / TypeScript ```js const data = [ - { name: "John", country: "US"}, { name: "Joe", country: "US"}, { name: "Bill", country: "US"}, { name: "Adam", country: "UK"}, - { name: "Scott", country: "UK"}, { name: "Diana",country: "UK"}, { name: "Marry",country: "FR"}, { name: "Luc",country: "FR"} + { name: "John", country: "US"}, { name: "Joe", country: "US"}, { name: "Bill", country: "US"}, + { name: "Adam", country: "UK"}, { name: "Scott", country: "UK"}, { name: "Diana",country: "UK"}, + { name: "Marry",country: "FR"}, { name: "Luc",country: "FR"} ]; const summaryForUS = dataPipe(data) diff --git a/index.html b/index.html index 91ba7d3..4a6d859 100644 --- a/index.html +++ b/index.html @@ -14,17 +14,17 @@

Data Pipe testing page. Do not expect anything here!