Bookmark this: tool.io/matrix/as-csv/source-code
Matrix as CSV Source Code
Browse the implementation files for Matrix as CSV.tool.ts typescript
import { matrixAsCsv as formatPortableMatrixAsCsv } from '@tool.io/tools/matrix/as-csv';
export const matrixAsCsv = (input: unknown): string => {
return formatPortableMatrixAsCsv(input) ?? '';
};
export const Tool: TypeTool = {
name: 'Matrix as CSV',
slug: 'matrix/as-csv',
intro: 'Convert a numeric matrix into comma-separated rows.',
tool: matrixAsCsv,
i: [
{
example: '[[1,2],[3,4]]',
label: 'Matrix',
placeholder: 'Enter a matrix',
render: 'textarea',
type: 'text'
}
],
o: [
{
example: '1,2\n3,4',
label: 'CSV',
placeholder: 'CSV will appear here...',
render: 'textarea',
type: 'text'
}
],
alternative: [
{ title: 'Numeric Matrix Parser', url: '/parse/matrix' }
]
};
export default Tool;
Description
Browse the implementation files for Matrix as CSV.