@banumeow/n8n-nodes-oracle-cloud 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@langchain/core/node_modules/@types/retry/LICENSE +21 -0
- package/node_modules/@langchain/core/node_modules/@types/retry/README.md +16 -0
- package/node_modules/@langchain/core/node_modules/@types/retry/index.d.ts +151 -0
- package/node_modules/@langchain/core/node_modules/@types/retry/package.json +28 -0
- package/node_modules/@langchain/core/node_modules/@types/uuid/LICENSE +21 -0
- package/node_modules/@langchain/core/node_modules/@types/uuid/README.md +15 -0
- package/node_modules/@langchain/core/node_modules/@types/uuid/index.d.mts +19 -0
- package/node_modules/@langchain/core/node_modules/@types/uuid/index.d.ts +113 -0
- package/node_modules/@langchain/core/node_modules/@types/uuid/package.json +54 -0
- package/node_modules/@langchain/core/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/@langchain/core/node_modules/base64-js/README.md +34 -0
- package/node_modules/@langchain/core/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/@langchain/core/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/@langchain/core/node_modules/base64-js/index.js +150 -0
- package/node_modules/@langchain/core/node_modules/base64-js/package.json +47 -0
- package/node_modules/@langchain/core/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/@langchain/core/node_modules/chalk/license +9 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/license +9 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/browser.js +5 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/index.js +135 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/license +9 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/package.json +53 -0
- package/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/readme.md +76 -0
- package/node_modules/@langchain/core/node_modules/chalk/package.json +68 -0
- package/node_modules/@langchain/core/node_modules/chalk/readme.md +341 -0
- package/node_modules/@langchain/core/node_modules/chalk/source/index.js +229 -0
- package/node_modules/@langchain/core/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/@langchain/core/node_modules/chalk/source/util.js +39 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/LICENSE +21 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/README.md +192 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/index.d.ts +4 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/index.js +11 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/console-table-printer.d.ts +14 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/console-table-printer.js +36 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/input-converter.d.ts +6 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/input-converter.js +20 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.d.ts +6 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.js +142 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table.d.ts +31 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table.js +100 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.d.ts +3 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.js +50 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/common.d.ts +14 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/common.js +2 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/external-table.d.ts +99 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/external-table.js +2 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/internal-table.d.ts +24 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/internal-table.js +2 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/colored-console-line.d.ts +12 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/colored-console-line.js +31 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/console-utils.d.ts +3 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/console-utils.js +23 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/string-utils.d.ts +4 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/string-utils.js +68 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-constants.d.ts +11 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-constants.js +55 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-helpers.d.ts +29 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-helpers.js +101 -0
- package/node_modules/@langchain/core/node_modules/console-table-printer/package.json +50 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/README.md +94 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/index.d.ts +134 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/package.json +56 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/umd/eventemitter3.js +340 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
- package/node_modules/@langchain/core/node_modules/eventemitter3/umd/eventemitter3.min.js.map +1 -0
- package/node_modules/@langchain/core/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/@langchain/core/node_modules/has-flag/index.js +8 -0
- package/node_modules/@langchain/core/node_modules/has-flag/license +9 -0
- package/node_modules/@langchain/core/node_modules/has-flag/package.json +46 -0
- package/node_modules/@langchain/core/node_modules/has-flag/readme.md +89 -0
- package/node_modules/@langchain/core/node_modules/p-finally/index.js +15 -0
- package/node_modules/@langchain/core/node_modules/p-finally/license +21 -0
- package/node_modules/@langchain/core/node_modules/p-finally/package.json +42 -0
- package/node_modules/@langchain/core/node_modules/p-finally/readme.md +47 -0
- package/node_modules/@langchain/core/node_modules/p-timeout/index.d.ts +72 -0
- package/node_modules/@langchain/core/node_modules/p-timeout/index.js +57 -0
- package/node_modules/@langchain/core/node_modules/p-timeout/license +9 -0
- package/node_modules/@langchain/core/node_modules/p-timeout/package.json +45 -0
- package/node_modules/@langchain/core/node_modules/p-timeout/readme.md +87 -0
- package/node_modules/@langchain/core/node_modules/retry/License +21 -0
- package/node_modules/@langchain/core/node_modules/retry/README.md +227 -0
- package/node_modules/@langchain/core/node_modules/retry/example/dns.js +31 -0
- package/node_modules/@langchain/core/node_modules/retry/example/stop.js +40 -0
- package/node_modules/@langchain/core/node_modules/retry/index.js +1 -0
- package/node_modules/@langchain/core/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/@langchain/core/node_modules/retry/lib/retry_operation.js +162 -0
- package/node_modules/@langchain/core/node_modules/retry/package.json +36 -0
- package/node_modules/@langchain/core/node_modules/semver/LICENSE +15 -0
- package/node_modules/@langchain/core/node_modules/semver/README.md +664 -0
- package/node_modules/@langchain/core/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/@langchain/core/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/@langchain/core/node_modules/semver/classes/index.js +7 -0
- package/node_modules/@langchain/core/node_modules/semver/classes/range.js +557 -0
- package/node_modules/@langchain/core/node_modules/semver/classes/semver.js +333 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/major.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/@langchain/core/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/@langchain/core/node_modules/semver/index.js +91 -0
- package/node_modules/@langchain/core/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/@langchain/core/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/@langchain/core/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/@langchain/core/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/@langchain/core/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/@langchain/core/node_modules/semver/internal/re.js +223 -0
- package/node_modules/@langchain/core/node_modules/semver/package.json +78 -0
- package/node_modules/@langchain/core/node_modules/semver/preload.js +4 -0
- package/node_modules/@langchain/core/node_modules/semver/range.bnf +16 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/@langchain/core/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/LICENSE +21 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/README.md +89 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/index.js +10 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/binary-search.js +24 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/models.js +2 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/non-spacing-chars.js +149 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/wcswidth.js +20 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/wcwidth.js +67 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/index.d.ts +20 -0
- package/node_modules/@langchain/core/node_modules/simple-wcswidth/package.json +43 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/retry/LICENSE +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/retry/README.md +16 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/retry/index.d.ts +151 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/retry/package.json +28 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/uuid/LICENSE +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/uuid/README.md +15 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/uuid/index.d.mts +19 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/uuid/index.d.ts +113 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/@types/uuid/package.json +54 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/base64-js/README.md +34 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/base64-js/index.js +150 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/base64-js/package.json +47 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/license +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/license +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/browser.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/index.js +135 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/license +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/package.json +53 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/node_modules/supports-color/readme.md +76 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/package.json +68 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/readme.md +341 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/source/index.js +229 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/chalk/source/util.js +39 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/LICENSE +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/README.md +192 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/index.d.ts +4 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/index.js +11 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/console-table-printer.d.ts +14 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/console-table-printer.js +36 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/input-converter.d.ts +6 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/input-converter.js +20 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.d.ts +6 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.js +142 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table.d.ts +31 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/internal-table.js +100 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.d.ts +3 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.js +50 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/common.d.ts +14 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/common.js +2 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/external-table.d.ts +99 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/external-table.js +2 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/internal-table.d.ts +24 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/models/internal-table.js +2 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/colored-console-line.d.ts +12 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/colored-console-line.js +31 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/console-utils.d.ts +3 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/console-utils.js +23 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/string-utils.d.ts +4 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/string-utils.js +68 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-constants.d.ts +11 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-constants.js +55 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-helpers.d.ts +29 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/dist/src/utils/table-helpers.js +101 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/console-table-printer/package.json +50 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/README.md +94 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/index.d.ts +134 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/package.json +56 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/umd/eventemitter3.js +340 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/eventemitter3/umd/eventemitter3.min.js.map +1 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/has-flag/index.js +8 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/has-flag/license +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/has-flag/package.json +46 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/has-flag/readme.md +89 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-finally/index.js +15 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-finally/license +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-finally/package.json +42 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-finally/readme.md +47 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-timeout/index.d.ts +72 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-timeout/index.js +57 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-timeout/license +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-timeout/package.json +45 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/p-timeout/readme.md +87 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/License +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/README.md +227 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/example/dns.js +31 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/example/stop.js +40 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/index.js +1 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/lib/retry_operation.js +162 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/retry/package.json +36 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/LICENSE +15 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/README.md +664 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/classes/index.js +7 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/classes/range.js +557 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/classes/semver.js +333 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/major.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/index.js +91 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/internal/re.js +223 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/package.json +78 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/preload.js +4 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/range.bnf +16 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/LICENSE +21 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/README.md +89 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/index.js +10 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/binary-search.js +24 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/models.js +2 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/non-spacing-chars.js +149 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/wcswidth.js +20 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/dist/src/wcwidth.js +67 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/index.d.ts +20 -0
- package/node_modules/@langchain/textsplitters/node_modules/@langchain/core/node_modules/simple-wcswidth/package.json +43 -0
- package/package.json +1 -1
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/README.md +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/deep-compare-strict.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/deep-compare-strict.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/dereference.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/dereference.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/format.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/format.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/index.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/index.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/package.json +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/pointer.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/pointer.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/types.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/types.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/ucs2-length.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/ucs2-length.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/validate.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/validate.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/validator.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/commonjs/validator.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/deep-compare-strict.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/deep-compare-strict.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/dereference.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/dereference.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/format.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/format.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/index.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/index.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/package.json +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/pointer.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/pointer.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/types.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/types.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/ucs2-length.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/ucs2-length.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/validate.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/validate.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/validator.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/dist/esm/validator.js +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/package.json +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/deep-compare-strict.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/deep-compare-strict.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/dereference.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/dereference.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/format.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/format.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/index.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/index.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/pointer.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/pointer.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/types.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/types.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/ucs2-length.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/ucs2-length.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/validate.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/validate.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/validator.d.ts +0 -0
- /package/node_modules/{@cfworker → @langchain/core/node_modules/@cfworker}/json-schema/src/validator.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const stringReplaceAll = (string, substring, replacer) => {
|
|
4
|
+
let index = string.indexOf(substring);
|
|
5
|
+
if (index === -1) {
|
|
6
|
+
return string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const substringLength = substring.length;
|
|
10
|
+
let endIndex = 0;
|
|
11
|
+
let returnValue = '';
|
|
12
|
+
do {
|
|
13
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
14
|
+
endIndex = index + substringLength;
|
|
15
|
+
index = string.indexOf(substring, endIndex);
|
|
16
|
+
} while (index !== -1);
|
|
17
|
+
|
|
18
|
+
returnValue += string.substr(endIndex);
|
|
19
|
+
return returnValue;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
23
|
+
let endIndex = 0;
|
|
24
|
+
let returnValue = '';
|
|
25
|
+
do {
|
|
26
|
+
const gotCR = string[index - 1] === '\r';
|
|
27
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
|
|
28
|
+
endIndex = index + 1;
|
|
29
|
+
index = string.indexOf('\n', endIndex);
|
|
30
|
+
} while (index !== -1);
|
|
31
|
+
|
|
32
|
+
returnValue += string.substr(endIndex);
|
|
33
|
+
return returnValue;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
module.exports = {
|
|
37
|
+
stringReplaceAll,
|
|
38
|
+
stringEncaseCRLFWithFirstIndex
|
|
39
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Nahiyan Kamal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<h1 align="center">console-table-printer</h1>
|
|
2
|
+
|
|
3
|
+
> 🖥️🍭Printing Pretty Tables on your console</h3>
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](https://packagephobia.com/result?p=console-table-printer)
|
|
7
|
+
[](https://badge.fury.io/js/console-table-printer)
|
|
8
|
+
[](https://codecov.io/gh/console-table-printer/console-table-printer)
|
|
9
|
+
|
|
10
|
+
## Synopsis
|
|
11
|
+
|
|
12
|
+
Printing Simple Table with Coloring rows on your console. Its useful when you want to present some tables on console using js.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install console-table-printer --save
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Basic Example
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { printTable } from 'console-table-printer';
|
|
24
|
+
|
|
25
|
+
// Create a simple task list
|
|
26
|
+
const tasks = [
|
|
27
|
+
{ id: 1, task: 'Fix login bug', priority: 'High', status: 'In Progress' },
|
|
28
|
+
{ id: 2, task: 'Update documentation', priority: 'Medium', status: 'Done' },
|
|
29
|
+
{ id: 3, task: 'Add unit tests', priority: 'High', status: 'Todo' },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
// Print the table
|
|
33
|
+
printTable(tasks);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
## 🚨🚨Announcement🚨🚨 Official Documentation is moved [Here](https://console-table.netlify.app/docs)
|
|
39
|
+
|
|
40
|
+
You can also create a Table instance and print it:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { Table } from 'console-table-printer';
|
|
44
|
+
|
|
45
|
+
// Create a game leaderboard
|
|
46
|
+
const leaderboard = new Table();
|
|
47
|
+
|
|
48
|
+
// Add players with their scores
|
|
49
|
+
leaderboard.addRow({ rank: 1, player: 'Alice', score: 1250, level: 'Master' });
|
|
50
|
+
leaderboard.addRow({ rank: 2, player: 'Bob', score: 1180, level: 'Expert' });
|
|
51
|
+
leaderboard.addRows([
|
|
52
|
+
{ rank: 3, player: 'Charlie', score: 1050, level: 'Advanced' },
|
|
53
|
+
{ rank: 4, player: 'Diana', score: 920, level: 'Intermediate' },
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
// Print the leaderboard
|
|
57
|
+
leaderboard.printTable();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
You can also put some color to your table like this:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { Table } from 'console-table-printer';
|
|
66
|
+
|
|
67
|
+
const p = new Table();
|
|
68
|
+
p.addRow({ item: 'Pizza', price: 12.99, rating: '5/5' }, { color: 'red' });
|
|
69
|
+
p.addRow({ item: 'Burger', price: 8.99, rating: '4/5' }, { color: 'green' });
|
|
70
|
+
p.addRow({ item: 'Ramen', price: 15.99, rating: '5/5' }, { color: 'yellow' });
|
|
71
|
+
p.addRow({ item: 'Salad', price: 6.99, rating: '3/5' }, { color: 'cyan' });
|
|
72
|
+
p.printTable();
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
You can also put properties based on columns (color/alignment/title)
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { Table } from 'console-table-printer';
|
|
81
|
+
|
|
82
|
+
const p = new Table({
|
|
83
|
+
title: 'Project Status',
|
|
84
|
+
columns: [
|
|
85
|
+
{ name: 'id', alignment: 'left', color: 'blue' },
|
|
86
|
+
{ name: 'project', alignment: 'left' },
|
|
87
|
+
{ name: 'status', title: 'Current Status' },
|
|
88
|
+
],
|
|
89
|
+
colorMap: {
|
|
90
|
+
urgent: '\x1b[31m',
|
|
91
|
+
on_track: '\x1b[32m',
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
p.addRow({ id: 1, project: 'Website Redesign', status: 'On Track' }, { color: 'on_track' });
|
|
96
|
+
p.addRow({ id: 2, project: 'Mobile App', status: 'Behind Schedule' }, { color: 'urgent' });
|
|
97
|
+
p.addRow({ id: 3, project: 'API Integration', status: 'Completed' }, { color: 'green' });
|
|
98
|
+
|
|
99
|
+
p.printTable();
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+
## CLI
|
|
105
|
+
|
|
106
|
+
There is also a CLI tool for printing Tables on Terminal directly [table-printer-cli](https://www.npmjs.com/package/table-printer-cli)
|
|
107
|
+
|
|
108
|
+
## Documentation
|
|
109
|
+
|
|
110
|
+
Official documentation has been moved here: [console-table-documentation](https://console-table.netlify.app)
|
|
111
|
+
|
|
112
|
+
### Table instance creation
|
|
113
|
+
|
|
114
|
+
3 ways to Table Instance creation:
|
|
115
|
+
|
|
116
|
+
1. Simplest way `new Table()`
|
|
117
|
+
|
|
118
|
+
2. Only with column names: `new Table(['column1', 'column2', 'column3'])`
|
|
119
|
+
|
|
120
|
+
3. Detailed way of creating table instance
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
import { Table } from 'console-table-printer';
|
|
124
|
+
|
|
125
|
+
new Table({
|
|
126
|
+
title: '📊 Sales Report Q4 2024', // A text showsup on top of table (optional)
|
|
127
|
+
columns: [
|
|
128
|
+
{ name: 'region', alignment: 'left', color: 'blue' }, // with alignment and color
|
|
129
|
+
{ name: 'sales', alignment: 'right', maxLen: 30 }, // lines bigger than this will be splitted in multiple lines
|
|
130
|
+
{ name: 'growth', title: 'Growth %' }, // Title is what will be shown while printing, by default title = name
|
|
131
|
+
{ name: 'price', transform: (value) => `$${Number(value).toFixed(2)}` }, // Transform function to format cell values before display
|
|
132
|
+
],
|
|
133
|
+
rows: [
|
|
134
|
+
{ region: 'North America', sales: '$2.5M', growth: '+15%' },
|
|
135
|
+
{ region: 'Europe', sales: '$1.8M', growth: '+8%' },
|
|
136
|
+
{ region: 'Asia Pacific', sales: '$3.2M', growth: '+22%' },
|
|
137
|
+
],
|
|
138
|
+
sort: (row1, row2) => row2.sales - row1.sales, // sorting order of rows (optional), this is normal js sort function for Array.sort
|
|
139
|
+
filter: (row) => row.growth > '+10%', // filtering rows (optional)
|
|
140
|
+
enabledColumns: ['region', 'sales'], // array of columns that you want to see, all other will be ignored (optional)
|
|
141
|
+
disabledColumns: ['growth'], // array of columns that you DONT want to see, these will always be hidden
|
|
142
|
+
colorMap: {
|
|
143
|
+
high_growth: '\x1b[32m', // define customized color
|
|
144
|
+
},
|
|
145
|
+
charLength: {
|
|
146
|
+
'👋': 2,
|
|
147
|
+
'😅': 2,
|
|
148
|
+
}, // custom len of chars in console
|
|
149
|
+
defaultColumnOptions: {
|
|
150
|
+
alignment: 'center',
|
|
151
|
+
color: 'red',
|
|
152
|
+
maxLen: 40,
|
|
153
|
+
minLen: 20,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Functions
|
|
159
|
+
|
|
160
|
+
- `addRow(rowObjet, options)` adding single row. This can be chained
|
|
161
|
+
- `addRows(rowObjects, options)` adding multiple rows. array of row object. This case options will be applied to all the objects in row
|
|
162
|
+
- `addColumn(columnObject)` adding single column
|
|
163
|
+
- `addColumns(columnObjects)` adding multiple columns
|
|
164
|
+
- `printTable()` Prints the table on your console
|
|
165
|
+
|
|
166
|
+
### possible `color` values for rows
|
|
167
|
+
|
|
168
|
+
Check Docs: [color-vals](https://console-table.netlify.app/docs/doc-color)
|
|
169
|
+
|
|
170
|
+
Example usage: To Create a row of color blue
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
table.addRow(rowObject, { color: 'blue' });
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Example usage: To apply blue for all rows
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
table.addRows(rowsArray, { color: 'blue' });
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### possible `alignment` values for columns
|
|
183
|
+
|
|
184
|
+
Check Docs: [alignment-vals](https://console-table.netlify.app/docs/doc-alignment)
|
|
185
|
+
|
|
186
|
+
### Typescript Support
|
|
187
|
+
|
|
188
|
+
You can get color / alignment as types. Check Docs: [types-docs](https://console-table.netlify.app/docs/doc-typescript)
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
[MIT](https://github.com/console-table-printer/console-table-printer/blob/master/LICENSE)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Table from './src/console-table-printer';
|
|
2
|
+
import { printSimpleTable as printTable, renderSimpleTable as renderTable } from './src/internalTable/internal-table-printer';
|
|
3
|
+
import { COLOR, ALIGNMENT } from './src/models/external-table';
|
|
4
|
+
export { Table, printTable, renderTable, COLOR, ALIGNMENT };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.renderTable = exports.printTable = exports.Table = void 0;
|
|
7
|
+
const console_table_printer_1 = __importDefault(require("./src/console-table-printer"));
|
|
8
|
+
exports.Table = console_table_printer_1.default;
|
|
9
|
+
const internal_table_printer_1 = require("./src/internalTable/internal-table-printer");
|
|
10
|
+
Object.defineProperty(exports, "printTable", { enumerable: true, get: function () { return internal_table_printer_1.printSimpleTable; } });
|
|
11
|
+
Object.defineProperty(exports, "renderTable", { enumerable: true, get: function () { return internal_table_printer_1.renderSimpleTable; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import TableInternal from './internalTable/internal-table';
|
|
2
|
+
import { Dictionary } from './models/common';
|
|
3
|
+
import { ColumnOptionsRaw, ComplexOptions } from './models/external-table';
|
|
4
|
+
import { RowOptionsRaw } from './utils/table-helpers';
|
|
5
|
+
export default class Table {
|
|
6
|
+
table: TableInternal;
|
|
7
|
+
constructor(options?: ComplexOptions | string[]);
|
|
8
|
+
addColumn(column: string | ColumnOptionsRaw): this;
|
|
9
|
+
addColumns(columns: string[] | ColumnOptionsRaw[]): this;
|
|
10
|
+
addRow(text: Dictionary, rowOptions?: RowOptionsRaw): this;
|
|
11
|
+
addRows(toBeInsertedRows: Dictionary[], rowOptions?: RowOptionsRaw): this;
|
|
12
|
+
printTable(): void;
|
|
13
|
+
render(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const internal_table_1 = __importDefault(require("./internalTable/internal-table"));
|
|
7
|
+
const table_helpers_1 = require("./utils/table-helpers");
|
|
8
|
+
class Table {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
this.table = new internal_table_1.default(options);
|
|
11
|
+
}
|
|
12
|
+
addColumn(column) {
|
|
13
|
+
this.table.addColumn(column);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
addColumns(columns) {
|
|
17
|
+
this.table.addColumns(columns);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
addRow(text, rowOptions) {
|
|
21
|
+
this.table.addRow(text, (0, table_helpers_1.convertRawRowOptionsToStandard)(rowOptions));
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
addRows(toBeInsertedRows, rowOptions) {
|
|
25
|
+
this.table.addRows(toBeInsertedRows, (0, table_helpers_1.convertRawRowOptionsToStandard)(rowOptions));
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
printTable() {
|
|
29
|
+
const tableRendered = this.table.renderTable();
|
|
30
|
+
console.log(tableRendered);
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return this.table.renderTable();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = Table;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ColumnOptionsRaw, ComputedColumn, DefaultColumnOptions } from '../models/external-table';
|
|
2
|
+
import { Column } from '../models/internal-table';
|
|
3
|
+
export declare const objIfExists: (key: string, val: any) => {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export declare const rawColumnToInternalColumn: (column: ColumnOptionsRaw | ComputedColumn, defaultColumnStyles?: DefaultColumnOptions) => Column;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rawColumnToInternalColumn = exports.objIfExists = void 0;
|
|
4
|
+
const table_constants_1 = require("../utils/table-constants");
|
|
5
|
+
const objIfExists = (key, val) => {
|
|
6
|
+
if (!val) {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
[key]: val,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.objIfExists = objIfExists;
|
|
14
|
+
const rawColumnToInternalColumn = (column, defaultColumnStyles) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return (Object.assign(Object.assign(Object.assign(Object.assign({ name: column.name, title: (_a = column.title) !== null && _a !== void 0 ? _a : column.name }, (0, exports.objIfExists)('color', (column.color || (defaultColumnStyles === null || defaultColumnStyles === void 0 ? void 0 : defaultColumnStyles.color)))), (0, exports.objIfExists)('maxLen', (column.maxLen || (defaultColumnStyles === null || defaultColumnStyles === void 0 ? void 0 : defaultColumnStyles.maxLen)))), (0, exports.objIfExists)('minLen', (column.minLen || (defaultColumnStyles === null || defaultColumnStyles === void 0 ? void 0 : defaultColumnStyles.minLen)))), { alignment: (column.alignment ||
|
|
17
|
+
(defaultColumnStyles === null || defaultColumnStyles === void 0 ? void 0 : defaultColumnStyles.alignment) ||
|
|
18
|
+
table_constants_1.DEFAULT_ROW_ALIGNMENT), transform: column.transform }));
|
|
19
|
+
};
|
|
20
|
+
exports.rawColumnToInternalColumn = rawColumnToInternalColumn;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Dictionary } from '../models/common';
|
|
2
|
+
import { ComplexOptions } from '../models/external-table';
|
|
3
|
+
import TableInternal from './internal-table';
|
|
4
|
+
export declare const renderTable: (table: TableInternal) => string;
|
|
5
|
+
export declare const renderSimpleTable: (rows: Dictionary[], tableOptions?: ComplexOptions) => string;
|
|
6
|
+
export declare const printSimpleTable: (rows: Dictionary[], tableOptions?: ComplexOptions) => void;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.printSimpleTable = exports.renderSimpleTable = exports.renderTable = void 0;
|
|
7
|
+
const colored_console_line_1 = __importDefault(require("../utils/colored-console-line"));
|
|
8
|
+
const string_utils_1 = require("../utils/string-utils");
|
|
9
|
+
const table_constants_1 = require("../utils/table-constants");
|
|
10
|
+
const table_helpers_1 = require("../utils/table-helpers");
|
|
11
|
+
const internal_table_1 = __importDefault(require("./internal-table"));
|
|
12
|
+
const table_pre_processors_1 = require("./table-pre-processors");
|
|
13
|
+
// ║ Index ║ ║ ║
|
|
14
|
+
const renderOneLine = (tableStyle, columns, currentLineIndex, widthLimitedColumnsArray, isHeader, row, colorMap, charLength) => {
|
|
15
|
+
const line = new colored_console_line_1.default(colorMap);
|
|
16
|
+
line.addCharsWithColor('', tableStyle.vertical); // dont Color the Column borders
|
|
17
|
+
columns.forEach((column) => {
|
|
18
|
+
const thisLineHasText = currentLineIndex < widthLimitedColumnsArray[column.name].length;
|
|
19
|
+
const textForThisLine = thisLineHasText
|
|
20
|
+
? (0, table_helpers_1.cellText)(widthLimitedColumnsArray[column.name][currentLineIndex])
|
|
21
|
+
: '';
|
|
22
|
+
line.addCharsWithColor(table_constants_1.DEFAULT_ROW_FONT_COLOR, ' ');
|
|
23
|
+
line.addCharsWithColor((isHeader && table_constants_1.DEFAULT_HEADER_FONT_COLOR) || column.color || row.color, (0, string_utils_1.textWithPadding)(textForThisLine, column.alignment || table_constants_1.DEFAULT_ROW_ALIGNMENT, column.length || table_constants_1.DEFAULT_COLUMN_LEN, charLength));
|
|
24
|
+
line.addCharsWithColor('', ` ${tableStyle.vertical}`); // dont Color the Column borders
|
|
25
|
+
});
|
|
26
|
+
return line.renderConsole();
|
|
27
|
+
};
|
|
28
|
+
// ║ Bold ║ text ║ value ║
|
|
29
|
+
// ║ Index ║ ║ ║
|
|
30
|
+
const renderWidthLimitedLines = (tableStyle, columns, row, colorMap, isHeader, charLength) => {
|
|
31
|
+
// { col1: ['How', 'Is', 'Going'], col2: ['I am', 'Tom'], }
|
|
32
|
+
const widthLimitedColumnsArray = (0, table_helpers_1.getWidthLimitedColumnsArray)(columns, row, charLength);
|
|
33
|
+
const totalLines = Object.values(widthLimitedColumnsArray).reduce((a, b) => Math.max(a, b.length), 0);
|
|
34
|
+
const ret = [];
|
|
35
|
+
for (let currentLineIndex = 0; currentLineIndex < totalLines; currentLineIndex += 1) {
|
|
36
|
+
const singleLine = renderOneLine(tableStyle, columns, currentLineIndex, widthLimitedColumnsArray, isHeader, row, colorMap, charLength);
|
|
37
|
+
ret.push(singleLine);
|
|
38
|
+
}
|
|
39
|
+
return ret;
|
|
40
|
+
};
|
|
41
|
+
const transformRow = (row, columns) => {
|
|
42
|
+
const transformedRow = JSON.parse(JSON.stringify(row));
|
|
43
|
+
const transforms = {};
|
|
44
|
+
columns
|
|
45
|
+
.filter((c) => {
|
|
46
|
+
return !!c.transform;
|
|
47
|
+
})
|
|
48
|
+
.forEach((c) => {
|
|
49
|
+
transforms[c.name] = c.transform;
|
|
50
|
+
});
|
|
51
|
+
Object.keys(transforms).forEach((t) => {
|
|
52
|
+
transformedRow.text[t] = transforms[t](transformedRow.text[t]);
|
|
53
|
+
});
|
|
54
|
+
return transformedRow;
|
|
55
|
+
};
|
|
56
|
+
// ║ 1 ║ I would like some red wine please ║ 10.212 ║
|
|
57
|
+
const renderRow = (table, row) => {
|
|
58
|
+
let ret = [];
|
|
59
|
+
const transformedRow = transformRow(row, table.columns);
|
|
60
|
+
ret = ret.concat(renderWidthLimitedLines(table.tableStyle, table.columns, transformedRow, table.colorMap, undefined, table.charLength));
|
|
61
|
+
return ret;
|
|
62
|
+
};
|
|
63
|
+
/*
|
|
64
|
+
The analysis Result
|
|
65
|
+
╔═══════╦═══════════════════════════════════════╦════════╗
|
|
66
|
+
*/
|
|
67
|
+
const renderTableTitle = (table) => {
|
|
68
|
+
const ret = [];
|
|
69
|
+
if (table.title === undefined) {
|
|
70
|
+
return ret;
|
|
71
|
+
}
|
|
72
|
+
const getTableWidth = () => {
|
|
73
|
+
const reducer = (accumulator, currentValue) =>
|
|
74
|
+
// ║ cell ║, 2 spaces + cellTextSize + one border on the left
|
|
75
|
+
accumulator + currentValue + 2 + 1;
|
|
76
|
+
return table.columns
|
|
77
|
+
.map((m) => m.length || table_constants_1.DEFAULT_COLUMN_LEN)
|
|
78
|
+
.reduce(reducer, 1);
|
|
79
|
+
};
|
|
80
|
+
const titleWithPadding = (0, string_utils_1.textWithPadding)(table.title, table_constants_1.DEFAULT_HEADER_ALIGNMENT, getTableWidth());
|
|
81
|
+
const styledText = new colored_console_line_1.default(table.colorMap);
|
|
82
|
+
styledText.addCharsWithColor(table_constants_1.DEFAULT_HEADER_FONT_COLOR, titleWithPadding);
|
|
83
|
+
// The analysis Result
|
|
84
|
+
ret.push(styledText.renderConsole());
|
|
85
|
+
return ret;
|
|
86
|
+
};
|
|
87
|
+
/*
|
|
88
|
+
╔═══════╦═══════════════════════════════════════╦════════╗
|
|
89
|
+
║ index ║ text ║ value ║
|
|
90
|
+
╟═══════╬═══════════════════════════════════════╬════════╢
|
|
91
|
+
*/
|
|
92
|
+
const renderTableHeaders = (table) => {
|
|
93
|
+
let ret = [];
|
|
94
|
+
// ╔═══════╦═══════════════════════════════════════╦════════╗
|
|
95
|
+
ret.push((0, table_helpers_1.renderTableHorizontalBorders)(table.tableStyle.headerTop, table.columns.map((m) => m.length || table_constants_1.DEFAULT_COLUMN_LEN)));
|
|
96
|
+
// ║ index ║ text ║ value ║
|
|
97
|
+
const row = (0, table_helpers_1.createHeaderAsRow)(table_helpers_1.createRow, table.columns);
|
|
98
|
+
ret = ret.concat(renderWidthLimitedLines(table.tableStyle, table.columns, row, table.colorMap, true));
|
|
99
|
+
// ╟═══════╬═══════════════════════════════════════╬════════╢
|
|
100
|
+
ret.push((0, table_helpers_1.renderTableHorizontalBorders)(table.tableStyle.headerBottom, table.columns.map((m) => m.length || table_constants_1.DEFAULT_COLUMN_LEN)));
|
|
101
|
+
return ret;
|
|
102
|
+
};
|
|
103
|
+
const renderTableEnding = (table) => {
|
|
104
|
+
const ret = [];
|
|
105
|
+
// ╚═══════╩═══════════════════════════════════════╩════════╝
|
|
106
|
+
ret.push((0, table_helpers_1.renderTableHorizontalBorders)(table.tableStyle.tableBottom, table.columns.map((m) => m.length || table_constants_1.DEFAULT_COLUMN_LEN)));
|
|
107
|
+
return ret;
|
|
108
|
+
};
|
|
109
|
+
const renderRowSeparator = (table, row) => {
|
|
110
|
+
const ret = [];
|
|
111
|
+
const lastRowIndex = table.rows.length - 1;
|
|
112
|
+
const currentRowIndex = table.rows.indexOf(row);
|
|
113
|
+
if (currentRowIndex !== lastRowIndex && row.separator) {
|
|
114
|
+
// ╟═══════╬═══════════════════════════════════════╬════════╢
|
|
115
|
+
ret.push((0, table_helpers_1.renderTableHorizontalBorders)(table.tableStyle.rowSeparator, table.columns.map((m) => m.length || table_constants_1.DEFAULT_COLUMN_LEN)));
|
|
116
|
+
}
|
|
117
|
+
return ret;
|
|
118
|
+
};
|
|
119
|
+
const renderTable = (table) => {
|
|
120
|
+
(0, table_pre_processors_1.preProcessColumns)(table); // enable / disable cols, find maxLn of each col/ computed Columns
|
|
121
|
+
(0, table_pre_processors_1.preProcessRows)(table); // sort and filter
|
|
122
|
+
const ret = [];
|
|
123
|
+
renderTableTitle(table).forEach((row) => ret.push(row));
|
|
124
|
+
renderTableHeaders(table).forEach((row) => ret.push(row));
|
|
125
|
+
table.rows.forEach((row) => {
|
|
126
|
+
renderRow(table, row).forEach((row_) => ret.push(row_));
|
|
127
|
+
renderRowSeparator(table, row).forEach((row_) => ret.push(row_));
|
|
128
|
+
});
|
|
129
|
+
renderTableEnding(table).forEach((row) => ret.push(row));
|
|
130
|
+
return ret.join('\n');
|
|
131
|
+
};
|
|
132
|
+
exports.renderTable = renderTable;
|
|
133
|
+
const renderSimpleTable = (rows, tableOptions) => {
|
|
134
|
+
const table = new internal_table_1.default(tableOptions);
|
|
135
|
+
table.addRows(rows);
|
|
136
|
+
return (0, exports.renderTable)(table);
|
|
137
|
+
};
|
|
138
|
+
exports.renderSimpleTable = renderSimpleTable;
|
|
139
|
+
const printSimpleTable = (rows, tableOptions) => {
|
|
140
|
+
console.log((0, exports.renderSimpleTable)(rows, tableOptions));
|
|
141
|
+
};
|
|
142
|
+
exports.printSimpleTable = printSimpleTable;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CharLengthDict, Dictionary, Row } from '../models/common';
|
|
2
|
+
import { ColumnOptionsRaw, ComplexOptions, ComputedColumn, DefaultColumnOptions, RowFilterFunction, RowSortFunction, Valuetransform } from '../models/external-table';
|
|
3
|
+
import { Column, TableStyleDetails } from '../models/internal-table';
|
|
4
|
+
import { ColorMap } from '../utils/colored-console-line';
|
|
5
|
+
import { RowOptions } from '../utils/table-helpers';
|
|
6
|
+
declare class TableInternal {
|
|
7
|
+
title?: string;
|
|
8
|
+
tableStyle: TableStyleDetails;
|
|
9
|
+
columns: Column[];
|
|
10
|
+
rows: Row[];
|
|
11
|
+
filterFunction: RowFilterFunction;
|
|
12
|
+
sortFunction: RowSortFunction;
|
|
13
|
+
enabledColumns: string[];
|
|
14
|
+
disabledColumns: string[];
|
|
15
|
+
computedColumns: ComputedColumn[];
|
|
16
|
+
rowSeparator: boolean;
|
|
17
|
+
colorMap: ColorMap;
|
|
18
|
+
charLength: CharLengthDict;
|
|
19
|
+
defaultColumnOptions?: DefaultColumnOptions;
|
|
20
|
+
transforms?: Record<string, Valuetransform>;
|
|
21
|
+
initSimple(columns: string[]): void;
|
|
22
|
+
initDetailed(options: ComplexOptions): void;
|
|
23
|
+
constructor(options?: ComplexOptions | string[]);
|
|
24
|
+
createColumnFromRow(text: Dictionary): void;
|
|
25
|
+
addColumn(textOrObj: string | ComputedColumn | ColumnOptionsRaw): void;
|
|
26
|
+
addColumns(toBeInsertedColumns: string[] | ColumnOptionsRaw[]): void;
|
|
27
|
+
addRow(text: Dictionary, options?: RowOptions): void;
|
|
28
|
+
addRows(toBeInsertedRows: Dictionary[], options?: RowOptions): void;
|
|
29
|
+
renderTable(): string;
|
|
30
|
+
}
|
|
31
|
+
export default TableInternal;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const colored_console_line_1 = require("../utils/colored-console-line");
|
|
4
|
+
const table_constants_1 = require("../utils/table-constants");
|
|
5
|
+
const table_helpers_1 = require("../utils/table-helpers");
|
|
6
|
+
const input_converter_1 = require("./input-converter");
|
|
7
|
+
const internal_table_printer_1 = require("./internal-table-printer");
|
|
8
|
+
const DEFAULT_ROW_SORT_FUNC = () => 0;
|
|
9
|
+
const DEFAULT_ROW_FILTER_FUNC = () => true;
|
|
10
|
+
class TableInternal {
|
|
11
|
+
initSimple(columns) {
|
|
12
|
+
this.columns = columns.map((column) => ({
|
|
13
|
+
name: column,
|
|
14
|
+
title: column,
|
|
15
|
+
alignment: table_constants_1.DEFAULT_ROW_ALIGNMENT,
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
initDetailed(options) {
|
|
19
|
+
var _a;
|
|
20
|
+
this.title = (options === null || options === void 0 ? void 0 : options.title) || this.title;
|
|
21
|
+
this.tableStyle = Object.assign(Object.assign({}, this.tableStyle), options === null || options === void 0 ? void 0 : options.style);
|
|
22
|
+
this.sortFunction = (options === null || options === void 0 ? void 0 : options.sort) || this.sortFunction;
|
|
23
|
+
this.filterFunction = (options === null || options === void 0 ? void 0 : options.filter) || this.filterFunction;
|
|
24
|
+
this.enabledColumns = (options === null || options === void 0 ? void 0 : options.enabledColumns) || this.enabledColumns;
|
|
25
|
+
this.disabledColumns = (options === null || options === void 0 ? void 0 : options.disabledColumns) || this.disabledColumns;
|
|
26
|
+
this.computedColumns = (options === null || options === void 0 ? void 0 : options.computedColumns) || this.computedColumns;
|
|
27
|
+
this.columns =
|
|
28
|
+
((_a = options === null || options === void 0 ? void 0 : options.columns) === null || _a === void 0 ? void 0 : _a.map((column) => (0, input_converter_1.rawColumnToInternalColumn)(column, options === null || options === void 0 ? void 0 : options.defaultColumnOptions))) || this.columns;
|
|
29
|
+
this.rowSeparator = (options === null || options === void 0 ? void 0 : options.rowSeparator) || this.rowSeparator;
|
|
30
|
+
this.charLength = (options === null || options === void 0 ? void 0 : options.charLength) || this.charLength;
|
|
31
|
+
this.defaultColumnOptions =
|
|
32
|
+
(options === null || options === void 0 ? void 0 : options.defaultColumnOptions) || this.defaultColumnOptions;
|
|
33
|
+
if (options === null || options === void 0 ? void 0 : options.shouldDisableColors) {
|
|
34
|
+
this.colorMap = {};
|
|
35
|
+
}
|
|
36
|
+
else if (options === null || options === void 0 ? void 0 : options.colorMap) {
|
|
37
|
+
this.colorMap = Object.assign(Object.assign({}, this.colorMap), options.colorMap);
|
|
38
|
+
}
|
|
39
|
+
if (options.rows !== undefined) {
|
|
40
|
+
this.addRows(options.rows);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
constructor(options) {
|
|
44
|
+
// default construction
|
|
45
|
+
this.rows = [];
|
|
46
|
+
this.columns = [];
|
|
47
|
+
this.title = undefined;
|
|
48
|
+
this.tableStyle = table_constants_1.DEFAULT_TABLE_STYLE;
|
|
49
|
+
this.filterFunction = DEFAULT_ROW_FILTER_FUNC;
|
|
50
|
+
this.sortFunction = DEFAULT_ROW_SORT_FUNC;
|
|
51
|
+
this.enabledColumns = [];
|
|
52
|
+
this.disabledColumns = [];
|
|
53
|
+
this.computedColumns = [];
|
|
54
|
+
this.rowSeparator = table_constants_1.DEFAULT_ROW_SEPARATOR;
|
|
55
|
+
this.colorMap = colored_console_line_1.DEFAULT_COLOR_MAP;
|
|
56
|
+
this.charLength = {};
|
|
57
|
+
this.defaultColumnOptions = undefined;
|
|
58
|
+
this.transforms = {};
|
|
59
|
+
if (options instanceof Array) {
|
|
60
|
+
this.initSimple(options);
|
|
61
|
+
}
|
|
62
|
+
else if (typeof options === 'object') {
|
|
63
|
+
this.initDetailed(options);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
createColumnFromRow(text) {
|
|
67
|
+
const colNames = this.columns.map((col) => col.name);
|
|
68
|
+
Object.keys(text).forEach((key) => {
|
|
69
|
+
if (!colNames.includes(key)) {
|
|
70
|
+
this.columns.push((0, input_converter_1.rawColumnToInternalColumn)((0, table_helpers_1.createColumFromOnlyName)(key), this.defaultColumnOptions));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
addColumn(textOrObj) {
|
|
75
|
+
const columnOptionsFromInput = typeof textOrObj === 'string'
|
|
76
|
+
? (0, table_helpers_1.createColumFromOnlyName)(textOrObj)
|
|
77
|
+
: textOrObj;
|
|
78
|
+
this.columns.push((0, input_converter_1.rawColumnToInternalColumn)(columnOptionsFromInput, this.defaultColumnOptions));
|
|
79
|
+
}
|
|
80
|
+
addColumns(toBeInsertedColumns) {
|
|
81
|
+
toBeInsertedColumns.forEach((toBeInsertedColumn) => {
|
|
82
|
+
this.addColumn(toBeInsertedColumn);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
addRow(text, options) {
|
|
86
|
+
this.createColumnFromRow(text);
|
|
87
|
+
this.rows.push((0, table_helpers_1.createRow)((options === null || options === void 0 ? void 0 : options.color) || table_constants_1.DEFAULT_ROW_FONT_COLOR, text, (options === null || options === void 0 ? void 0 : options.separator) !== undefined
|
|
88
|
+
? options === null || options === void 0 ? void 0 : options.separator
|
|
89
|
+
: this.rowSeparator));
|
|
90
|
+
}
|
|
91
|
+
addRows(toBeInsertedRows, options) {
|
|
92
|
+
toBeInsertedRows.forEach((toBeInsertedRow) => {
|
|
93
|
+
this.addRow(toBeInsertedRow, options);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
renderTable() {
|
|
97
|
+
return (0, internal_table_printer_1.renderTable)(this);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.default = TableInternal;
|