Reference · Rolls and exact odds
csvCellfunction
One cell of CSV. Quoted when it holds a comma, a quote or a line break. A
cell that a spreadsheet would run as a formula (one starting with =, +,
-, @, a tab or a carriage return) is given a leading apostrophe, unless
it is simply a number, so that opening an export can never run anything.
Import it
import { csvCell } from "@johnmorrisdotca/korokoro";
Definition
function csvCell(value: string | number): string
Parameters
| Name | Type | Description |
|---|---|---|
value | string | number | The candidate face, value or name to check. |
Returns
string
One cell of CSV. Quoted when it holds a comma, a quote or a line break. A cell that a spreadsheet would run as a formula (one starting with =, +, -, @, a tab or a carriage return) is given a leading apostrophe, unless it is simply a number, so that opening an export can never run anything.
Examples
import { csvCell } from "@johnmorrisdotca/korokoro";
console.log(csvCell("A quote: \" and a comma, here"));"A quote: "" and a comma, here"What it prints (run when this page was built)