mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
25 lines
638 B
TypeScript
25 lines
638 B
TypeScript
|
// Loaded from https://raw.githubusercontent.com/denjucks/dex/master/lib/dialects/sqlite3/formatter.js
|
||
|
|
||
|
|
||
|
import Formatter from '../../formatter.js';
|
||
|
import Raw from '../../raw.js';
|
||
|
|
||
|
export default class SQlite3_Formatter extends Formatter {
|
||
|
values(values) {
|
||
|
if (Array.isArray(values)) {
|
||
|
if (Array.isArray(values[0])) {
|
||
|
return `( values ${values
|
||
|
.map((value) => `(${this.parameterize(value)})`)
|
||
|
.join(', ')})`;
|
||
|
}
|
||
|
return `(${this.parameterize(values)})`;
|
||
|
}
|
||
|
|
||
|
if (values instanceof Raw) {
|
||
|
return `(${this.parameter(values)})`;
|
||
|
}
|
||
|
|
||
|
return this.parameter(values);
|
||
|
}
|
||
|
};
|