mirror of
https://github.com/simonw/datasette.git
synced 2026-06-23 09:14:34 +02:00
Object not chain of ifs
Refs https://github.com/simonw/datasette/pull/2789/changes#r3453964430
This commit is contained in:
parent
354780a136
commit
a87c4ac555
1 changed files with 7 additions and 10 deletions
|
|
@ -60,17 +60,14 @@ function tableCreateColumnTypes() {
|
|||
: ["text", "integer", "float", "blob"];
|
||||
}
|
||||
|
||||
var SQLITE_COLUMN_TYPE_LABELS = {
|
||||
float: "floating point number",
|
||||
real: "floating point number",
|
||||
blob: "blob - binary data",
|
||||
};
|
||||
|
||||
function sqliteColumnTypeLabel(type) {
|
||||
if (type === "float") {
|
||||
return "floating point number";
|
||||
}
|
||||
if (type === "real") {
|
||||
return "floating point number";
|
||||
}
|
||||
if (type === "blob") {
|
||||
return "blob - binary data";
|
||||
}
|
||||
return type;
|
||||
return SQLITE_COLUMN_TYPE_LABELS[type] || type;
|
||||
}
|
||||
|
||||
function populateSqliteColumnTypeSelect(select, type, options) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue