@oclif/table
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
export { makeTable, makeTables } from './table.js'; | ||
export type { TableProps } from './types.js'; | ||
export { printTable, printTables } from './table.js'; | ||
export type { ScalarDict, TableProps } from './types.js'; |
@@ -1,1 +0,1 @@ | ||
export { makeTable, makeTables } from './table.js'; | ||
export { printTable, printTables } from './table.js'; |
@@ -22,5 +22,5 @@ import React from 'react'; | ||
*/ | ||
export declare function makeTable<T extends ScalarDict>(options: TableProps<T>): void; | ||
export declare function makeTables<T extends ScalarDict[]>(tables: { | ||
export declare function printTable<T extends ScalarDict>(options: TableProps<T>): void; | ||
export declare function printTables<T extends ScalarDict[]>(tables: { | ||
[P in keyof T]: TableProps<T[P]>; | ||
}, options?: Omit<ContainerProps, 'children'>): void; |
@@ -220,3 +220,3 @@ /* eslint-disable react/prop-types */ | ||
*/ | ||
export function makeTable(options) { | ||
export function printTable(options) { | ||
const instance = render(React.createElement(Table, { ...options })); | ||
@@ -228,3 +228,3 @@ instance.unmount(); | ||
} | ||
export function makeTables(tables, options) { | ||
export function printTables(tables, options) { | ||
const leftMargin = options?.marginLeft ?? options?.margin ?? 0; | ||
@@ -231,0 +231,0 @@ const rightMargin = options?.marginRight ?? options?.margin ?? 0; |
@@ -126,12 +126,12 @@ import { BorderStyle } from './skeletons.js'; | ||
* // sort the name column in ascending order | ||
* makeTable({data, sort: {name: 'asc'}}) | ||
* printTable({data, sort: {name: 'asc'}}) | ||
* | ||
* // sort the name column in descending order | ||
* makeTable({data, sort: {name: 'desc'}}) | ||
* printTable({data, sort: {name: 'desc'}}) | ||
* | ||
* // sort by name in ascending order and age in descending order | ||
* makeTable({data, sort: {name: 'asc', age: 'desc'}}) | ||
* printTable({data, sort: {name: 'asc', age: 'desc'}}) | ||
* | ||
* // sort by name in ascending order and age in descending order using a custom sort function | ||
* makeTable({data, sort: {name: 'asc', age: (a, b) => b - a}}) | ||
* printTable({data, sort: {name: 'asc', age: (a, b) => b - a}}) | ||
* ``` | ||
@@ -138,0 +138,0 @@ */ |
{ | ||
"name": "@oclif/table", | ||
"description": "Display table in terminal", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": "Salesforce", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/multi-stage-output/issues", |
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
38409